From 2c6b35645ec138ed04af84f39765856dd4e76c63 Mon Sep 17 00:00:00 2001 From: Gaetan Semet Date: Tue, 15 Jul 2014 14:13:56 +0200 Subject: [PATCH] rework how to get current screen height (fix #337) Signed-off-by: Gaetan Semet --- src/guake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/guake b/src/guake index d75f8783..57b6d5f6 100755 --- a/src/guake +++ b/src/guake @@ -898,7 +898,11 @@ class Guake(SimpleGladeApp): if not 'GDK_BUTTON1_MASK' in mod.value_names: return - max_height = self.window.get_screen().get_height() + screen = self.window.get_screen() + x, y, _ = screen.get_root_window().get_pointer() + screen_no = screen.get_monitor_at_point(x, y) + + max_height = screen.get_monitor_geometry(screen_no).height percent = y / (max_height / 100) if percent < 1: @@ -1133,7 +1137,7 @@ class Guake(SimpleGladeApp): window_rect.height = window_rect.height * height / 100 window_rect.width = window_rect.width * width / 100 - if width < total_width: + if window_rect.width < total_width: if halignment == ALIGN_CENTER: window_rect.x += (total_width - window_rect.width) / 2 elif halignment == ALIGN_LEFT: