Changeset e1c406


Ignore:
Timestamp:
06/12/2019 03:57:48 PM (6 years ago)
Author:
Calum Lind <calumlind+deluge@gmail.com>
Branches:
2.0.x, develop, master
Children:
b711cd
Parents:
a2dee7
Message:

[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.

Location:
deluge/ui/gtk3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • deluge/ui/gtk3/addtorrentdialog.py

    ra2dee7 re1c406  
    177177            self.dialog.set_position(Gtk.WindowPosition.CENTER)
    178178
    179         self.dialog.present()
    180179        if focus:
    181180            timestamp = main_window.get_timestamp()
    182181            if windowing('X11'):
     182                # Use present with X11 set_user_time since
     183                # present_with_time is inconsistent.
     184                self.dialog.present()
    183185                self.dialog.get_window().set_user_time(timestamp)
     186            else:
     187                self.dialog.present_with_time(timestamp)
     188        else:
     189            self.dialog.present()
    184190
    185191    def hide(self):
  • deluge/ui/gtk3/mainwindow.py

    ra2dee7 re1c406  
    179179            # Restore the proper x,y coords for the window prior to showing it
    180180            component.resume(self.child_components)
    181             self.window.present()
    182             if GdkX11:
    183                 self.window.get_window().set_user_time(self.get_timestamp())
     181            timestamp = self.get_timestamp()
     182            if windowing('X11'):
     183                # Use present with X11 set_user_time since
     184                # present_with_time is inconsistent.
     185                self.window.present()
     186                self.window.get_window().set_user_time(timestamp)
     187            else:
     188                self.window.present_with_time(timestamp)
    184189            self.load_window_state()
    185190
Note: See TracChangeset for help on using the changeset viewer.