[weston 0/8] Implement NET_WM_SYNC_REQUEST basic support
Olivier Fourdan
ofourdan at redhat.com
Mon Apr 24 13:52:50 UTC 2017
Hi,
> On 11 April 2017 at 21:52, Louis-Francis Ratté-Boulianne
> <lfrb at collabora.com> wrote:
> > Implement NET_WM_SYNC_REQUEST protocol for throtting X11 window resizes
> > in Weston's XWM. We wait for the window to be drawn (by setting an
> > alarm on the sync counter) before configuring the window again.
> >
> > I also did some small fixes the Xwayland window manager as to better
> > respect size hints from X11 applications and to display the title
> > more elegantly when there isn't enough space available.
>
> This is great, thankyou! And an unexpected bonus with the title rendering. :)
>
> Jonas, Olivier - I know XWM isn't exactly a Mutter thing, but could
> you please take a look over this as well?
Sure, happy to help!
I tested this patch and see the sync alarm being fired on a regular basis with gtk2 apps so it's a good sign! :)
Small issue is that once the sync timeout is triggered, the sync protocol is disabled for the given window - I think this is a bit harsh on the client, because the client might be busy temporarily, in which case it makes sense to disable the sync protocol while resizing, but usually, it's re-enabled next time an interactive resize is started - at least, all other x11 window managers I know do this, whereas weston with this patch doesn't give another chance.
Basically, weston logs "Sync request timed out. Temporarily disabling syncing" but it's actually permanently disabled for the given window, "sync_disabled" is reset to 0 in unmap_notify(), it should be done when first initiating a resize imho.
On the trivial side of things, there are some indentation issues:
> diff --git a/xwayland/xwayland.h b/xwayland/xwayland.h
> index ca75f5b7..fcc87785 100644
> --- a/xwayland/xwayland.h
> +++ b/xwayland/xwayland.h
> @@ -27,6 +27,7 @@
> #include <xcb/xcb.h>
> #include <xcb/xfixes.h>
> #include <xcb/composite.h>
> +#include <xcb/sync.h>
> #include <cairo/cairo-xcb.h>
>
> #include "compositor.h"
> @@ -56,8 +57,10 @@ struct weston_xserver {
> struct weston_wm {
> xcb_connection_t *conn;
> const xcb_query_extension_reply_t *xfixes;
> + const xcb_query_extension_reply_t *sync;
> struct wl_event_source *source;
> xcb_screen_t *screen;
> + struct hash_table *alarm_hash;
> struct hash_table *window_hash;
> struct weston_xserver *server;
> xcb_window_t wm_window;
> @@ -107,6 +110,8 @@ struct weston_wm {
> xcb_atom_t net_wm_state_maximized_vert;
> xcb_atom_t net_wm_state_maximized_horz;
> xcb_atom_t net_wm_state_fullscreen;
> + xcb_atom_t net_wm_sync_request;
> + xcb_atom_t net_wm_sync_request_counter;
^^^ here
> xcb_atom_t net_wm_user_time;
> xcb_atom_t net_wm_icon_name;
> xcb_atom_t net_wm_desktop;
Cheers,
Olivier
More information about the wayland-devel
mailing list