mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-07 08:58:38 +00:00
[Gtk] Refactor presenting window
Include the correct usage for other display servers. Still not sure how to get the proper timestamp for Wayland or Quartz but I read that using 0 equals the GDK_CURRENT_TIME which suffices for now.
This commit is contained in:
parent
a2dee79439
commit
e1c4069a72
2 changed files with 15 additions and 4 deletions
|
@ -176,11 +176,17 @@ class AddTorrentDialog(component.Component):
|
||||||
self.dialog.set_transient_for(None)
|
self.dialog.set_transient_for(None)
|
||||||
self.dialog.set_position(Gtk.WindowPosition.CENTER)
|
self.dialog.set_position(Gtk.WindowPosition.CENTER)
|
||||||
|
|
||||||
self.dialog.present()
|
|
||||||
if focus:
|
if focus:
|
||||||
timestamp = main_window.get_timestamp()
|
timestamp = main_window.get_timestamp()
|
||||||
if windowing('X11'):
|
if windowing('X11'):
|
||||||
|
# Use present with X11 set_user_time since
|
||||||
|
# present_with_time is inconsistent.
|
||||||
|
self.dialog.present()
|
||||||
self.dialog.get_window().set_user_time(timestamp)
|
self.dialog.get_window().set_user_time(timestamp)
|
||||||
|
else:
|
||||||
|
self.dialog.present_with_time(timestamp)
|
||||||
|
else:
|
||||||
|
self.dialog.present()
|
||||||
|
|
||||||
def hide(self):
|
def hide(self):
|
||||||
self.dialog.hide()
|
self.dialog.hide()
|
||||||
|
|
|
@ -178,9 +178,14 @@ class MainWindow(component.Component):
|
||||||
def restore():
|
def restore():
|
||||||
# Restore the proper x,y coords for the window prior to showing it
|
# Restore the proper x,y coords for the window prior to showing it
|
||||||
component.resume(self.child_components)
|
component.resume(self.child_components)
|
||||||
|
timestamp = self.get_timestamp()
|
||||||
|
if windowing('X11'):
|
||||||
|
# Use present with X11 set_user_time since
|
||||||
|
# present_with_time is inconsistent.
|
||||||
self.window.present()
|
self.window.present()
|
||||||
if GdkX11:
|
self.window.get_window().set_user_time(timestamp)
|
||||||
self.window.get_window().set_user_time(self.get_timestamp())
|
else:
|
||||||
|
self.window.present_with_time(timestamp)
|
||||||
self.load_window_state()
|
self.load_window_state()
|
||||||
|
|
||||||
if self.config['lock_tray'] and not self.visible():
|
if self.config['lock_tray'] and not self.visible():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue