Philipp Hörist pushed to branch master at gajim / gajim

Commits:

2 changed files:

Changes:

  • gajim/dialogs.py
    ... ... @@ -3179,7 +3179,7 @@ class PopupNotificationWindow:
    3179 3179
             window_width, self.window_height = self.window.get_size()
    
    3180 3180
             app.interface.roster.popups_notification_height += self.window_height
    
    3181 3181
             pos_x = app.config.get('notification_position_x')
    
    3182
    -        screen_w, screen_h = gtkgui_helpers.get_display_geometry()
    
    3182
    +        screen_w, screen_h = gtkgui_helpers.get_total_screen_geometry()
    
    3183 3183
             if pos_x < 0:
    
    3184 3184
                 pos_x = screen_w - window_width + pos_x + 1
    
    3185 3185
             pos_y = app.config.get('notification_position_y')
    
    ... ... @@ -3216,7 +3216,7 @@ class PopupNotificationWindow:
    3216 3216
                 current_index += 1
    
    3217 3217
                 window_width, window_height = window_instance.window.get_size()
    
    3218 3218
                 app.interface.roster.popups_notification_height += window_height
    
    3219
    -            screen_w, screen_h = gtkgui_helpers.get_display_geometry()
    
    3219
    +            screen_w, screen_h = gtkgui_helpers.get_total_screen_geometry()
    
    3220 3220
                 window_instance.window.move(screen_w - window_width,
    
    3221 3221
                     screen_h - \
    
    3222 3222
                     app.interface.roster.popups_notification_height)
    

  • gajim/gtkgui_helpers.py
    ... ... @@ -100,11 +100,10 @@ if os.name == 'nt':
    100 100
     
    
    101 101
     from gajim.common import helpers
    
    102 102
     
    
    103
    -def get_display_geometry():
    
    104
    -    display = Gdk.Display.get_default()
    
    105
    -    monitor = display.get_monitor(0)
    
    106
    -    geometry = monitor.get_geometry()
    
    107
    -    return geometry.width, geometry.height
    
    103
    +def get_total_screen_geometry():
    
    104
    +    screen = Gdk.Screen.get_default()
    
    105
    +    window = Gdk.Screen.get_root_window(screen)
    
    106
    +    return window.get_width(), window.get_height()
    
    108 107
     
    
    109 108
     def add_image_to_button(button, icon_name):
    
    110 109
         img = Gtk.Image()
    
    ... ... @@ -175,7 +174,7 @@ def move_window(window, x, y):
    175 174
         """
    
    176 175
         Move the window, but also check if out of screen
    
    177 176
         """
    
    178
    -    screen_w, screen_h = get_display_geometry()
    
    177
    +    screen_w, screen_h = get_total_screen_geometry()
    
    179 178
         if x < 0:
    
    180 179
             x = 0
    
    181 180
         if y < 0:
    
    ... ... @@ -191,7 +190,7 @@ def resize_window(window, w, h):
    191 190
         """
    
    192 191
         Resize window, but also checks if huge window or negative values
    
    193 192
         """
    
    194
    -    screen_w, screen_h = get_display_geometry()
    
    193
    +    screen_w, screen_h = get_total_screen_geometry()
    
    195 194
         if not w or not h:
    
    196 195
             return
    
    197 196
         if w > screen_w: