diff options
Diffstat (limited to 'src/WinClient.cc')
-rw-r--r-- | src/WinClient.cc | 25 |
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 | ||
909 | bool 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 | |||
908 | void WinClient::removeTransientFromWaitingList() { | 933 | void WinClient::removeTransientFromWaitingList() { |
909 | 934 | ||
910 | // holds the windows that dont have empty | 935 | // holds the windows that dont have empty |