all repos — fluxbox @ f5f979ef374623fffc321300ec7f699acd20e426

custom fork of the fluxbox windowmanager

make client windows only reparented one below toplevel - i.e. not into
clientarea
rathnor rathnor
commit

f5f979ef374623fffc321300ec7f699acd20e426

parent

6b9b0e89e4549787077ccbdef67893443c76dc75

6 files changed, 80 insertions(+), 58 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,5 +1,14 @@

(Format: Year/Month/Day) Changes for 0.9.6: +*03/10/27: + * Change FbWinFrame to NOT reparent client windows into clientarea (Simon) + - fixes (I think) java bug with missing drawing bits of window + - allows us to remove some dodgy "and for parent" hacks (not done in + this patch, but will be in new action system which depends on this) + - clientarea still exists for future implementation of improved + sizing, particularly to provide a backing to clients that don't + take up the whole area. + FbWinFrame.hh/cc Window.hh/cc fluxbox.cc *03/10/26: * Fixed bug in FbWindow::setNew (Henrik) It didn't update member variables
M src/FbWinFrame.ccsrc/FbWinFrame.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbWinFrame.cc,v 1.59 2003/10/09 16:48:09 rathnor Exp $ +// $Id: FbWinFrame.cc,v 1.60 2003/10/28 02:17:02 rathnor Exp $ #include "FbWinFrame.hh"

@@ -367,15 +367,17 @@ Display *display = FbTk::App::instance()->display();

XSetWindowBorderWidth(display, win, 0); XChangeSaveSet(display, win, SetModeInsert); - - XSelectInput(display, m_clientarea.window(), NoEventMask); + + XSelectInput(display, m_window.window(), NoEventMask); + // we need to mask this so we don't get unmap event XSelectInput(display, win, NoEventMask); - XReparentWindow(display, win, m_clientarea.window(), 0, 0); + XReparentWindow(display, win, m_window.window(), 0, m_clientarea.y()); // remask window so we get events XSelectInput(display, win, PropertyChangeMask | StructureNotifyMask | FocusChangeMask); - XSelectInput(display, m_clientarea.window(), SubstructureRedirectMask); + XSelectInput(display, m_window.window(), ButtonPressMask | ButtonReleaseMask | + ButtonMotionMask | EnterWindowMask | SubstructureRedirectMask); XFlush(display);

@@ -387,8 +389,8 @@

XChangeWindowAttributes(display, win, CWEventMask|CWDontPropagate, &attrib_set); m_clientarea.raise(); - m_clientarea.showSubwindows(); - + XRaiseWindow(display, win); + m_window.showSubwindows(); } bool FbWinFrame::hideTitlebar() {

@@ -397,7 +399,6 @@ return false;

m_titlebar.hide(); m_use_titlebar = false; - m_clientarea.raise(); // only take away one borderwidth (as the other border is still the "top" border) m_window.resize(m_window.width(), m_window.height() - m_titlebar.height() -

@@ -623,8 +624,12 @@ gripRight().resize(gripLeft().width(),

gripLeft().height()); // align titlebar and render it - if (m_use_titlebar) + if (m_use_titlebar) { reconfigureTitlebar(); + m_titlebar.raise(); + } else + m_titlebar.lower(); + // leave client+grips alone if we're shaded (it'll get fixed when we unshade) if (!m_shaded) {

@@ -643,11 +648,9 @@ }

m_clientarea.moveResize(0, client_top, m_window.width(), client_height); - if (m_use_handle) { - // align handle and grips const int grip_height = m_handle.height(); const int grip_width = 20; //TODO

@@ -662,8 +665,12 @@ grip_width, grip_height);

m_grip_right.moveResize(m_handle.width() - grip_width - handle_bw, -handle_bw, grip_width, grip_height); + m_handle.raise(); + } else { + m_handle.lower(); } - } + } + // render the theme renderButtons();
M src/FbWinFrame.hhsrc/FbWinFrame.hh

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbWinFrame.hh,v 1.23 2003/10/05 09:03:43 rathnor Exp $ +// $Id: FbWinFrame.hh,v 1.24 2003/10/28 02:17:02 rathnor Exp $ #ifndef FBWINFRAME_HH #define FBWINFRAME_HH

@@ -228,7 +228,7 @@ FbTk::FbWindow m_label; ///< holds title

FbTk::FbWindow m_handle; ///< handle between grips FbTk::FbWindow m_grip_right, ///< rightgrip m_grip_left; ///< left grip - FbTk::FbWindow m_clientarea; ///< window that holds client window @see setClientWindow + FbTk::FbWindow m_clientarea; ///< window that sits behind client window to fill gaps @see setClientWindow //@} typedef std::vector<FbTk::Button *> ButtonList; ButtonList m_buttons_left, ///< buttons to the left
M src/Window.ccsrc/Window.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.cc,v 1.242 2003/10/26 20:59:07 fluxgen Exp $ +// $Id: Window.cc,v 1.243 2003/10/28 02:17:02 rathnor Exp $ #include "Window.hh"

@@ -467,12 +467,12 @@ }

upsize(); - associateClientWindow(); + applyDecorations(true); + + associateClientWindow(true, wattrib.x, wattrib.y, wattrib.width, wattrib.height); grabButtons(); - applyDecorations(true); - if (m_workspace_number < 0 || m_workspace_number >= screen().getCount()) m_workspace_number = screen().currentWorkspaceID();

@@ -504,9 +504,6 @@ wattrib.width = 1;

if (wattrib.height <= 0) wattrib.height = 1; - frame().moveResizeForClient(wattrib.x, wattrib.y, - wattrib.width, wattrib.height); - // if we're a transient then we should be on the same layer as our parent if (m_client->isTransient() && m_client->transientFor()->fbwindow() &&

@@ -558,7 +555,7 @@

if (m_shaped) shape(); - + XSync(display, false); } /// apply shape to this window

@@ -607,9 +604,11 @@ evm.add(*this, (*client_it)->window());

// reparent window to this frame().setClientWindow(**client_it); - resizeClient(**client_it, - frame().clientArea().width(), - frame().clientArea().height()); + moveResizeClient(**client_it, + frame().clientArea().x(), + frame().clientArea().y(), + frame().clientArea().width(), + frame().clientArea().height()); (*client_it)->m_win = this; // create a labelbutton for this client and

@@ -910,22 +909,27 @@ return true;

return false; } -void FluxboxWindow::associateClientWindow() { +void FluxboxWindow::associateClientWindow(bool use_attrs, int x, int y, unsigned int width, unsigned int height) { m_client->setBorderWidth(0); updateTitleFromClient(*m_client); updateIconNameFromClient(*m_client); + if (use_attrs) + frame().moveResizeForClient(x, y, + width, height); + else + frame().resizeForClient(m_client->width(), m_client->height()); + frame().setClientWindow(*m_client); - frame().resizeForClient(m_client->width(), m_client->height()); } void FluxboxWindow::grabButtons() { XGrabButton(display, Button1, AnyModifier, - frame().clientArea().window(), True, ButtonPressMask, + frame().window().window(), True, ButtonPressMask, GrabModeSync, GrabModeSync, None, None); - XUngrabButton(display, Button1, Mod1Mask|Mod2Mask|Mod3Mask, frame().clientArea().window()); + XUngrabButton(display, Button1, Mod1Mask|Mod2Mask|Mod3Mask, frame().window().window()); XGrabButton(display, Button1, Mod1Mask, frame().window().window(), True,

@@ -2268,13 +2272,13 @@ if ((! focused) && (! screen().isSloppyFocus())) { //check focus

setInputFocus(); } - if (frame().clientArea() == be.window) { + if (frame().window().window() == be.window) { if (screen().clickRaises()) raise(); XAllowEvents(display, ReplayPointer, be.time); - } else { + m_button_grab_x = be.x_root - frame().x() - frame().window().borderWidth(); - m_button_grab_y = be.y_root - frame().y() - frame().window().borderWidth(); + m_button_grab_y = be.y_root - frame().y() - frame().window().borderWidth(); } if (m_windowmenu.isVisible())

@@ -2668,7 +2672,7 @@ client_move = true;

} frame().reconfigure(); - if (client_move) + if (!initial && client_move) sendConfigureNotify(); }

@@ -3234,10 +3238,11 @@ }

} -void FluxboxWindow::resizeClient(WinClient &client, +void FluxboxWindow::moveResizeClient(WinClient &client, int x, int y, unsigned int height, unsigned int width) { - client.resize(frame().clientArea().width(), - frame().clientArea().height()); + client.moveResize(x, y, + frame().clientArea().width(), + frame().clientArea().height()); client.updateRect(frame().x() + frame().clientArea().x(), frame().y() + frame().clientArea().y(), frame().clientArea().width(),

@@ -3256,29 +3261,29 @@ */

//!! client.x = frame().x(); client.y = frame().y(); - resizeClient(client, + moveResizeClient(client, + frame().clientArea().x(), + frame().clientArea().y(), frame().clientArea().width(), frame().clientArea().height()); - - XEvent event; - event.type = ConfigureNotify; + if (send_to_netizens) { + XEvent event; + event.type = ConfigureNotify; - event.xconfigure.display = display; - event.xconfigure.event = client.window(); - event.xconfigure.window = client.window(); - event.xconfigure.x = frame().x() + frame().clientArea().x(); - event.xconfigure.y = frame().y() + frame().clientArea().y(); - event.xconfigure.width = client.width(); - event.xconfigure.height = client.height(); - event.xconfigure.border_width = client.old_bw; - event.xconfigure.above = frame().window().window(); - event.xconfigure.override_redirect = false; - - XSendEvent(display, client.window(), False, StructureNotifyMask, &event); + event.xconfigure.display = display; + event.xconfigure.event = client.window(); + event.xconfigure.window = client.window(); + event.xconfigure.x = frame().x() + frame().clientArea().x(); + event.xconfigure.y = frame().y() + frame().clientArea().y(); + event.xconfigure.width = client.width(); + event.xconfigure.height = client.height(); + event.xconfigure.border_width = client.old_bw; + event.xconfigure.above = frame().window().window(); + event.xconfigure.override_redirect = false; - if (send_to_netizens) screen().updateNetizenConfigNotify(event); + } } // end for }
M src/Window.hhsrc/Window.hh

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.hh,v 1.99 2003/10/06 06:22:43 rathnor Exp $ +// $Id: Window.hh,v 1.100 2003/10/28 02:17:03 rathnor Exp $ #ifndef WINDOW_HH #define WINDOW_HH

@@ -388,7 +388,7 @@ void updateMWMHintsFromClient(WinClient &client);

void updateBlackboxHintsFromClient(WinClient &client); void saveBlackboxAttribs(); void setNetWMAttributes(); - void associateClientWindow(); + void associateClientWindow(bool use_attrs = false, int x = 0, int y = 0, unsigned int width = 1, unsigned int height = 1); void restoreGravity(); void setGravityOffsets();

@@ -400,7 +400,7 @@ // modifies left and top if snap is necessary

void doSnapping(int &left, int &top); // user_w/h return the values that should be shown to the user void fixsize(int *user_w = 0, int *user_h = 0); - void resizeClient(WinClient &client, unsigned int width, unsigned int height); + void moveResizeClient(WinClient &client, int x, int y, unsigned int width, unsigned int height); /// sends configurenotify to all clients void sendConfigureNotify(bool send_to_netizens = true); // state and hint signals
M src/fluxbox.ccsrc/fluxbox.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.cc,v 1.200 2003/10/14 16:23:15 rathnor Exp $ +// $Id: fluxbox.cc,v 1.201 2003/10/28 02:17:03 rathnor Exp $ #include "fluxbox.hh"

@@ -560,11 +560,12 @@ screen->currentWorkspaceSig().attach(this);

screen->workspaceCountSig().attach(this); screen->workspaceNamesSig().attach(this); screen->clientListSig().attach(this); - + // initiate atomhandler for screen specific stuff for (size_t atomh=0; atomh<m_atomhandler.size(); ++atomh) { m_atomhandler[atomh]->initForScreen(*screen); } + revertFocus(*screen, false); // make sure focus style is correct } m_keyscreen = m_mousescreen = m_screen_list.front();