aboutsummaryrefslogtreecommitdiff
path: root/src/WinClient.cc
diff options
context:
space:
mode:
authormarkt <markt>2007-07-03 21:09:05 (GMT)
committermarkt <markt>2007-07-03 21:09:05 (GMT)
commit8f6434efa67b2f11548c9862aaa0d29488645500 (patch)
treead8e627d4d2b3aa4e46e4c60bd2034d93130ff45 /src/WinClient.cc
parentdf5974b9235a345ae68fa8ff96256ae68ab2518b (diff)
downloadfluxbox-8f6434efa67b2f11548c9862aaa0d29488645500.zip
fluxbox-8f6434efa67b2f11548c9862aaa0d29488645500.tar.bz2
stop gvim from repeatedly resizing tabbed windows
Diffstat (limited to 'src/WinClient.cc')
-rw-r--r--src/WinClient.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/WinClient.cc b/src/WinClient.cc
index ddf0599..a9d5865 100644
--- a/src/WinClient.cc
+++ b/src/WinClient.cc
@@ -905,6 +905,31 @@ void WinClient::applySizeHints(int &width, int &height,
905 *display_height = j; 905 *display_height = j;
906} 906}
907 907
908// check if the given width and height satisfy the size hints
909bool WinClient::checkSizeHints(unsigned int width, unsigned int height) {
910 if (width < min_width || height < min_height)
911 return false;
912
913 if (width > max_width || height > max_height)
914 return false;
915
916 if ((width - base_width) % width_inc != 0)
917 return false;
918
919 if ((height - base_height) % height_inc != 0)
920 return false;
921
922 double ratio = (double)width / (double)height;
923
924 if (min_aspect_y > 0 && (double)min_aspect_x / (double)min_aspect_y > ratio)
925 return false;
926
927 if (max_aspect_y > 0 && (double)max_aspect_x / (double)max_aspect_y < ratio)
928 return false;
929
930 return true;
931}
932
908void WinClient::removeTransientFromWaitingList() { 933void WinClient::removeTransientFromWaitingList() {
909 934
910 // holds the windows that dont have empty 935 // holds the windows that dont have empty