Skip to content

Commit

Permalink
[GTK] Update deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
r0x0r committed Mar 1, 2024
1 parent 54cd806 commit 5d99519
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions webview/platforms/gtk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5d99519

Please sign in to comment.