Philipp Hörist pushed to branch master at gajim / gajim
Commits: 1551ffa0 by Philipp Hörist at 2019-03-25T22:09:06Z Correctly get the total screen geometry
get_root_window() does not work on Wayland
Fixes #9637
- - - - -
1 changed file:
- gajim/gtk/util.py
Changes:
===================================== gajim/gtk/util.py ===================================== @@ -271,11 +271,17 @@ def get_available_iconsets():
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:
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/1551ffa0b402f07a913b101c8421f1830e2...