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 755245 - only shows a 4th of the screen under wayland
only shows a 4th of the screen under wayland
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: gdk
git master
Other Linux
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks:
 
 
Reported: 2015-09-19 00:27 UTC by Andreas Nilsson
Modified: 2015-11-23 11:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
clutter-gst video-player (959.88 KB, image/png)
2015-11-18 23:26 UTC, Andreas Nilsson
  Details
gdk: take into account scaling on wayland (5.23 KB, patch)
2015-11-22 17:30 UTC, Lionel Landwerlin
none Details | Review
gdk: take into account scaling on wayland (5.35 KB, patch)
2015-11-22 21:47 UTC, Lionel Landwerlin
committed Details | Review

Description Andreas Nilsson 2015-09-19 00:27:16 UTC
It seems like only a 4th of the screen is shown when running under wayland.
Monitor is hidpi, so might be why.
Comment 1 Bastien Nocera 2015-09-19 00:48:22 UTC
Does examples/video-player in clutter-gst's sources show the same problem?
Comment 2 Andreas Nilsson 2015-09-24 08:57:40 UTC
I'm not quite sure if I'm running it wrong or something, but with the examples/video-player I just get a black window.
Comment 3 Andreas Nilsson 2015-11-18 23:26:33 UTC
Created attachment 315859 [details]
clutter-gst video-player

didn't manage to get video, but the audio playback-thing seems to display only a quarter
Comment 4 Andreas Nilsson 2015-11-19 17:56:48 UTC
So, yes, same behavior in video-player
Comment 5 Bastien Nocera 2015-11-19 18:01:37 UTC
Alright, then it's a clutter-gst problem...
Comment 6 Lionel Landwerlin 2015-11-22 17:30:38 UTC
Created attachment 316050 [details] [review]
gdk: take into account scaling on wayland

The X11 part of the GDK backend takes into account the scaling factor of its
window when resizing the underlying X11 objects. We need to do the same for
Wayland.
Comment 7 Lionel Landwerlin 2015-11-22 17:37:00 UTC
Mutter has an a great debug environment variable to test this (which I used).
It would be nice to have this tested by somebody with an actual hidpi display :)
Thanks!
Comment 8 Emmanuele Bassi (:ebassi) 2015-11-22 17:54:38 UTC
Review of attachment 316050 [details] [review]:

It does look okay to me, even without a testing environment.

::: clutter/gdk/clutter-stage-gdk.c
@@ +123,3 @@
   ClutterStageGdk *stage_gdk = CLUTTER_STAGE_GDK (stage_window);
 
+  if (stage_gdk->window != NULL)

Care to explain why you changed this?
Comment 9 Andreas Nilsson 2015-11-22 19:42:41 UTC
(In reply to Lionel Landwerlin from comment #7)
> Mutter has an a great debug environment variable to test this (which I used).
> It would be nice to have this tested by somebody with an actual hidpi
> display :)
> Thanks!

I'm happy to test it.
Do I just need to apply the patch to clutter, rebuild and test in totem and video-player?
Comment 10 Lionel Landwerlin 2015-11-22 20:38:30 UTC
Yep.
Comment 11 Lionel Landwerlin 2015-11-22 20:48:47 UTC
Review of attachment 316050 [details] [review]:

::: clutter/gdk/clutter-stage-gdk.c
@@ +123,3 @@
   ClutterStageGdk *stage_gdk = CLUTTER_STAGE_GDK (stage_window);
 
+  if (stage_gdk->window != NULL)

I don't think asking the geometry to the ClutterStageCogl is appropriate, because it's not aware of the scaling for example.
Last time I touched this function, I left the non foreign window case as it, but now I think we should always rely on the GdkWindow's information.

Clutter-Gtk should always put us in the right place : https://git.gnome.org/browse/clutter-gtk/tree/clutter-gtk/gtk-clutter-embed.c#n686

I'll update the patch to do this :

 if (stage_gdk->window != NULL)
   {
          geometry->width = gdk_window_get_width (stage_gdk->window);			
          geometry->height = gdk_window_get_height (stage_gdk->window);			
   }			
 else			
   {			
          geometry->width = 640;			
          geometry->height = 480;			
   }
Comment 12 Lionel Landwerlin 2015-11-22 21:47:05 UTC
Created attachment 316059 [details] [review]
gdk: take into account scaling on wayland

The X11 part of the GDK backend takes into account the scaling factor of its
window when resizing the underlying X11 objects. We need to do the same for
Wayland.
Comment 13 Andreas Nilsson 2015-11-22 23:00:23 UTC
Yup! This fixed the issue on my laptop.
Thanks for the super-quick patch!
Comment 14 Emmanuele Bassi (:ebassi) 2015-11-23 02:45:46 UTC
Review of attachment 316059 [details] [review]:

Looks good.
Comment 15 Lionel Landwerlin 2015-11-23 11:03:27 UTC
Review of attachment 316059 [details] [review]:

Pushed to master.