GNOME Bugzilla – Bug 759705
Sidebar broken in GNOME Disks
Last modified: 2016-01-03 03:13:44 UTC
Created attachment 317698 [details] screenshot See screenshot. You can expand it, but it's not supposed to start that small....
Some good prescience here: 67ab00e01ec06d7b05a82c3d80b235ac6c4abfd2 is the first bad commit commit 67ab00e01ec06d7b05a82c3d80b235ac6c4abfd2 Author: Benjamin Otte <otte@redhat.com> Date: Tue Dec 1 17:25:54 2015 +0100 window: Remove suspicious branch It seems this branch is not needed anymore. It was originally added in 1999 to support gtk_widget_realize(), but all those reasons seem obsolete today. Instead just call gtk_widget_realize(). If you end up at this commit when bisecting: There is no bug that made me remove this code, it was purely meant to be cleanup / dead code removal. I seem to have introduced a new bug or bisecting wouldn't have let you here. So it seems we should just revert this commit.
I've reverted this for now, we'll have to revisit this at some later point.
The revert plus some commits between the change and the revert broke window positioning. See bug 759990
Created attachment 318114 [details] [review] gtkwindow: take default size into account for the first child allocation [This depends on the revert of the above revert] 67ab00e01ec06d7b removed the fake configure code in gtk_window_show() and replaced it with a simple gtk_widget_realize(). The initial allocation code in realize() dependes on the last.configure_request to get the default window size but since that now didn't get set the default size was not taken into account. This fixes the first allcoation by using gtk_window_get_default_size() directly for computing the initial allocation. This problem could be seen in case of a GtkPaned in a GtkWindow with a default size set and the pane position set as well. The first allocation would be the natural size of the GtkPaned which would clamp the pane position if too larg. Only the second allocation would fill the parent window using the now wrong pane position.
Comment on attachment 318114 [details] [review] gtkwindow: take default size into account for the first child allocation forgot to take CSD into account.. update coming
Created attachment 318116 [details] [review] gtkwindow: take default size into account for the first allocation [This depends on the revert of the above revert] 67ab00e01ec06d7b removed the fake configure code in gtk_window_show() and replaced it with a simple gtk_widget_realize(). The initial allocation code in realize() depends on the last.configure_request to get the default window size but since that now didn't get set the default size was not taken into account. This introduces a helper gtk_window_get_default_window_size() which returns the default size including the CSD and uses it to compute the initial allocation. This problem could be seen in case of a GtkPaned in a GtkWindow with a default size set and the pane position set as well. The first allocation would be the natural size of the GtkPaned which would clamp the pane position if too larg. Only the second allocation would fill the parent window using the now wrong pane position.
Created attachment 318117 [details] [review] gtkwindow: fix first allocation size there are even more things which could change the allocation so just build a configure request instead.... final version. ----------------- 67ab00e01ec06d7b removed the fake configure code in gtk_window_show() and replaced it with a simple gtk_widget_realize(). The initial allocation code in realize() only allocates the natural size or the last requested size which now no longer is set, resulting in a too small first allocation. This builds a configure request to compute the allocation size instead which includes default size, CSD etc.. This problem could be seen in case of a GtkPaned in a GtkWindow with a default size set and the pane position set as well. The first allocation would be the natural size of the GtkPaned which would clamp the pane position if too larg. Only the second allocation would fill the parent window using the now wrong pane position.
I can confirm that reverting 2438a06d54636e5074c29bd696e3e81e90288b8d and applying attachment 318117 [details] [review] does fix bug 759990 (there's a separate matter of accounting or not accounting for CSD when giving out or interpreting window position/size, but i think there's a separate bug opened for that already...).
Attachment 318117 [details] pushed as 6d77b9f - gtkwindow: fix first allocation size