Comment 0 for bug 1642034

Revision history for this message
Francis Chin (chinf) wrote :

Even when preferences are set to "Restore window position and size" this does not take effect apart from once at startup.

I have checked how the Compiz "Place Windows" plugin affects the positioning of windows on the desktop, and this is deciding where the psensor main window opens even with the psensor configured to control the window position. With the latter enabled, the user expects the window to reopen at the same location on the desktop, but this isn't happening.

I took a look at the source code and watched dconf-editor to try and understand what was going on. With debug logging on, I could see that when the UI window is opened correctly, gtk_window_move() in ui_window_create() does the right thing. Yet when the window is closed and then reopened, it's handled by ui_window_show() and the window is placed by Compiz's plugin rather than reappearing at its last location.

I attach a patch to call gtk_window_move() in ui_window_show() and this fixes the problem for me; I see the window reopening at the location persisted in Gsettings. Further testing with "Restore window position and size" cleared (and psensor restarted) shows that window size and position is determined by the WM, as expected.

I also saw that save_window_pos() is already called in ui_psensor_quit() so updated on_delete_event_cb() to move it inside the if statement.

The patch passed "make clean", and was tested applied to my clone of master (1.2.0).