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 707401 - wayland: implement resizing and maximization for wayland clients
wayland: implement resizing and maximization for wayland clients
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: wayland
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
wayland 3.10
Depends on:
Blocks:
 
 
Reported: 2013-09-03 16:28 UTC by Giovanni Campagna
Modified: 2013-09-16 12:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wayland: implement resizing and maximization for wayland clients (62.77 KB, patch)
2013-09-03 16:28 UTC, Giovanni Campagna
none Details | Review
wayland: implement resizing and maximization for wayland clients (42.91 KB, patch)
2013-09-16 11:51 UTC, Giovanni Campagna
committed Details | Review
MetaWaylandSurface: cache the surface type until the first commit (10.05 KB, patch)
2013-09-16 11:51 UTC, Giovanni Campagna
committed Details | Review
wayland: implement transient hints for wayland clients (11.45 KB, patch)
2013-09-16 11:51 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2013-09-03 16:28:18 UTC
To properly resize clients, we need to send them configure events
with the size we computed from the constraint system.
Also, once the sizing is properly wired up, we need to make
sure that the size at the initial map is correct, and not
always 0, 0 (because the buffer is not yet converted into
a CoglTexture by MetaShapedTexture), otherwise we end up sending
out configure events at 1 x 1. To do so, we cache the surface
type in the initial state until the first commit.

Note that this does not handle interactive resizing yet, it
merely makes the API calls work for wayland clients.

While we're there, let's implement transient hints too.
(I may have to separate this out...)
Comment 1 Giovanni Campagna 2013-09-03 16:28:21 UTC
Created attachment 253992 [details] [review]
wayland: implement resizing and maximization for wayland clients
Comment 2 Giovanni Campagna 2013-09-12 08:41:58 UTC
Marking 3.10 because bug 707863 is on top of this.
Comment 3 drago01 2013-09-16 11:33:21 UTC
Review of attachment 253992 [details] [review]:

Can you split that into two patches (and rebase) ?

::: configure.ac
@@ +3,3 @@
 m4_define([mutter_major_version], [3])
 m4_define([mutter_minor_version], [9])
+m4_define([mutter_micro_version], [91])

Unrelated.

::: src/core/window-private.h
@@ +729,3 @@
                                            const char *window_object_path);
 
+void meta_window_set_transient_for        (MetaWindow *window,

This has nothing to with maximize ... so yeah split it out.
Comment 4 Giovanni Campagna 2013-09-16 11:51:40 UTC
Created attachment 255015 [details] [review]
wayland: implement resizing and maximization for wayland clients

To properly resize clients, we need to send them configure events
with the size we computed from the constraint system, and
then check if the new size they ask is compatible with
our expectation.

Note that this does not handle interactive resizing yet, it
merely makes the API calls work for wayland clients.
Comment 5 Giovanni Campagna 2013-09-16 11:51:44 UTC
Created attachment 255016 [details] [review]
MetaWaylandSurface: cache the surface type until the first commit

Once the sizing is properly wired up, we need to make sure that
the size at the initial map is correct, and not always 0, 0 because
the buffer is not yet converted into a CoglTexture by MetaShapedTexture,
otherwise we end up sending out configure events at 1 x 1.
To do so, we cache the surface type in the initial state until the
first commit.
Comment 6 Giovanni Campagna 2013-09-16 11:51:48 UTC
Created attachment 255017 [details] [review]
wayland: implement transient hints for wayland clients

wl_shell supports a set_transient() map request that is equivalent
to setting WM_TRANSIENT_FOR in X11, so implement that.
Comment 7 drago01 2013-09-16 12:08:09 UTC
Review of attachment 255015 [details] [review]:

Looks good to me modulo smaller nitpicks.

::: src/core/window-private.h
@@ +404,3 @@
   MetaRectangle rect;
 
+  /* The size we want the window to be (i.e. what we last asked

Size and position?

::: src/core/window.c
@@ +5192,3 @@
+
+          if ((deltax - dx) != 0 ||
+              (deltay - dy) != 0)

Just do deltax != dx || deltay != dy
Comment 8 drago01 2013-09-16 12:13:11 UTC
Review of attachment 255016 [details] [review]:

Looks good but some transient_for sneaked in.

::: src/wayland/meta-wayland-surface.c
@@ +1081,3 @@
+    }
+
+  if (initial->transient_for)

Shouldn't this be in the other patch?

::: src/wayland/meta-wayland-surface.h
@@ +76,3 @@
 {
+  MetaWaylandSurfaceType initial_type;
+  struct wl_resource *transient_for;

Same here.
Comment 9 drago01 2013-09-16 12:16:52 UTC
Review of attachment 255017 [details] [review]:

Needs the other bits from the second patch to move there. Otherwise looks good (just needs a style fix).

::: src/core/window.c
@@ +1132,3 @@
       window->net_wm_user_time = window->initial_timestamp;
+    else if (window->transient_for != NULL)
+      meta_window_set_user_time(window, window->transient_for->net_wm_user_time);

Missing space.
Comment 10 Giovanni Campagna 2013-09-16 12:50:33 UTC
Pushed with suggested changes.

Attachment 255015 [details] pushed as a7eaf43 - wayland: implement resizing and maximization for wayland clients
Attachment 255016 [details] pushed as 12d6c70 - MetaWaylandSurface: cache the surface type until the first commit
Attachment 255017 [details] pushed as 81d9797 - wayland: implement transient hints for wayland clients