GNOME Bugzilla – Bug 774114
Window shadows are repainted even if only the contents of the window change
Last modified: 2016-11-21 13:03:21 UTC
This can be seen in the pixbufs demo in gtk{3,4}-demo: the window shadows are repainted for every frame of the icons animation. After looking into it with Benjamin Otte, it seems to be due to rounded corners causing these rects to overlap: https://git.gnome.org//browse/gtk+/commit/?id=cb3393f00 That optimization seems to kick in when the following CSS is applied: decoration { border-radius: 0; }
Created attachment 340144 [details] [review] Fix off by one in check for GtkRoundedBox containing a rectangle When checking if a rectangle is contained by the rounded box, the code will refuse a rectangle which is the exact size as the one backing the rounded box, since it checks for greater or equal width and height. Check for greater only instead. This seems to actually be the reason why shadows end up being repainted, not the round corners. Maybe there is a reason for >= rather than > I don't know about, I guess it might be just a bad copy pasta from the intersect one?
Comment on attachment 340144 [details] [review] Fix off by one in check for GtkRoundedBox containing a rectangle D'oh.
Attachment 340144 [details] pushed as 8e5e165 - Fix off by one in check for GtkRoundedBox containing a rectangle