diff --git a/debian/changelog b/debian/changelog index 5e8bfcc4fccaa7dbc8c27e31c38b420c525b37a6..e85a9d6409e2ffe6c032a96aae6350ef51aa8b81 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +wlroots (0.12.0-1pureos1) byzantium; urgency=medium + + * [9a95c87] d/patches: xwayland: Allow to retrieve _NET_STARTUP_ID + + -- Sebastian Krzyszkowiak Fri, 03 Sep 2021 20:01:26 +0200 + wlroots (0.12.0-1pureos0) byzantium; urgency=medium * [1891a0b] Drop 0003-Revert-Bump-meson-version-to-0.51.2.patch. diff --git a/debian/patches/series b/debian/patches/series index b18b5bdbe6cdee8dc6c022bb575c8ac21e88d02f..349cd6eb3ba243785bf0341c93746d84a90d440a 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1 +1,2 @@ Revert-layer-shell-error-on-0-dimension-without-anchors.patch +xwayland-Allow-to-retrieve-_NET_STARTUP_ID.patch diff --git a/debian/patches/xwayland-Allow-to-retrieve-_NET_STARTUP_ID.patch b/debian/patches/xwayland-Allow-to-retrieve-_NET_STARTUP_ID.patch new file mode 100644 index 0000000000000000000000000000000000000000..c872bdbf8817d277bd69486c336c95d598f30e34 --- /dev/null +++ b/debian/patches/xwayland-Allow-to-retrieve-_NET_STARTUP_ID.patch @@ -0,0 +1,125 @@ +From 3a8836e270cbb16754a4d42aca0bc8ca8fc2117b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Guido=20G=C3=BCnther?= +Date: Fri, 29 Jan 2021 16:45:44 +0100 +Subject: [PATCH] xwayland: Allow to retrieve _NET_STARTUP_ID + +This is use for startup notifications per startup-notifiation spec + +https://specifications.freedesktop.org/startup-notification-spec/startup-notification-latest.txt +(cherry picked from commit de1522aeee04e23522398fe5cee17af67de7602a) +--- + include/wlr/xwayland.h | 2 ++ + include/xwayland/xwm.h | 1 + + xwayland/xwm.c | 29 +++++++++++++++++++++++++++++ + 3 files changed, 32 insertions(+) + +diff --git a/include/wlr/xwayland.h b/include/wlr/xwayland.h +index 8de9ed07..a161cc47 100644 +--- a/include/wlr/xwayland.h ++++ b/include/wlr/xwayland.h +@@ -147,6 +147,7 @@ struct wlr_xwayland_surface { + char *class; + char *instance; + char *role; ++ char *startup_id; + pid_t pid; + bool has_utf8_title; + +@@ -193,6 +194,7 @@ struct wlr_xwayland_surface { + struct wl_signal set_role; + struct wl_signal set_parent; + struct wl_signal set_pid; ++ struct wl_signal set_startup_id; + struct wl_signal set_window_type; + struct wl_signal set_hints; + struct wl_signal set_decorations; +diff --git a/include/xwayland/xwm.h b/include/xwayland/xwm.h +index 362b4cef..06ad3920 100644 +--- a/include/xwayland/xwm.h ++++ b/include/xwayland/xwm.h +@@ -58,6 +58,7 @@ enum atom_name { + TEXT, + TIMESTAMP, + DELETE, ++ NET_STARTUP_ID, + NET_WM_WINDOW_TYPE_NORMAL, + NET_WM_WINDOW_TYPE_UTILITY, + NET_WM_WINDOW_TYPE_TOOLTIP, +diff --git a/xwayland/xwm.c b/xwayland/xwm.c +index fefba7fc..8055777e 100644 +--- a/xwayland/xwm.c ++++ b/xwayland/xwm.c +@@ -56,6 +56,7 @@ const char *atom_map[ATOM_LAST] = { + [TEXT] = "TEXT", + [TIMESTAMP] = "TIMESTAMP", + [DELETE] = "DELETE", ++ [NET_STARTUP_ID] = "_NET_STARTUP_ID", + [NET_WM_WINDOW_TYPE_NORMAL] = "_NET_WM_WINDOW_TYPE_NORMAL", + [NET_WM_WINDOW_TYPE_UTILITY] = "_NET_WM_WINDOW_TYPE_UTILITY", + [NET_WM_WINDOW_TYPE_TOOLTIP] = "_NET_WM_WINDOW_TYPE_TOOLTIP", +@@ -159,6 +160,7 @@ static struct wlr_xwayland_surface *xwayland_surface_create( + wl_signal_init(&surface->events.set_title); + wl_signal_init(&surface->events.set_parent); + wl_signal_init(&surface->events.set_pid); ++ wl_signal_init(&surface->events.set_startup_id); + wl_signal_init(&surface->events.set_window_type); + wl_signal_init(&surface->events.set_hints); + wl_signal_init(&surface->events.set_decorations); +@@ -380,6 +382,7 @@ static void xwayland_surface_destroy( + free(xsurface->role); + free(xsurface->window_type); + free(xsurface->protocols); ++ free(xsurface->startup_id); + free(xsurface->hints); + free(xsurface->size_hints); + free(xsurface); +@@ -417,6 +420,29 @@ static void read_surface_class(struct wlr_xwm *xwm, + wlr_signal_emit_safe(&surface->events.set_class, surface); + } + ++static void read_surface_startup_id(struct wlr_xwm *xwm, ++ struct wlr_xwayland_surface *xsurface, ++ xcb_get_property_reply_t *reply) { ++ if (reply->type != XCB_ATOM_STRING && ++ reply->type != xwm->atoms[UTF8_STRING]) { ++ return; ++ } ++ ++ size_t len = xcb_get_property_value_length(reply); ++ char *startup_id = xcb_get_property_value(reply); ++ ++ free(xsurface->startup_id); ++ if (len > 0) { ++ xsurface->startup_id = strndup(startup_id, len); ++ } else { ++ xsurface->startup_id = NULL; ++ } ++ ++ wlr_log(WLR_DEBUG, "XCB_ATOM_NET_STARTUP_ID: %s", ++ xsurface->startup_id ? xsurface->startup_id: "(null)"); ++ wlr_signal_emit_safe(&xsurface->events.set_startup_id, xsurface); ++} ++ + static void read_surface_role(struct wlr_xwm *xwm, + struct wlr_xwayland_surface *xsurface, + xcb_get_property_reply_t *reply) { +@@ -766,6 +792,8 @@ static void read_surface_property(struct wlr_xwm *xwm, + read_surface_motif_hints(xwm, xsurface, reply); + } else if (property == xwm->atoms[WM_WINDOW_ROLE]) { + read_surface_role(xwm, xsurface, reply); ++ } else if (property == xwm->atoms[NET_STARTUP_ID]) { ++ read_surface_startup_id(xwm, xsurface, reply); + } else { + char *prop_name = xwm_get_atom_name(xwm, property); + wlr_log(WLR_DEBUG, "unhandled X11 property %" PRIu32 " (%s) for window %" PRIu32, +@@ -839,6 +867,7 @@ static void xwm_map_shell_surface(struct wlr_xwm *xwm, + xwm->atoms[WM_HINTS], + xwm->atoms[WM_NORMAL_HINTS], + xwm->atoms[MOTIF_WM_HINTS], ++ xwm->atoms[NET_STARTUP_ID], + xwm->atoms[NET_WM_STATE], + xwm->atoms[NET_WM_WINDOW_TYPE], + xwm->atoms[NET_WM_NAME], +-- +2.33.0 +