https://bugzilla.gnome.org/show_bug.cgi?id=771320

--- Comment #14 from Olivier Fourdan <ofour...@redhat.com> ---
(In reply to Olivier Fourdan from comment #12)
> Yes, that's precisely the problem... abs_x/abs_y can be wrong when
> transitioning from/to fullscreen/maximized/normal because the shadows and
> header bar get added/removed.

Just to clarify a bit here, this part there is to keep clutter-gtk's
GtkClutterEmbed happy.

There are two things to consider, one is that clutter stage with gdk backend
resizes on configure events whereas clutter-gtk GtkClutterEmbed widget reizes
on size_allocate signal emitted by gtk+ (upper layer).

By putting traces in clutter gdk's backend
_clutter_stage_gdk_notify_configure():

 
https://git.gnome.org/browse/clutter/tree/clutter/gdk/clutter-stage-gdk.c#n282

And another in clutter-gtk gtk_clutter_embed_size_allocate():

 
https://git.gnome.org/browse/clutter-gtk/tree/clutter-gtk/gtk-clutter-embed.c#n670

We can see exactly what happens with and without the patch when running totem
while switchng to maximized state and back:

A) If we configure *only* if abs_x/abs_y have changed:

1. Start in normal state:

  Clutter-Message: _clutter_stage_gdk_notify_configure() window 0x24f2650
(26,70) [661x429]
  Clutter-Message: _clutter_stage_gdk_notify_configure() window 0x24f2650
(26,70) [661x429]
  Clutter-Gtk-Message: gtk_clutter_embed_size_allocate() window 0x24f2650 (0,0)
[661x429]
  Clutter-Message: _clutter_stage_gdk_notify_configure() window 0x24f2650
(26,70) [661x429]

2. Switch to maximized state:

  Clutter-Gtk-Message: gtk_clutter_embed_size_allocate() window 0x24f2650 (0,0)
[1972x1205]
  Clutter-Message: _clutter_stage_gdk_notify_configure() window 0x24f2650
(26,70) [1972x1205]
  Clutter-Gtk-Message: gtk_clutter_embed_size_allocate() window 0x24f2650 (0,0)
[1920x1153]
  Clutter-Message: _clutter_stage_gdk_notify_configure() window 0x24f2650
(0,47) [1920x1153]
  Clutter-Message: _clutter_stage_gdk_notify_configure() window 0x24f2650
(0,47) [1972x1205]

3. Back to normal state:

  Clutter-Gtk-Message: gtk_clutter_embed_size_allocate() window 0x24f2650 (0,0)
[609x377]
  Clutter-Message: _clutter_stage_gdk_notify_configure() window 0x24f2650
(0,47) [609x377]
  Clutter-Gtk-Message: gtk_clutter_embed_size_allocate() window 0x24f2650 (0,0)
[661x429]
  Clutter-Message: _clutter_stage_gdk_notify_configure() window 0x24f2650
(26,70) [661x429]
  Clutter-Message: _clutter_stage_gdk_notify_configure() window 0x24f2650
(26,70) [609x377]

=> The final configure event gives (26,70) [609x377] which is too small

B) Now with sending a configure event even if the abs_x/abs_y didn't change:

1. Start in normal state:

  Clutter-Message: _clutter_stage_gdk_notify_configure() window 0x2a62650
(26,70) [661x429]
  Clutter-Message: _clutter_stage_gdk_notify_configure() window 0x2a62650
(26,70) [661x429]
  Clutter-Gtk-Message: gtk_clutter_embed_size_allocate() window 0x2a62650 (0,0)
[661x429]
  Clutter-Message: _clutter_stage_gdk_notify_configure() window 0x2a62650
(26,70) [661x429]

2. Switch to maximized state:

  Clutter-Gtk-Message: gtk_clutter_embed_size_allocate() window 0x2a62650 (0,0)
[1972x1205]
  Clutter-Message: _clutter_stage_gdk_notify_configure() window 0x2a62650
(26,70) [1972x1205]
  Clutter-Gtk-Message: gtk_clutter_embed_size_allocate() window 0x2a62650 (0,0)
[1920x1153]
  Clutter-Message: _clutter_stage_gdk_notify_configure() window 0x2a62650
(0,47) [1920x1153]
  Clutter-Message: _clutter_stage_gdk_notify_configure() window 0x2a62650
(0,47) [1972x1205]
  Clutter-Message: _clutter_stage_gdk_notify_configure() window 0x2a62650
(0,47) [1972x1205]
  Clutter-Message: _clutter_stage_gdk_notify_configure() window 0x2a62650
(0,47) [1920x1153]
  Clutter-Message: _clutter_stage_gdk_notify_configure() window 0x2a62650
(0,47) [1920x1153]

3. Back to normal state:

  Clutter-Gtk-Message: gtk_clutter_embed_size_allocate() window 0x2a62650 (0,0)
[609x377]
  Clutter-Message: _clutter_stage_gdk_notify_configure() window 0x2a62650
(0,47) [609x377]
  Clutter-Gtk-Message: gtk_clutter_embed_size_allocate() window 0x2a62650 (0,0)
[661x429]
  Clutter-Message: _clutter_stage_gdk_notify_configure() window 0x2a62650
(26,70) [661x429]
  Clutter-Message: _clutter_stage_gdk_notify_configure() window 0x2a62650
(26,70) [609x377]
  Clutter-Message: _clutter_stage_gdk_notify_configure() window 0x2a62650
(26,70) [609x377]
  Clutter-Message: _clutter_stage_gdk_notify_configure() window 0x2a62650
(26,70) [661x429]
  Clutter-Message: _clutter_stage_gdk_notify_configure() window 0x2a62650
(26,70) [661x429]

=> The final configure event gives (26,70) [661x429] which is the right size
for the clutter stage window

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
wayland-bugs mailing list
wayland-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-bugs

Reply via email to