never move a window outside the screen. fixes #3501
This commit is contained in:
parent
ae36e4962a
commit
b3bafa75ff
|
@ -2063,12 +2063,12 @@ class SingleMessageWindow:
|
||||||
|
|
||||||
if gajim.config.get('saveposition'):
|
if gajim.config.get('saveposition'):
|
||||||
# get window position and size from config
|
# get window position and size from config
|
||||||
gtkgui_helpers.move_window(self.window,
|
|
||||||
gajim.config.get('single-msg-x-position'),
|
|
||||||
gajim.config.get('single-msg-y-position'))
|
|
||||||
gtkgui_helpers.resize_window(self.window,
|
gtkgui_helpers.resize_window(self.window,
|
||||||
gajim.config.get('single-msg-width'),
|
gajim.config.get('single-msg-width'),
|
||||||
gajim.config.get('single-msg-height'))
|
gajim.config.get('single-msg-height'))
|
||||||
|
gtkgui_helpers.move_window(self.window,
|
||||||
|
gajim.config.get('single-msg-x-position'),
|
||||||
|
gajim.config.get('single-msg-y-position'))
|
||||||
self.window.show_all()
|
self.window.show_all()
|
||||||
|
|
||||||
def on_single_message_window_destroy(self, widget):
|
def on_single_message_window_destroy(self, widget):
|
||||||
|
|
|
@ -247,6 +247,11 @@ def move_window(window, x, y):
|
||||||
x = 0
|
x = 0
|
||||||
if y < 0:
|
if y < 0:
|
||||||
y = 0
|
y = 0
|
||||||
|
w, h = window.get_size()
|
||||||
|
if x + w > screen_w:
|
||||||
|
x = screen_w - w
|
||||||
|
if y + h > screen_h:
|
||||||
|
y = screen_h - h
|
||||||
window.move(x, y)
|
window.move(x, y)
|
||||||
|
|
||||||
def resize_window(window, w, h):
|
def resize_window(window, w, h):
|
||||||
|
|
|
@ -870,8 +870,8 @@ class MessageWindowMgr(gobject.GObject):
|
||||||
|
|
||||||
# Position and size window based on saved state and window mode
|
# Position and size window based on saved state and window mode
|
||||||
if not self.one_window_opened(contact, acct, type):
|
if not self.one_window_opened(contact, acct, type):
|
||||||
self._position_window(win, acct, type)
|
|
||||||
self._resize_window(win, acct, type)
|
self._resize_window(win, acct, type)
|
||||||
|
self._position_window(win, acct, type)
|
||||||
|
|
||||||
self._windows[win_key] = win
|
self._windows[win_key] = win
|
||||||
return win
|
return win
|
||||||
|
|
|
@ -5420,12 +5420,12 @@ class RosterWindow:
|
||||||
# no need of this variable
|
# no need of this variable
|
||||||
self.have_new_chat_accel = False # Is the "Ctrl+N" shown ?
|
self.have_new_chat_accel = False # Is the "Ctrl+N" shown ?
|
||||||
if gajim.config.get('saveposition'):
|
if gajim.config.get('saveposition'):
|
||||||
gtkgui_helpers.move_window(self.window,
|
|
||||||
gajim.config.get('roster_x-position'),
|
|
||||||
gajim.config.get('roster_y-position'))
|
|
||||||
gtkgui_helpers.resize_window(self.window,
|
gtkgui_helpers.resize_window(self.window,
|
||||||
gajim.config.get('roster_width'),
|
gajim.config.get('roster_width'),
|
||||||
gajim.config.get('roster_height'))
|
gajim.config.get('roster_height'))
|
||||||
|
gtkgui_helpers.move_window(self.window,
|
||||||
|
gajim.config.get('roster_x-position'),
|
||||||
|
gajim.config.get('roster_y-position'))
|
||||||
|
|
||||||
self.popups_notification_height = 0
|
self.popups_notification_height = 0
|
||||||
self.popup_notification_windows = []
|
self.popup_notification_windows = []
|
||||||
|
|
Loading…
Reference in New Issue