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 774114 - Window shadows are repainted even if only the contents of the window change
Window shadows are repainted even if only the contents of the window change
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
3.20.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-11-08 17:04 UTC by Gustavo Noronha (kov)
Modified: 2016-11-21 13:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix off by one in check for GtkRoundedBox containing a rectangle (1.15 KB, patch)
2016-11-17 17:23 UTC, Gustavo Noronha (kov)
committed Details | Review

Description Gustavo Noronha (kov) 2016-11-08 17:04:31 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;
}
Comment 1 Gustavo Noronha (kov) 2016-11-17 17:23:17 UTC
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 2 Benjamin Otte (Company) 2016-11-21 12:42:54 UTC
Comment on attachment 340144 [details] [review]
Fix off by one in check for GtkRoundedBox containing a rectangle

D'oh.
Comment 3 Gustavo Noronha (kov) 2016-11-21 13:03:16 UTC
Attachment 340144 [details] pushed as 8e5e165 - Fix off by one in check for GtkRoundedBox containing a rectangle