aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormarkt <markt>2007-07-03 21:08:07 (GMT)
committermarkt <markt>2007-07-03 21:08:07 (GMT)
commit823ce0d0175b9b14a549117a303cc9e36e81c1a2 (patch)
tree0c8fc51a360db9b88f793663cb89eb79d4d76ca5 /src
parent24c023192fd5757bd1e1308f3aa00a41d0e21728 (diff)
downloadfluxbox_pavel-823ce0d0175b9b14a549117a303cc9e36e81c1a2.zip
fluxbox_pavel-823ce0d0175b9b14a549117a303cc9e36e81c1a2.tar.bz2
stop gvim from repeatedly resizing tabbed windows
Diffstat (limited to 'src')
-rw-r--r--src/FbTk/FbPixmap.cc15
-rw-r--r--src/FbTk/FbWindow.cc8
-rw-r--r--src/WinClient.cc25
-rw-r--r--src/WinClient.hh2
-rw-r--r--src/Window.cc9
5 files changed, 47 insertions, 12 deletions
diff --git a/src/FbTk/FbPixmap.cc b/src/FbTk/FbPixmap.cc
index 9143232..0289ddd 100644
--- a/src/FbTk/FbPixmap.cc
+++ b/src/FbTk/FbPixmap.cc
@@ -114,13 +114,14 @@ FbPixmap &FbPixmap::operator = (Pixmap pm) {
114 Window root; 114 Window root;
115 int x, y; 115 int x, y;
116 unsigned int border_width, bpp; 116 unsigned int border_width, bpp;
117 XGetGeometry(display(), 117 if (!XGetGeometry(display(),
118 pm, 118 pm,
119 &root, 119 &root,
120 &x, &y, 120 &x, &y,
121 &m_width, &m_height, 121 &m_width, &m_height,
122 &border_width, 122 &border_width,
123 &bpp); 123 &bpp))
124 return *this;
124 125
125 m_depth = bpp; 126 m_depth = bpp;
126 127
diff --git a/src/FbTk/FbWindow.cc b/src/FbTk/FbWindow.cc
index 3dce5b8..2c2bb24 100644
--- a/src/FbTk/FbWindow.cc
+++ b/src/FbTk/FbWindow.cc
@@ -582,10 +582,10 @@ void FbWindow::updateGeometry() {
582 582
583 Window root; 583 Window root;
584 unsigned int border_width, depth; 584 unsigned int border_width, depth;
585 XGetGeometry(display(), m_window, &root, &m_x, &m_y, 585 if (XGetGeometry(display(), m_window, &root, &m_x, &m_y,
586 (unsigned int *)&m_width, (unsigned int *)&m_height, 586 (unsigned int *)&m_width, (unsigned int *)&m_height,
587 &border_width, &depth); 587 &border_width, &depth))
588 m_depth = depth; 588 m_depth = depth;
589} 589}
590 590
591void FbWindow::create(Window parent, int x, int y, 591void FbWindow::create(Window parent, int x, int y,
diff --git a/src/WinClient.cc b/src/WinClient.cc
index d4e3e72..989088b 100644
--- a/src/WinClient.cc
+++ b/src/WinClient.cc
@@ -884,6 +884,31 @@ void WinClient::applySizeHints(int &width, int &height,
884 *display_height = j; 884 *display_height = j;
885} 885}
886 886
887// check if the given width and height satisfy the size hints
888bool WinClient::checkSizeHints(unsigned int width, unsigned int height) {
889 if (width < min_width || height < min_height)
890 return false;
891
892 if (width > max_width || height > max_height)
893 return false;
894
895 if ((width - base_width) % width_inc != 0)
896 return false;
897
898 if ((height - base_height) % height_inc != 0)
899 return false;
900
901 double ratio = (double)width / (double)height;
902
903 if (min_aspect_y > 0 && (double)min_aspect_x / (double)min_aspect_y > ratio)
904 return false;
905
906 if (max_aspect_y > 0 && (double)max_aspect_x / (double)max_aspect_y < ratio)
907 return false;
908
909 return true;
910}
911
887void WinClient::removeTransientFromWaitingList() { 912void WinClient::removeTransientFromWaitingList() {
888 913
889 // holds the windows that dont have empty 914 // holds the windows that dont have empty
diff --git a/src/WinClient.hh b/src/WinClient.hh
index 01517c2..deb98b9 100644
--- a/src/WinClient.hh
+++ b/src/WinClient.hh
@@ -89,7 +89,7 @@ public:
89 */ 89 */
90 void applySizeHints(int &width, int &height, int *display_width = 0, 90 void applySizeHints(int &width, int &height, int *display_width = 0,
91 int *display_height = 0, bool maximizing = false); 91 int *display_height = 0, bool maximizing = false);
92 92 bool checkSizeHints(unsigned int width, unsigned int height);
93 93
94 void setGroupLeftWindow(Window win); 94 void setGroupLeftWindow(Window win);
95 95
diff --git a/src/Window.cc b/src/Window.cc
index af74074..f6fe225 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -2564,6 +2564,15 @@ void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent &cr) {
2564 int cx = frame().x(), cy = frame().y(), ignore = 0; 2564 int cx = frame().x(), cy = frame().y(), ignore = 0;
2565 unsigned int cw = frame().width(), ch = frame().height(); 2565 unsigned int cw = frame().width(), ch = frame().height();
2566 2566
2567 // if this is not m_client and m_client has resize_inc, make sure the new
2568 // size would be ok with m_client
2569 if (client != m_client && cr.value_mask & CWWidth &&
2570 cr.value_mask & CWHeight &&
2571 !m_client->checkSizeHints(cr.width, cr.height)) {
2572 sendConfigureNotify();
2573 return;
2574 }
2575
2567 if (cr.value_mask & CWBorderWidth) 2576 if (cr.value_mask & CWBorderWidth)
2568 client->old_bw = cr.border_width; 2577 client->old_bw = cr.border_width;
2569 2578