From 5d99519925bb7853c87e6c9e0f4e90d3ecaa66d1 Mon Sep 17 00:00:00 2001 From: Roman Sirokov Date: Fri, 1 Mar 2024 23:42:02 +0200 Subject: [PATCH] [GTK] Update deprecations --- webview/platforms/gtk.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/webview/platforms/gtk.py b/webview/platforms/gtk.py index 17cf23aa..c93c3688 100755 --- a/webview/platforms/gtk.py +++ b/webview/platforms/gtk.py @@ -81,7 +81,9 @@ def __init__(self, window: Window) -> None: if window.screen: self.screen = window.screen.frame else: - self.screen = Gdk.Screen.get_default().get_monitor_geometry(0) + display = Gdk.Display.get_default() + monitor = Gdk.Display.get_monitor(display, 0) + self.screen = Gdk.Monitor.get_geometry(monitor) if window.resizable: self.window.set_size_request(window.min_size[0], window.min_size[1]) @@ -902,9 +904,10 @@ def _get_size(): def get_screens(): - screen = Gdk.Screen.get_default() - n = screen.get_n_monitors() - geometries = [screen.get_monitor_geometry(i) for i in range(n)] + display = Gdk.Display.get_default() + n = display.get_n_monitors() + monitors = [Gdk.Display.get_monitor(display, i) for i in range(n)] + geometries = [Gdk.Monitor.get_geometry(m) for m in monitors] screens = [Screen(geom.width, geom.height, geom) for geom in geometries] return screens