Gajim window size not restored properly when using "Single Window for Everything"
The gajim main (roster) window size is not restored properly when using "Single Window for Everything" for "Window behavior" and maximizing window.
Steps to reproduce
This is when using xfwm as window manager.
- In preferences, set "Window behavior" to "Single Window for Everything"
- Maximize gajim
- Quit gajim
- Start gajim
Expected behavior: Gajim should start maximized
Actual behavior: Gajim starts with the roster window only as large as the roster.
Looking at the code, I think there are two independent issues here.
First of all, gajim does not properly remember the window width when using "Single Window for everything". The reason is this code in
width, height = self.window.get_size() # For the width use the size of the vbox containing the tree and # status combo, this will cancel out any hpaned width width = self.xml.get_object('roster_vbox2').allocation.width
The width is first correctly determined to be "1920", but then overwritten with "236". I am inclined to just remove the second assignment to width; in principle, setting the window size to what it was should not need any cancelling of anything.
Secondly, gajim does not remember whether the window was maximized. This is relevant if the screen size changed since the last time gajim has been shown -- something which is very common e.g. on Laptops that are frequently used with an external screen, but also while traveling with the internal screen only.
OS version: Debian testing
GTK version: 2.24.30
Actually, the following patch is enough here:
diff --git a/src/roster_window.py b/src/roster_window.py index 71ce696..da27394 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -2455,9 +2455,6 @@ class RosterWindow: gajim.config.set('roster_x-position', x) gajim.config.set('roster_y-position', y) width, height = self.window.get_size() - # For the width use the size of the vbox containing the tree and - # status combo, this will cancel out any hpaned width - width = self.xml.get_object('roster_vbox2').allocation.width gajim.config.set('roster_width', width) gajim.config.set('roster_height', height) if not self.xml.get_object('roster_vbox2').get_property('visible'):
The window is still maximized when starting on a larger screen, but with some delay (namely, when the first chat tabs are added). I am not sure why that happens, but with that patch, as far as I can tell, everything behaves the way I want it to.