Add debug logging for saving roster position

This commit is contained in:
Philipp Hörist 2018-07-12 23:19:22 +02:00
parent 4cb852914e
commit c225ae70e4
2 changed files with 8 additions and 1 deletions

View File

@ -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()

View File

@ -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()