Activity log for bug #1642034

Date Who What changed Old value New value Message
2016-11-15 19:53:14 Francis Chin bug added bug
2016-11-15 19:53:14 Francis Chin attachment added Patch to restore main window position when reopening it https://bugs.launchpad.net/bugs/1642034/+attachment/4777787/+files/fcpatch.diff
2016-11-15 19:55:34 Francis Chin description 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). Even when preferences are set to "Restore window position and size" this does not take effect apart from once at startup. This bug exists with the version in the Ubuntu 16.04 repository (1.1.3), 1.1.5, and also master (1.2.0). 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).
2016-11-15 20:24:32 Francis Chin attachment removed Patch to restore main window position when reopening it https://bugs.launchpad.net/psensor/+bug/1642034/+attachment/4777787/+files/fcpatch.diff
2016-11-15 20:25:47 Francis Chin attachment added Patch to fix "restore window position" https://bugs.launchpad.net/psensor/+bug/1642034/+attachment/4777788/+files/fcpatchlp%231642034.diff
2016-11-24 19:51:38 Francis Chin attachment added fix pane resizing and update to preferences dialog https://bugs.launchpad.net/psensor/+bug/1642034/+attachment/4782575/+files/fcpatchlp%231642034_2.diff
2016-11-29 00:46:17 Francis Chin attachment added add pane resize fix for Show command https://bugs.launchpad.net/psensor/+bug/1642034/+attachment/4784440/+files/fcpatchlp%231642034_3.diff
2017-02-12 16:22:06 Jean-Philippe Orsini psensor: assignee Jean-Philippe Orsini (jfi)
2017-02-12 16:22:13 Jean-Philippe Orsini psensor: status New In Progress