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 758563 - play bar gets weird position in fullscreen under Wayland
play bar gets weird position in fullscreen under Wayland
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
3.19.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: wayland
 
 
Reported: 2015-11-23 22:55 UTC by Andreas Nilsson
Modified: 2015-12-02 02:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot (943.21 KB, image/png)
2015-11-23 22:55 UTC, Andreas Nilsson
  Details
sceenshot under X (954.67 KB, image/png)
2015-11-23 22:58 UTC, Andreas Nilsson
  Details
screenshot, non-hidpi under wayland (1.15 MB, image/png)
2015-11-24 13:17 UTC, Andreas Nilsson
  Details
gtk: stack: set internal gdk window position before allocating children (2.01 KB, patch)
2015-11-26 12:03 UTC, Lionel Landwerlin
none Details | Review

Description Andreas Nilsson 2015-11-23 22:55:15 UTC
Created attachment 316120 [details]
screenshot

It seem the play bar moves down too far down in fullscreen under Wayland
Comment 1 Andreas Nilsson 2015-11-23 22:58:12 UTC
Created attachment 316121 [details]
sceenshot under X
Comment 2 Bastien Nocera 2015-11-24 11:40:59 UTC
Pretty sure this is another problem with clutter{,-gst} and hi-dpi. Does this happen on a non-hi-dpi system?
Comment 3 Andreas Nilsson 2015-11-24 13:17:33 UTC
Created attachment 316165 [details]
screenshot, non-hidpi under wayland

Yup, seems so. Tested on totem 3.18.1 now under Wayland, and things look more normal.
Comment 4 Bastien Nocera 2015-11-24 13:24:39 UTC
Passing this on to clutter, but I'm guessing that it gets a bit confused with margins.
Comment 5 Emmanuele Bassi (:ebassi) 2015-11-24 14:42:09 UTC
What margins?
Comment 6 Bastien Nocera 2015-11-24 15:03:07 UTC
This is the only code we use to place the controls popup:
https://git.gnome.org/browse/totem/tree/src/backend/bacon-video-widget.c#n6101

Lionel?
Comment 7 Lionel Landwerlin 2015-11-24 17:40:29 UTC
Bastien, I'm not sure to understand when the top bar is supposed to be displayed? Only in maximized mode? Or both maximized and fullscreen?
I get into situation where it's visible in fullscreen mode.
Comment 8 Lionel Landwerlin 2015-11-24 17:44:03 UTC
For example,

- Open totem (normal mode)
- Double click on header bar to make it maximized
- Double click in the video to make it fullscreen

The window is displayed in fullscreen but with the header bar.
Comment 9 Bastien Nocera 2015-11-24 17:45:51 UTC
(In reply to Lionel Landwerlin from comment #7)
> Bastien, I'm not sure to understand when the top bar is supposed to be
> displayed? Only in maximized mode? Or both maximized and fullscreen?

It's 2 different widgets. There's a headerbar/titlebar when maximised, and there's an overlay with another headerbar in fullscreen.

> I get into situation where it's visible in fullscreen mode.

Are you talking about the shell's top bar, or something else?
Comment 10 Bastien Nocera 2015-11-24 17:46:34 UTC
(In reply to Lionel Landwerlin from comment #8)
> For example,
> 
> - Open totem (normal mode)
> - Double click on header bar to make it maximized
> - Double click in the video to make it fullscreen
> 
> The window is displayed in fullscreen but with the header bar.

It's a header bar or a popup that disappears after a couple of seconds?
Comment 11 Lionel Landwerlin 2015-11-25 14:55:06 UTC
Just a quick brain dump :

It seems to be a GDK problem. gdk_window_get_origin() reports values from before  switching to fullscreen mode. It seems the abs_x/y values of GdkWindow are desynchronized from the actual position of the GdkWindow. The Gdk backend of Clutter uses these values to position the subsurface.
Comment 12 Emmanuele Bassi (:ebassi) 2015-11-25 15:07:09 UTC
More fallout from the CSD changes going on in GTK? Adding Olivier to the Cc.
Comment 13 Olivier Fourdan 2015-11-25 15:23:59 UTC
(In reply to Emmanuele Bassi (:ebassi) from comment #12)
> More fallout from the CSD changes going on in GTK? Adding Olivier to the Cc.

I am not sure, totem is CSD so if that was the case, that would affect equally X11 and Wayland.

Beside, the CSD patches would not change anything in fullscreen because CSD controls (border shadows and header bar) are not visible when fullscreen.
Comment 14 Lionel Landwerlin 2015-11-25 15:44:32 UTC
I think this might be more of a GdkWindow issue.
Just as a note, on wayland the video surface is a wayland subsurface positionned at the size location than its input only GtkWidget.
In order to get the position right, we need to be able to get the position of the associated GdkWindow when the layout cycle starts.

My repro scenario is :

- put the window in maximized state
- put the window in fullscreen state

It seems in both cases Totem's window is the same size. That seems to be the reason for the propagation of the abs_x/y value update to stop. Hence the invalid values gdk_window_get_origin() returns. The values are pretty much off by one fullscreen/non-fullscreen transition.
Comment 15 Lionel Landwerlin 2015-11-26 12:03:20 UTC
Created attachment 316305 [details] [review]
gtk: stack: set internal gdk window position before allocating children

Before allocating its children GtkStack should set its own GdkWindow
position. This fixes situations where some of the children will try to
compute their position relative to the toplevel widget and get the
previous allocation cycle value.
Comment 16 Lionel Landwerlin 2015-11-26 12:06:22 UTC
Found it :)
Although, there might still be an issue on wayland, the top bar in fullscreen mode is not always visible.
That's because of the use of subsurfaces. I think the proper way to fix this is to make the top bar in fullscreen mode part of the Clutter scene, just like the controls. Maybe we can have another bug for this.
Comment 17 Matthias Clasen 2015-11-30 15:42:24 UTC
Pushed an equivalent, but slightly different fix.