Commit c2ea566b authored by Yann Leboulanger's avatar Yann Leboulanger

add advanced option to allow not saving roster position. Fixes #5712

parent 82f77772
......@@ -147,6 +147,7 @@ class Config:
'single-msg-y-position': [opt_int, 0],
'single-msg-width': [opt_int, 400],
'single-msg-height': [opt_int, 280],
'save-roster-position': [opt_bool, True, _('If true, Gajim will save roster position when hiding roster, and restore it when showing roster.')],
'roster_x-position': [ opt_int, 0 ],
'roster_y-position': [ opt_int, 0 ],
'roster_width': [ opt_int, 200 ],
......
......@@ -2337,9 +2337,10 @@ def prepare_quit(self):
# in case show_roster_on_start is False and roster is never shown
# window.window is None
if self.window.window is not None:
x, y = self.window.window.get_root_origin()
gajim.config.set('roster_x-position', x)
gajim.config.set('roster_y-position', y)
if gajim.config.get('save-roster-position'):
x, y = self.window.window.get_root_origin()
gajim.config.set('roster_x-position', x)
gajim.config.set('roster_y-position', y)
width, height = self.window.get_size()
# For the width use the size of the vbox containing the tree and
# status combo, this will cancel out any hpaned width
......@@ -6150,9 +6151,10 @@ def __init__(self):
gtkgui_helpers.resize_window(self.window,
gajim.config.get('roster_width'),
gajim.config.get('roster_height'))
gtkgui_helpers.move_window(self.window,
gajim.config.get('roster_x-position'),
gajim.config.get('roster_y-position'))
if gajim.config.get('save-roster-position'):
gtkgui_helpers.move_window(self.window,
gajim.config.get('roster_x-position'),
gajim.config.get('roster_y-position'))
self.popups_notification_height = 0
self.popup_notification_windows = []
......
......@@ -396,7 +396,8 @@ def on_left_click(self):
# we could be in another VD right now. eg vd2
# and we want to show it in vd2
if not gtkgui_helpers.possibly_move_window_in_current_desktop(win):
if not gtkgui_helpers.possibly_move_window_in_current_desktop(
win) and gajim.config.get('save-roster-position'):
x, y = win.get_position()
gajim.config.set('roster_x-position', x)
gajim.config.set('roster_y-position', y)
......@@ -404,9 +405,10 @@ def on_left_click(self):
else:
if not win.get_property('visible'):
win.show_all()
gtkgui_helpers.move_window(win,
gajim.config.get('roster_x-position'),
gajim.config.get('roster_y-position'))
if gajim.config.get('save-roster-position'):
gtkgui_helpers.move_window(win,
gajim.config.get('roster_x-position'),
gajim.config.get('roster_y-position'))
if not gajim.config.get('roster_window_skip_taskbar'):
win.set_property('skip-taskbar-hint', False)
win.present_with_time(gtk.get_current_event_time())
......@@ -418,7 +420,8 @@ def handle_first_event(self):
if not event:
return
win = gajim.interface.roster.window
if not win.get_property('visible'):
if not win.get_property('visible') and gajim.config.get(
'save-roster-position'):
gtkgui_helpers.move_window(win,
gajim.config.get('roster_x-position'),
gajim.config.get('roster_y-position'))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment