aboutsummaryrefslogtreecommitdiff
path: root/src/WinClient.cc
diff options
context:
space:
mode:
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 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