GNOME Bugzilla – Bug 724306
Recent GTK+ does not like it when the titlebar is reset on a realized window
Last modified: 2014-03-15 07:25:18 UTC
Now that we have split the toolbars for different modes into their own classes, we reset the titlebar every time the application changes modes. This does not work very well with recent versions of GTK+ if the window has already been realized. You get a WARNING and the window jumps around.
Its hard to do much better on the gtk side. While theoretically possible, a lot of the csd setup happens in the realize path. To work around the issue, you can put your different mode titlebars into a stack and switch that way, or just put them all in a box and show/hide as needed
*** Bug 725371 has been marked as a duplicate of this bug. ***
*** Bug 725370 has been marked as a duplicate of this bug. ***
Created attachment 271841 [details] [review] Avoid resetting the titlebar on a realized window I think this is simpler than using a GtkStack. Much of our logic around changing the sensitivity of toolbar buttons and so on is based on the assumption that the toolbar is destroyed and recreated on each mode change. By using a GtkBox we can continue doing that and still avoid resetting the titlebar. Using a GtkStack with different toolbars that were created once and then switched around would require adjusting the logic in a few more places and it would be wise to avoid intrusive changes at this point in the 3.11.x cycle.
Created attachment 271848 [details] [review] Avoid resetting the titlebar on a realized window Missed out one line.
Review of attachment 271848 [details] [review]: Looks good as a fix for 3.12, thanks.
Comment on attachment 271848 [details] [review] Avoid resetting the titlebar on a realized window Thanks for the review.