stop gvim from repeatedly resizing tabbed windows

This commit is contained in:
markt 2007-07-03 21:08:07 +00:00
parent 24c023192f
commit 823ce0d017
6 changed files with 50 additions and 12 deletions

View file

@ -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

View file

@ -114,13 +114,14 @@ FbPixmap &FbPixmap::operator = (Pixmap pm) {
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;

View file

@ -582,10 +582,10 @@ void FbWindow::updateGeometry() {
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,

View file

@ -884,6 +884,31 @@ void WinClient::applySizeHints(int &width, int &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

View file

@ -89,7 +89,7 @@ public:
*/
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);

View file

@ -2564,6 +2564,15 @@ void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent &cr) {
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;