GNOME Bugzilla – Bug 707401
wayland: implement resizing and maximization for wayland clients
Last modified: 2013-09-16 12:50:44 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...)
Created attachment 253992 [details] [review] wayland: implement resizing and maximization for wayland clients
Marking 3.10 because bug 707863 is on top of this.
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.
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.
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.
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.
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
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.
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.
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