all repos — fluxbox @ 823ce0d0175b9b14a549117a303cc9e36e81c1a2

custom fork of the fluxbox windowmanager

stop gvim from repeatedly resizing tabbed windows
markt markt
commit

823ce0d0175b9b14a549117a303cc9e36e81c1a2

parent

24c023192fd5757bd1e1308f3aa00a41d0e21728

6 files changed, 50 insertions(+), 12 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,8 +1,11 @@

(Format: Year/Month/Day) Changes for 1.0.0: *07/07/03: + * Avoid some problems with tabbed windows and resize increments (Mark) + Window.cc WinClient.cc/hh * Added utility fluxbox-remote, which takes one argument and has fluxbox execute it just like in the keys file (Mark) + - e.g. fluxbox-remote "CustomMenu ~/.fluxbox/custommenu" Screen.cc util/fluxbox-remote.cc util/Makefile.am * Update systemtray and KDE dockapps in slit when background changes (Mark) Screen.cc/hh Systemtray.cc Slit.cc FbTk/FbPixmap.cc/hh
M src/FbTk/FbPixmap.ccsrc/FbTk/FbPixmap.cc

@@ -114,13 +114,14 @@ // get width, height and depth for the pixmap

Window root; int x, y; unsigned int border_width, bpp; - XGetGeometry(display(), - pm, - &root, - &x, &y, - &m_width, &m_height, - &border_width, - &bpp); + if (!XGetGeometry(display(), + pm, + &root, + &x, &y, + &m_width, &m_height, + &border_width, + &bpp)) + return *this; m_depth = bpp;
M src/FbTk/FbWindow.ccsrc/FbTk/FbWindow.cc

@@ -582,10 +582,10 @@ return;

Window root; unsigned int border_width, depth; - XGetGeometry(display(), m_window, &root, &m_x, &m_y, - (unsigned int *)&m_width, (unsigned int *)&m_height, - &border_width, &depth); - m_depth = depth; + if (XGetGeometry(display(), m_window, &root, &m_x, &m_y, + (unsigned int *)&m_width, (unsigned int *)&m_height, + &border_width, &depth)) + m_depth = depth; } void FbWindow::create(Window parent, int x, int y,
M src/WinClient.ccsrc/WinClient.cc

@@ -884,6 +884,31 @@ if (display_height)

*display_height = j; } +// check if the given width and height satisfy the size hints +bool WinClient::checkSizeHints(unsigned int width, unsigned int height) { + if (width < min_width || height < min_height) + return false; + + if (width > max_width || height > max_height) + return false; + + if ((width - base_width) % width_inc != 0) + return false; + + if ((height - base_height) % height_inc != 0) + return false; + + double ratio = (double)width / (double)height; + + if (min_aspect_y > 0 && (double)min_aspect_x / (double)min_aspect_y > ratio) + return false; + + if (max_aspect_y > 0 && (double)max_aspect_x / (double)max_aspect_y < ratio) + return false; + + return true; +} + void WinClient::removeTransientFromWaitingList() { // holds the windows that dont have empty
M src/WinClient.hhsrc/WinClient.hh

@@ -89,7 +89,7 @@ * We use pointers for display_* since they are optional.

*/ void applySizeHints(int &width, int &height, int *display_width = 0, int *display_height = 0, bool maximizing = false); - + bool checkSizeHints(unsigned int width, unsigned int height); void setGroupLeftWindow(Window win);
M src/Window.ccsrc/Window.cc

@@ -2564,6 +2564,15 @@

int cx = frame().x(), cy = frame().y(), ignore = 0; unsigned int cw = frame().width(), ch = frame().height(); + // if this is not m_client and m_client has resize_inc, make sure the new + // size would be ok with m_client + if (client != m_client && cr.value_mask & CWWidth && + cr.value_mask & CWHeight && + !m_client->checkSizeHints(cr.width, cr.height)) { + sendConfigureNotify(); + return; + } + if (cr.value_mask & CWBorderWidth) client->old_bw = cr.border_width;