From da5ffe4bccdea17b49d2ac89db813d8255b3d6ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Mon, 25 Mar 2019 23:09:06 +0100 Subject: [PATCH] Correctly get the total screen geometry get_root_window() does not work on Wayland Fixes #9637 --- gajim/gtk/util.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/gajim/gtk/util.py b/gajim/gtk/util.py index 6a9ee595b..de665661f 100644 --- a/gajim/gtk/util.py +++ b/gajim/gtk/util.py @@ -118,11 +118,17 @@ def get_iconset_name_for(name: str) -> str: def get_total_screen_geometry() -> Tuple[int, int]: - screen = Gdk.Screen.get_default() - window = Gdk.Screen.get_root_window(screen) - width, height = window.get_width(), window.get_height() - log.debug('Get screen geometry: %s %s', width, height) - return width, height + total_width = 0 + total_height = 0 + display = Gdk.Display.get_default() + monitors = display.get_n_monitors() + for num in range(0, monitors): + monitor = display.get_monitor(num) + geometry = monitor.get_geometry() + total_width += geometry.width + total_height = max(total_height, geometry.height) + log.debug('Get screen geometry: %s %s', total_width, total_height) + return total_width, total_height def resize_window(window: Gtk.Window, width: int, height: int) -> None: