diff --git a/gajim/dialogs.py b/gajim/dialogs.py index fd8cd4833..3a3af2b63 100644 --- a/gajim/dialogs.py +++ b/gajim/dialogs.py @@ -3179,7 +3179,7 @@ class PopupNotificationWindow: window_width, self.window_height = self.window.get_size() app.interface.roster.popups_notification_height += self.window_height pos_x = app.config.get('notification_position_x') - screen_w, screen_h = gtkgui_helpers.get_display_geometry() + screen_w, screen_h = gtkgui_helpers.get_total_screen_geometry() if pos_x < 0: pos_x = screen_w - window_width + pos_x + 1 pos_y = app.config.get('notification_position_y') @@ -3216,7 +3216,7 @@ class PopupNotificationWindow: current_index += 1 window_width, window_height = window_instance.window.get_size() app.interface.roster.popups_notification_height += window_height - screen_w, screen_h = gtkgui_helpers.get_display_geometry() + screen_w, screen_h = gtkgui_helpers.get_total_screen_geometry() window_instance.window.move(screen_w - window_width, screen_h - \ app.interface.roster.popups_notification_height) diff --git a/gajim/gtkgui_helpers.py b/gajim/gtkgui_helpers.py index 28cb7f8e1..fc201a600 100644 --- a/gajim/gtkgui_helpers.py +++ b/gajim/gtkgui_helpers.py @@ -100,11 +100,10 @@ if os.name == 'nt': from gajim.common import helpers -def get_display_geometry(): - display = Gdk.Display.get_default() - monitor = display.get_monitor(0) - geometry = monitor.get_geometry() - return geometry.width, geometry.height +def get_total_screen_geometry(): + screen = Gdk.Screen.get_default() + window = Gdk.Screen.get_root_window(screen) + return window.get_width(), window.get_height() def add_image_to_button(button, icon_name): img = Gtk.Image() @@ -175,7 +174,7 @@ def move_window(window, x, y): """ Move the window, but also check if out of screen """ - screen_w, screen_h = get_display_geometry() + screen_w, screen_h = get_total_screen_geometry() if x < 0: x = 0 if y < 0: @@ -191,7 +190,7 @@ def resize_window(window, w, h): """ Resize window, but also checks if huge window or negative values """ - screen_w, screen_h = get_display_geometry() + screen_w, screen_h = get_total_screen_geometry() if not w or not h: return if w > screen_w: