Skip to content
Snippets Groups Projects
Commit 1551ffa0 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Correctly get the total screen geometry

get_root_window() does not work on Wayland

Fixes #9637
parent 82016886
No related branches found
No related tags found
No related merge requests found
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment