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'):
|
||||
# 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,
|
||||
gajim.config.get('single-msg-width'),
|
||||
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()
|
||||
|
||||
def on_single_message_window_destroy(self, widget):
|
||||
|
|
|
@ -247,6 +247,11 @@ def move_window(window, x, y):
|
|||
x = 0
|
||||
if 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)
|
||||
|
||||
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
|
||||
if not self.one_window_opened(contact, acct, type):
|
||||
self._position_window(win, acct, type)
|
||||
self._resize_window(win, acct, type)
|
||||
self._position_window(win, acct, type)
|
||||
|
||||
self._windows[win_key] = win
|
||||
return win
|
||||
|
|
|
@ -5420,12 +5420,12 @@ class RosterWindow:
|
|||
# no need of this variable
|
||||
self.have_new_chat_accel = False # Is the "Ctrl+N" shown ?
|
||||
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,
|
||||
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'))
|
||||
|
||||
self.popups_notification_height = 0
|
||||
self.popup_notification_windows = []
|
||||
|
|
Loading…
Reference in New Issue