mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-06 08:28:39 +00:00
[GTKUI] Fix showing main window when starting in tray
* Also fixes the prefs and dialogs now showing due to first_show not connecting signals when starting in tray.
This commit is contained in:
parent
3032e5eb21
commit
4feef3be78
1 changed files with 9 additions and 12 deletions
|
@ -115,13 +115,14 @@ class MainWindow(component.Component):
|
||||||
self.gtk_builder_signals_holder.connect_signals(mapping_or_class)
|
self.gtk_builder_signals_holder.connect_signals(mapping_or_class)
|
||||||
|
|
||||||
def first_show(self):
|
def first_show(self):
|
||||||
|
self.main_builder.prev_connect_signals(self.gtk_builder_signals_holder)
|
||||||
|
self.vpaned.set_position(self.initial_vpaned_position)
|
||||||
if not (
|
if not (
|
||||||
self.config['start_in_tray'] and self.config['enable_system_tray']
|
self.config['start_in_tray'] and self.config['enable_system_tray']
|
||||||
) and not self.window.get_property('visible'):
|
) and not self.window.get_property('visible'):
|
||||||
log.debug('Showing window')
|
log.debug('Showing window')
|
||||||
self.main_builder.prev_connect_signals(self.gtk_builder_signals_holder)
|
|
||||||
self.vpaned.set_position(self.initial_vpaned_position)
|
|
||||||
self.show()
|
self.show()
|
||||||
|
|
||||||
while gtk.events_pending():
|
while gtk.events_pending():
|
||||||
gtk.main_iteration()
|
gtk.main_iteration()
|
||||||
|
|
||||||
|
@ -134,20 +135,13 @@ class MainWindow(component.Component):
|
||||||
component.pause(self.child_components)
|
component.pause(self.child_components)
|
||||||
|
|
||||||
# Store the x, y positions for when we restore the window
|
# Store the x, y positions for when we restore the window
|
||||||
self.window_x_pos, self.window_y_pos = self.window.get_position()
|
self.config['window_x_pos'], self.config['window_y_pos'] = self.window.get_position()
|
||||||
self.window.hide()
|
self.window.hide()
|
||||||
|
|
||||||
def present(self):
|
def present(self):
|
||||||
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
|
||||||
if self.window_x_pos == -32000 or self.window_y_pos == -32000:
|
|
||||||
self.config['window_x_pos'] = self.config['window_y_pos'] = 0
|
|
||||||
else:
|
|
||||||
self.config['window_x_pos'] = self.window_x_pos
|
|
||||||
self.config['window_y_pos'] = self.window_y_pos
|
|
||||||
|
|
||||||
component.resume(self.child_components)
|
component.resume(self.child_components)
|
||||||
|
|
||||||
self.window.present()
|
self.window.present()
|
||||||
self.load_window_state()
|
self.load_window_state()
|
||||||
|
|
||||||
|
@ -210,6 +204,9 @@ class MainWindow(component.Component):
|
||||||
quit_gtkui()
|
quit_gtkui()
|
||||||
|
|
||||||
def load_window_state(self):
|
def load_window_state(self):
|
||||||
|
if self.config['window_x_pos'] == -32000 or self.config['window_x_pos'] == -32000:
|
||||||
|
self.config['window_x_pos'] = self.config['window_y_pos'] = 0
|
||||||
|
|
||||||
self.window.move(self.config['window_x_pos'], self.config['window_y_pos'])
|
self.window.move(self.config['window_x_pos'], self.config['window_y_pos'])
|
||||||
self.window.resize(self.config['window_width'], self.config['window_height'])
|
self.window.resize(self.config['window_width'], self.config['window_height'])
|
||||||
if self.config['window_maximized']:
|
if self.config['window_maximized']:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue