After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 759705 - Sidebar broken in GNOME Disks
Sidebar broken in GNOME Disks
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
3.19.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-12-20 17:47 UTC by Michael Catanzaro
Modified: 2016-01-03 03:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot (68.24 KB, image/png)
2015-12-20 17:47 UTC, Michael Catanzaro
  Details
gtkwindow: take default size into account for the first child allocation (2.03 KB, patch)
2016-01-01 12:10 UTC, Christoph Reiter (lazka)
none Details | Review
gtkwindow: take default size into account for the first allocation (5.28 KB, patch)
2016-01-01 13:11 UTC, Christoph Reiter (lazka)
none Details | Review
gtkwindow: fix first allocation size (1.95 KB, patch)
2016-01-01 13:47 UTC, Christoph Reiter (lazka)
committed Details | Review

Description Michael Catanzaro 2015-12-20 17:47:56 UTC
Created attachment 317698 [details]
screenshot

See screenshot. You can expand it, but it's not supposed to start that small....
Comment 1 Michael Catanzaro 2015-12-21 01:28:19 UTC
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.
Comment 2 Matthias Clasen 2015-12-22 12:56:41 UTC
I've reverted this for now, we'll have to revisit this at some later point.
Comment 3 Christoph Reiter (lazka) 2016-01-01 12:09:12 UTC
The revert plus some commits between the change and the revert broke window positioning. See bug 759990
Comment 4 Christoph Reiter (lazka) 2016-01-01 12:10:07 UTC
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 5 Christoph Reiter (lazka) 2016-01-01 12:34:33 UTC
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
Comment 6 Christoph Reiter (lazka) 2016-01-01 13:11:00 UTC
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.
Comment 7 Christoph Reiter (lazka) 2016-01-01 13:47:58 UTC
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.
Comment 8 LRN 2016-01-01 16:02:31 UTC
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...).
Comment 9 Matthias Clasen 2016-01-03 03:13:40 UTC
Attachment 318117 [details] pushed as 6d77b9f - gtkwindow: fix first allocation size