I tested this on Windows 7 with Xiphos 4.0.2, as well as on Debian 8 with the latest svn compiled:
1) On Windows 7, if I close Xiphos when the window is maximized, and then restart the program, the window is off-centered from the top-left corner, as Christopher reported.
2) On Debian, if I close Xiphos when the window is maximized, and then restart the program, the window is maximized.
Problem
Windows and Linux are saving different values when Xiphos is shutting down. On Windows 7, settings.xml is saved with app_x and app_y values of -8, whereas on the Debian virtual machine, it has an app_x value of 0 and an app_y value of 26 (I'm using Xfce and have a top bar, causing the vertical offset).
When the function frontend_display from gnome2/xiphos.c is called, it takes the negative app_x and app_y values and makes them both 10, which is causing the slight offset from the top left corner that I'm seeing.
voidfrontend_display(constchar*tabs){/* [SNIPPED] *//* * a little paranoia: * clamp geometry values to a reasonable bound. * sometimes xiphos gets insane reconfig events as it dies, * especially if it's due to just shutting linux down. */if(settings.app_x<0)settings.app_x=10;if(settings.app_x>(screen_width-100))settings.app_x=screen_width-100;if(settings.app_y<0)settings.app_y=10;if(settings.app_y>(screen_height-100))settings.app_y=screen_height-100;gtk_window_move(GTK_WINDOW(widgets.app),settings.app_x,settings.app_y);/* [SNIPPED] */}
An attempt at a solution
First I tried editing settings.xml on my Windows machine to have an app_x and app_y value of 0 before starting Xiphos, to see if that would create the window maximized. While the window took up the whole screen, it was not maximized, and extended slightly below the taskbar (see attached screenshot). Thus, I don't believe this solution would work.
A better solution?
The Gtk 2 & 3 documentation reference gtk_window_maximize for maximizing a window. If we creating a boolean value in the settings.xml for tracking whether the main program window was maximized on exit, we could then properly maximize the window on restart.
i sought to implement the better solution...but it's available in gtk3 only: gtk_window_is_maximized, which i want to use to save maximization state, is not available in gtk2, which is where win32/64 is built. significantly, there isn't even a maximize property on the window in gtk2. so i've also changed the "<0" test to set 0 instead of 10. it's not quite right, but it's a good bit closer.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Testing
I tested this on Windows 7 with Xiphos 4.0.2, as well as on Debian 8 with the latest svn compiled:
1) On Windows 7, if I close Xiphos when the window is maximized, and then restart the program, the window is off-centered from the top-left corner, as Christopher reported.
2) On Debian, if I close Xiphos when the window is maximized, and then restart the program, the window is maximized.
Problem
Windows and Linux are saving different values when Xiphos is shutting down. On Windows 7,
settings.xml
is saved withapp_x
andapp_y
values of -8, whereas on the Debian virtual machine, it has anapp_x
value of 0 and anapp_y
value of 26 (I'm using Xfce and have a top bar, causing the vertical offset).When the function
frontend_display
fromgnome2/xiphos.c
is called, it takes the negativeapp_x
andapp_y
values and makes them both 10, which is causing the slight offset from the top left corner that I'm seeing.An attempt at a solution
First I tried editing
settings.xml
on my Windows machine to have anapp_x
andapp_y
value of 0 before starting Xiphos, to see if that would create the window maximized. While the window took up the whole screen, it was not maximized, and extended slightly below the taskbar (see attached screenshot). Thus, I don't believe this solution would work.A better solution?
The Gtk 2 & 3 documentation reference
gtk_window_maximize
for maximizing a window. If we creating a boolean value in thesettings.xml
for tracking whether the main program window was maximized on exit, we could then properly maximize the window on restart.Last edit: Sam Cantrell 2015-06-03
i sought to implement the better solution...but it's available in gtk3 only: gtk_window_is_maximized, which i want to use to save maximization state, is not available in gtk2, which is where win32/64 is built. significantly, there isn't even a maximize property on the window in gtk2. so i've also changed the "<0" test to set 0 instead of 10. it's not quite right, but it's a good bit closer.