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 761571 - Opaque region incorrectly calculated for fullscreen windows
Opaque region incorrectly calculated for fullscreen windows
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Themes
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-02-04 20:07 UTC by Daniel Drake
Modified: 2016-02-07 17:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
window: don't subtract corners from fullscreen opaque region (1.21 KB, patch)
2016-02-04 20:07 UTC, Daniel Drake
accepted-commit_now Details | Review
maximized (35.02 KB, image/png)
2016-02-05 07:44 UTC, Alberts Muktupāvels
  Details

Description Daniel Drake 2016-02-04 20:07:46 UTC
Created attachment 320465 [details] [review]
window: don't subtract corners from fullscreen opaque region

For a fullscreen totem window, _NET_WM_OPAQUE_REGION(CARDINAL) is currently "7, 0, 1906, 7, 0, 7, 1920, 1073" for my 1920x1080 display.

That does not reflect the fact that my window is filling the screen.

After this patch the same test now gives the expected value: 0, 0, 1920, 1080
Comment 1 Jasper St. Pierre (not reading bugmail) 2016-02-04 21:43:24 UTC
I'm a bit confused why it's giving us corners in the first place. I thought the CSS shouldn't specify any corners if we're fullscreen.
Comment 2 Matthias Clasen 2016-02-05 05:22:46 UTC
(In reply to Jasper St. Pierre from comment #1)
> I'm a bit confused why it's giving us corners in the first place. I thought
> the CSS shouldn't specify any corners if we're fullscreen.

I don't think fullscreen is reflected in the css state at all, so there is no way we could select different css for fullscreen windows.
Comment 3 Matthias Clasen 2016-02-05 05:56:46 UTC
Review of attachment 320465 [details] [review]:

I guess this is the best we can do
Comment 4 Jasper St. Pierre (not reading bugmail) 2016-02-05 06:06:53 UTC
(In reply to Matthias Clasen from comment #2)
> I don't think fullscreen is reflected in the css state at all, so there is
> no way we could select different css for fullscreen windows.

Then why are our corners not being rounded in fullscreen mode?

Company recommended a refactor along the lines of gtk_window_is_showing_decorations which we'd use instead of all the special cases (along with gtk_window_should_show_titlebar, etc.).
Comment 5 Alberts Muktupāvels 2016-02-05 07:44:18 UTC
(In reply to Matthias Clasen from comment #2)
> (In reply to Jasper St. Pierre from comment #1)
> > I'm a bit confused why it's giving us corners in the first place. I thought
> > the CSS shouldn't specify any corners if we're fullscreen.
> 
> I don't think fullscreen is reflected in the css state at all, so there is
> no way we could select different css for fullscreen windows.

Then for what fullscreen class is used?
https://git.gnome.org/browse/gtk+/tree/gtk/gtkwindow.c#n7434

.fullscreen { border-radius: 60px } does work, tried also with .maximized, but at least with nautilus it gave unexpected result.
Comment 6 Alberts Muktupāvels 2016-02-05 07:44:52 UTC
Created attachment 320481 [details]
maximized
Comment 7 Alberts Muktupāvels 2016-02-05 08:20:33 UTC
.fullscreen decoration { border-radius: 0; } does remove rounded corners.

Also there is some problem with .maximized and .tiled - they are supposed to remove rounded corners, but it works only when windows is focused. When window lose focus maximized and tiled windows have rounded corners...

Adding .tiled headerbar { border-radius: 0; } manually in inspector removes rounded corners from headerbar, but there is already such rule in gtk-contained.css:
https://git.gnome.org/browse/gtk+/tree/gtk/theme/Adwaita/gtk-contained.css#n1838

Looks like it is ignored because of .titlebar:not(headerbar). This was tested with nautilus. Tweak Tool and Polari does not remove rounded corners even when window focused.
Comment 8 Matthias Clasen 2016-02-05 15:57:47 UTC
(In reply to Alberts Muktupāvels from comment #5)
> (In reply to Matthias Clasen from comment #2)
> > (In reply to Jasper St. Pierre from comment #1)
> > > I'm a bit confused why it's giving us corners in the first place. I thought
> > > the CSS shouldn't specify any corners if we're fullscreen.
> > 
> > I don't think fullscreen is reflected in the css state at all, so there is
> > no way we could select different css for fullscreen windows.
> 
> Then for what fullscreen class is used?
> https://git.gnome.org/browse/gtk+/tree/gtk/gtkwindow.c#n7434
> 
> .fullscreen { border-radius: 60px } does work, tried also with .maximized,
> but at least with nautilus it gave unexpected result.

Oh, I had totally forgotten that we use style classes for that, I was thinking about states.
Comment 9 Alberts Muktupāvels 2016-02-05 16:18:16 UTC
Is that patch still needed? That patch could break fullscreen windows if someone really wants rounded corners on them. When I tested .fullscreen decoration { border-radius: 0; } was enough. _NET_WM_OPAQUE_REGION did return correct data.
Comment 10 Matthias Clasen 2016-02-05 16:56:56 UTC
I think we should just fix the theme
Comment 11 Alberts Muktupāvels 2016-02-07 17:19:50 UTC
Might not be related to this bug, but should not be rounded corners removed also from .maximized decoration?