GNOME Bugzilla – Bug 748615
GtkWindow: Get the correct shadow width even before window is realized
Last modified: 2015-05-07 19:58:44 UTC
This fixes issues I was seeing that could be noticed by the log messages ** BUG *** In pixman_region32_init_rect: Invalid rectangle passed Set a breakpoint on '_pixman_log_error' to debug showing up in terminal.
Created attachment 302543 [details] [review] GtkWindow: Get the correct shadow width even before window is realized The window state 'client_decorated' will only be set the window is being realized. If anyone tries to get the shadow size before that it'd get the with as if there always was no shadow. This avoids negative sized opaque regions caused by the allocation being smaller than shadow.
Why does a shadow width of 0 causes invalid rectangles ? I'd like to see a stacktrace
Created attachment 302623 [details] Stacktrace resulting in an invalid rectangle Attaching a stacktrace that happens without the attached patch. I think the issue may also be caused by incorrect geometry calculation somewhere (resulting in the too small allocation), but that would still result in an incorrect opaque region as it assumes correct shadow width was used when calculating the allocation. It is only when rectangle happens to be small enough that its visible as errors printed to the console. One could probably also fix by realizing the window earlier, before any geometry calculation is done.
Review of attachment 302543 [details] [review]: after irc discussion: ok
Attachment 302543 [details] pushed as b1e5ad4 - GtkWindow: Get the correct shadow width even before window is realized
Created attachment 303037 [details] [review] GtkWindow: Manually set CSD should enable shadow width calculation If CSD is enabled with shadow even though it "shouldn't"*, the width should still be calculated correctly. This fixes a regression caused by b1e5ad469c753ea3eed967056ca814ecb0117c7b. * gtk_window_should_use_csd () returns false
Attachment 303037 [details] pushed as 08e2f95 - GtkWindow: Manually set CSD should enable shadow width calculation