diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2023-04-26 09:37:23 +0200 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2023-04-26 07:46:45 +0000 |
commit | 5ce96a2a733b0a6556e1512fd9a703ede6a7c959 (patch) | |
tree | 603fbd4cc858b2a732ae30c4579f8dfe6e00d33d | |
parent | 7b1758936bd644020a560f2739ad7a50fbb87b17 (diff) | |
download | xserver-5ce96a2a733b0a6556e1512fd9a703ede6a7c959.tar.gz |
xwayland/window: Move set-allow functions lower down
This will make some helper functions in the same file usable without
extra declarations.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
-rw-r--r-- | hw/xwayland/xwayland-window.c | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/hw/xwayland/xwayland-window.c b/hw/xwayland/xwayland-window.c index 6b7f38605..b7574eeb5 100644 --- a/hw/xwayland/xwayland-window.c +++ b/hw/xwayland/xwayland-window.c @@ -56,41 +56,6 @@ static DevPrivateKeyRec xwl_window_private_key; static DevPrivateKeyRec xwl_damage_private_key; static const char *xwl_surface_tag = "xwl-surface"; -static void -xwl_window_set_allow_commits(struct xwl_window *xwl_window, Bool allow, - const char *debug_msg) -{ - xwl_window->allow_commits = allow; - DebugF("XWAYLAND: win %d allow_commits = %d (%s)\n", - xwl_window->window->drawable.id, allow, debug_msg); -} - -static void -xwl_window_set_allow_commits_from_property(struct xwl_window *xwl_window, - PropertyPtr prop) -{ - static Bool warned = FALSE; - CARD32 *propdata; - - if (prop->propertyName != xwl_window->xwl_screen->allow_commits_prop) - FatalError("Xwayland internal error: prop mismatch in %s.\n", __func__); - - if (prop->type != XA_CARDINAL || prop->format != 32 || prop->size != 1) { - /* Not properly set, so fall back to safe and glitchy */ - xwl_window_set_allow_commits(xwl_window, TRUE, "WM fault"); - - if (!warned) { - LogMessageVerb(X_WARNING, 0, "Window manager is misusing property %s.\n", - NameForAtom(prop->propertyName)); - warned = TRUE; - } - return; - } - - propdata = prop->data; - xwl_window_set_allow_commits(xwl_window, !!propdata[0], "from property"); -} - struct xwl_window * xwl_window_get(WindowPtr window) { @@ -137,6 +102,41 @@ is_surface_from_xwl_window(struct wl_surface *surface) return wl_proxy_get_tag((struct wl_proxy *) surface) == &xwl_surface_tag; } +static void +xwl_window_set_allow_commits(struct xwl_window *xwl_window, Bool allow, + const char *debug_msg) +{ + xwl_window->allow_commits = allow; + DebugF("XWAYLAND: win %d allow_commits = %d (%s)\n", + xwl_window->window->drawable.id, allow, debug_msg); +} + +static void +xwl_window_set_allow_commits_from_property(struct xwl_window *xwl_window, + PropertyPtr prop) +{ + static Bool warned = FALSE; + CARD32 *propdata; + + if (prop->propertyName != xwl_window->xwl_screen->allow_commits_prop) + FatalError("Xwayland internal error: prop mismatch in %s.\n", __func__); + + if (prop->type != XA_CARDINAL || prop->format != 32 || prop->size != 1) { + /* Not properly set, so fall back to safe and glitchy */ + xwl_window_set_allow_commits(xwl_window, TRUE, "WM fault"); + + if (!warned) { + LogMessageVerb(X_WARNING, 0, "Window manager is misusing property %s.\n", + NameForAtom(prop->propertyName)); + warned = TRUE; + } + return; + } + + propdata = prop->data; + xwl_window_set_allow_commits(xwl_window, !!propdata[0], "from property"); +} + void xwl_window_update_property(struct xwl_window *xwl_window, PropertyStateRec *propstate) |