[Git][gajim/gajim][master] Add debug logging for saving roster position

Philipp Hörist gitlab at dev.gajim.org
Thu Jul 12 23:19:36 CEST 2018


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


Commits:
c225ae70 by Philipp Hörist at 2018-07-12T23:19:22+02:00
Add debug logging for saving roster position

- - - - -


2 changed files:

- gajim/gtkgui_helpers.py
- gajim/roster_window.py


Changes:

=====================================
gajim/gtkgui_helpers.py
=====================================
--- a/gajim/gtkgui_helpers.py
+++ b/gajim/gtkgui_helpers.py
@@ -102,7 +102,9 @@ from gajim.common import helpers
 def get_total_screen_geometry():
     screen = Gdk.Screen.get_default()
     window = Gdk.Screen.get_root_window(screen)
-    return window.get_width(), window.get_height()
+    w, h = window.get_width(), window.get_height()
+    log.debug('Get screen geometry: %s %s', w, h)
+    return w, h
 
 def add_image_to_button(button, icon_name):
     img = Gtk.Image()


=====================================
gajim/roster_window.py
=====================================
--- a/gajim/roster_window.py
+++ b/gajim/roster_window.py
@@ -43,6 +43,7 @@ import os
 import sys
 import time
 import locale
+import logging
 
 from enum import IntEnum, unique
 
@@ -72,6 +73,8 @@ from gajim.message_window import MessageWindowMgr
 from nbxmpp.protocol import NS_FILE, NS_ROSTERX, NS_CONFERENCE
 
 
+log = logging.getLogger('gajim.roster')
+
 @unique
 class Column(IntEnum):
     IMG = 0  # image to show state (online, new message etc)
@@ -2381,6 +2384,7 @@ class RosterWindow:
         'on_event') or app.config.get('allow_hide_roster')):
             if app.config.get('save-roster-position'):
                 x, y = self.window.get_position()
+                log.debug('Save roster position (get_position): %s %s', x, y)
                 app.config.set('roster_x-position', x)
                 app.config.set('roster_y-position', y)
             if os.name == 'nt' or app.config.get('hide_on_roster_x_button'):
@@ -2409,6 +2413,7 @@ class RosterWindow:
         if self.window.get_window() is not None:
             if app.config.get('save-roster-position'):
                 x, y = self.window.get_window().get_root_origin()
+                log.debug('Save roster position (get_root_origin): %s %s', x, y)
                 app.config.set('roster_x-position', x)
                 app.config.set('roster_y-position', y)
             width, height = self.window.get_size()



View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/c225ae70e428c777d3a062f3fcc7410d76b32c74

-- 
View it on GitLab: https://dev.gajim.org/gajim/gajim/commit/c225ae70e428c777d3a062f3fcc7410d76b32c74
You're receiving this email because of your account on dev.gajim.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gajim.org/pipermail/commits/attachments/20180712/a44f29ec/attachment-0001.html>


More information about the Commits mailing list