From b1a5803b513ca8a57327790566d9b387ee5da058 Mon Sep 17 00:00:00 2001 From: Raghuram Subramani Date: Sat, 9 Mar 2024 18:56:56 +0530 Subject: wayland-ipc.patch --- Makefile | 8 + dwl.c | 210 +++++++++ patches/wayland-ipc.patch | 498 ++++++++++++++++++++++ protocols/net-tapesoftware-dwl-wm-unstable-v1.xml | 164 +++++++ 4 files changed, 880 insertions(+) create mode 100644 patches/wayland-ipc.patch create mode 100644 protocols/net-tapesoftware-dwl-wm-unstable-v1.xml diff --git a/Makefile b/Makefile index 7d4f543..224d074 100644 --- a/Makefile +++ b/Makefile @@ -44,6 +44,14 @@ dwl-ipc-unstable-v2-protocol.c: $(WAYLAND_SCANNER) private-code \ protocols/dwl-ipc-unstable-v2.xml $@ +net-tapesoftware-dwl-wm-unstable-v1-protocol.h: protocols/net-tapesoftware-dwl-wm-unstable-v1.xml + $(WAYLAND_SCANNER) server-header \ + protocols/net-tapesoftware-dwl-wm-unstable-v1.xml $@ +net-tapesoftware-dwl-wm-unstable-v1-protocol.c: protocols/net-tapesoftware-dwl-wm-unstable-v1.xml + $(WAYLAND_SCANNER) private-code \ + protocols/net-tapesoftware-dwl-wm-unstable-v1.xml $@ +net-tapesoftware-dwl-wm-unstable-v1-protocol.o: net-tapesoftware-dwl-wm-unstable-v1-protocol.h + config.h: cp config.def.h $@ clean: diff --git a/dwl.c b/dwl.c index 50a0269..12813c0 100644 --- a/dwl.c +++ b/dwl.c @@ -55,6 +55,7 @@ #include #include #include +#include "net-tapesoftware-dwl-wm-unstable-v1-protocol.h" #ifdef XWAYLAND #include #include @@ -189,6 +190,12 @@ typedef struct { void (*arrange)(Monitor *); } Layout; +typedef struct { + struct wl_list link; + struct wl_resource *resource; + struct Monitor *monitor; +} DwlWmMonitor; + struct Monitor { struct wl_list link; struct wl_list dwl_ipc_outputs; @@ -203,6 +210,7 @@ struct Monitor { struct wlr_box m; /* monitor area, layout-relative */ struct wlr_box w; /* window area, layout-relative */ struct wl_list layers[4]; /* LayerSurface.link */ + struct wl_list dwl_wm_monitor_link; const Layout *lt[2]; Pertag *pertag; unsigned int seltags; @@ -358,6 +366,10 @@ static void xytonode(double x, double y, struct wlr_surface **psurface, Client **pc, LayerSurface **pl, double *nx, double *ny); static void zoom(const Arg *arg); +static void dwl_wm_bind(struct wl_client *client, void *data, + uint32_t version, uint32_t id); +static void dwl_wm_printstatus(Monitor *monitor); + /* variables */ static const char broken[] = "broken"; static pid_t child_pid = -1; @@ -732,6 +744,7 @@ void cleanupmon(struct wl_listener *listener, void *data) { Monitor *m = wl_container_of(listener, m, destroy); + DwlWmMonitor *mon, *montmp; LayerSurface *l, *tmp; size_t i; @@ -751,6 +764,10 @@ cleanupmon(struct wl_listener *listener, void *data) wl_list_remove(&m->request_state.link); m->wlr_output->data = NULL; wlr_output_layout_remove(output_layout, m->wlr_output); + wl_list_for_each_safe(mon, montmp, &m->dwl_wm_monitor_link, link) { + wl_resource_set_user_data(mon->resource, NULL); + free(mon); + } wlr_scene_output_destroy(m->scene_output); free(m->pertag); @@ -930,6 +947,7 @@ createmon(struct wl_listener *listener, void *data) size_t i; struct wlr_output_state state; Monitor *m; + wl_list_init(&m->dwl_wm_monitor_link); if (!wlr_output_init_render(wlr_output, alloc, drw)) return; @@ -2102,6 +2120,7 @@ printstatus(void) Monitor *m = NULL; wl_list_for_each(m, &mons, link) dwl_ipc_output_printstatus(m); + dwl_wm_printstatus(m); } void @@ -2668,6 +2687,7 @@ setup(void) wlr_scene_set_presentation(scene, wlr_presentation_create(dpy, backend)); wl_global_create(dpy, &zdwl_ipc_manager_v2_interface, 2, NULL, dwl_ipc_manager_bind); + wl_global_create(dpy, &znet_tapesoftware_dwl_wm_v1_interface, 1, NULL, dwl_wm_bind); /* Make sure XWayland clients don't connect to the parent X server, * e.g when running in the x11 backend or the wayland backend and the @@ -3305,3 +3325,193 @@ main(int argc, char *argv[]) usage: die("Usage: %s [-v] [-d] [-s startup command]", argv[0]); } + +/* dwl_wm_monitor_v1 */ +static void +dwl_wm_monitor_handle_release(struct wl_client *client, struct wl_resource *resource) +{ + wl_resource_destroy(resource); +} + +static void +dwl_wm_monitor_handle_destroy(struct wl_resource *resource) +{ + DwlWmMonitor *mon = wl_resource_get_user_data(resource); + if (mon) { + wl_list_remove(&mon->link); + free(mon); + } +} + +static void +dwl_wm_printstatus_to(Monitor *m, const DwlWmMonitor *mon) +{ + Client *c, *focused; + int tagmask, state, numclients, focused_client; + focused = focustop(m); + znet_tapesoftware_dwl_wm_monitor_v1_send_selected(mon->resource, m == selmon); + + for (int tag = 0; tagtagset[m->seltags]) != 0) + state = state | ZNET_TAPESOFTWARE_DWL_WM_MONITOR_V1_TAG_STATE_ACTIVE; + wl_list_for_each(c, &clients, link) { + if (c->mon != m) + continue; + if (!(c->tags & tagmask)) + continue; + if (c == focused) + focused_client = numclients; + numclients++; + if (c->isurgent) + state = state | ZNET_TAPESOFTWARE_DWL_WM_MONITOR_V1_TAG_STATE_URGENT; + } + znet_tapesoftware_dwl_wm_monitor_v1_send_tag(mon->resource, + tag, state, numclients, focused_client); + } + znet_tapesoftware_dwl_wm_monitor_v1_send_layout(mon->resource, m->lt[m->sellt] - layouts); + znet_tapesoftware_dwl_wm_monitor_v1_send_title(mon->resource, + focused ? client_get_title(focused) : ""); + znet_tapesoftware_dwl_wm_monitor_v1_send_frame(mon->resource); +} + +static void +dwl_wm_printstatus(Monitor *m) +{ + DwlWmMonitor *mon; + wl_list_for_each(mon, &m->dwl_wm_monitor_link, link) { + dwl_wm_printstatus_to(m, mon); + } +} + +static void +dwl_wm_monitor_handle_set_tags(struct wl_client *client, struct wl_resource *resource, + uint32_t t, uint32_t toggle_tagset) +{ + DwlWmMonitor *mon; + Monitor *m; + mon = wl_resource_get_user_data(resource); + if (!mon) + return; + m = mon->monitor; + if ((t & TAGMASK) == m->tagset[m->seltags]) + return; + if (toggle_tagset) + m->seltags ^= 1; + if (t & TAGMASK) + m->tagset[m->seltags] = t & TAGMASK; + + focusclient(focustop(m), 1); + arrange(m); + printstatus(); +} + +static void +dwl_wm_monitor_handle_set_layout(struct wl_client *client, struct wl_resource *resource, + uint32_t layout) +{ + DwlWmMonitor *mon; + Monitor *m; + mon = wl_resource_get_user_data(resource); + if (!mon) + return; + m = mon->monitor; + if (layout >= LENGTH(layouts)) + return; + if (layout != m->lt[m->sellt] - layouts) + m->sellt ^= 1; + + m->lt[m->sellt] = &layouts[layout]; + arrange(m); + printstatus(); +} + +static void +dwl_wm_monitor_handle_set_client_tags(struct wl_client *client, struct wl_resource *resource, + uint32_t and, uint32_t xor) +{ + DwlWmMonitor *mon; + Client *sel; + unsigned int newtags; + mon = wl_resource_get_user_data(resource); + if (!mon) + return; + sel = focustop(mon->monitor); + if (!sel) + return; + newtags = (sel->tags & and) ^ xor; + if (newtags) { + sel->tags = newtags; + focusclient(focustop(selmon), 1); + arrange(selmon); + printstatus(); + } +} + +static const struct znet_tapesoftware_dwl_wm_monitor_v1_interface dwl_wm_monitor_implementation = { + .release = dwl_wm_monitor_handle_release, + .set_tags = dwl_wm_monitor_handle_set_tags, + .set_layout = dwl_wm_monitor_handle_set_layout, + .set_client_tags = dwl_wm_monitor_handle_set_client_tags, +}; + +/* dwl_wm_v1 */ +static void +dwl_wm_handle_release(struct wl_client *client, struct wl_resource *resource) +{ + wl_resource_destroy(resource); +} + +static void +dwl_wm_handle_get_monitor(struct wl_client *client, struct wl_resource *resource, + uint32_t id, struct wl_resource *output) +{ + DwlWmMonitor *dwl_wm_monitor; + struct wlr_output *wlr_output = wlr_output_from_resource(output); + struct Monitor *m = wlr_output->data; + struct wl_resource *dwlOutputResource = wl_resource_create(client, + &znet_tapesoftware_dwl_wm_monitor_v1_interface, wl_resource_get_version(resource), id); + if (!resource) { + wl_client_post_no_memory(client); + return; + } + dwl_wm_monitor = calloc(1, sizeof(DwlWmMonitor)); + dwl_wm_monitor->resource = dwlOutputResource; + dwl_wm_monitor->monitor = m; + wl_resource_set_implementation(dwlOutputResource, &dwl_wm_monitor_implementation, + dwl_wm_monitor, dwl_wm_monitor_handle_destroy); + wl_list_insert(&m->dwl_wm_monitor_link, &dwl_wm_monitor->link); + dwl_wm_printstatus_to(m, dwl_wm_monitor); +} + +static void +dwl_wm_handle_destroy(struct wl_resource *resource) +{ + /* no state to destroy */ +} + +static const struct znet_tapesoftware_dwl_wm_v1_interface dwl_wm_implementation = { + .release = dwl_wm_handle_release, + .get_monitor = dwl_wm_handle_get_monitor, +}; + +static void +dwl_wm_bind(struct wl_client *client, void *data, + uint32_t version, uint32_t id) +{ + struct wl_resource *resource = wl_resource_create(client, + &znet_tapesoftware_dwl_wm_v1_interface, version, id); + if (!resource) { + wl_client_post_no_memory(client); + return; + } + + wl_resource_set_implementation(resource, &dwl_wm_implementation, NULL, dwl_wm_handle_destroy); + + for (int i = 0; i < LENGTH(tags); i++) + znet_tapesoftware_dwl_wm_v1_send_tag(resource, tags[i]); + for (int i = 0; i < LENGTH(layouts); i++) + znet_tapesoftware_dwl_wm_v1_send_layout(resource, layouts[i].symbol); +} diff --git a/patches/wayland-ipc.patch b/patches/wayland-ipc.patch new file mode 100644 index 0000000..5283eaa --- /dev/null +++ b/patches/wayland-ipc.patch @@ -0,0 +1,498 @@ +Add wayland protocol extenion for controlling dwl + +This adds a wayland protocol extension that allows clients to observe and control the window management state. + +Supported features: + * observing/updating active tags and layout + * observing the selected output and client + * updating the tags of the selected client + +This patch adds the .xml file and feeds it into wayland-scanner. + +Co-authored-by: Palanix +diff --git a/Makefile b/Makefile +index ccca079..d72dea8 100644 +--- a/Makefile ++++ b/Makefile +@@ -14,9 +14,9 @@ DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CF + LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(LIBS) + + all: dwl +-dwl: dwl.o util.o +- $(CC) dwl.o util.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@ +-dwl.o: dwl.c config.mk config.h client.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h ++dwl: dwl.o util.o net-tapesoftware-dwl-wm-unstable-v1-protocol.o ++ $(CC) dwl.o util.o net-tapesoftware-dwl-wm-unstable-v1-protocol.o $(LDLIBS) $(LDFLAGS) $(DWLCFLAGS) -o $@ ++dwl.o: dwl.c config.mk config.h client.h xdg-shell-protocol.h wlr-layer-shell-unstable-v1-protocol.h net-tapesoftware-dwl-wm-unstable-v1-protocol.o + util.o: util.c util.h + + # wayland-scanner is a tool which generates C headers and rigging for Wayland +@@ -32,6 +32,14 @@ wlr-layer-shell-unstable-v1-protocol.h: + $(WAYLAND_SCANNER) server-header \ + protocols/wlr-layer-shell-unstable-v1.xml $@ + ++net-tapesoftware-dwl-wm-unstable-v1-protocol.h: protocols/net-tapesoftware-dwl-wm-unstable-v1.xml ++ $(WAYLAND_SCANNER) server-header \ ++ protocols/net-tapesoftware-dwl-wm-unstable-v1.xml $@ ++net-tapesoftware-dwl-wm-unstable-v1-protocol.c: protocols/net-tapesoftware-dwl-wm-unstable-v1.xml ++ $(WAYLAND_SCANNER) private-code \ ++ protocols/net-tapesoftware-dwl-wm-unstable-v1.xml $@ ++net-tapesoftware-dwl-wm-unstable-v1-protocol.o: net-tapesoftware-dwl-wm-unstable-v1-protocol.h ++ + config.h: + cp config.def.h $@ + clean: +diff --git a/dwl.c b/dwl.c +index 8043bf9..f2977fc 100644 +--- a/dwl.c ++++ b/dwl.c +@@ -52,6 +52,7 @@ + #include + #include + #include ++#include "net-tapesoftware-dwl-wm-unstable-v1-protocol.h" + #ifdef XWAYLAND + #include + #include +@@ -172,6 +173,12 @@ typedef struct { + void (*arrange)(Monitor *); + } Layout; + ++typedef struct { ++ struct wl_list link; ++ struct wl_resource *resource; ++ struct Monitor *monitor; ++} DwlWmMonitor; ++ + struct Monitor { + struct wl_list link; + struct wlr_output *wlr_output; +@@ -184,6 +191,7 @@ struct Monitor { + struct wlr_box m; /* monitor area, layout-relative */ + struct wlr_box w; /* window area, layout-relative */ + struct wl_list layers[4]; /* LayerSurface::link */ ++ struct wl_list dwl_wm_monitor_link; + const Layout *lt[2]; + unsigned int seltags; + unsigned int sellt; +@@ -318,6 +326,10 @@ static struct wlr_scene_node *xytonode(double x, double y, struct wlr_surface ** + Client **pc, LayerSurface **pl, double *nx, double *ny); + static void zoom(const Arg *arg); + ++static void dwl_wm_bind(struct wl_client *client, void *data, ++ uint32_t version, uint32_t id); ++static void dwl_wm_printstatus(Monitor *monitor); ++ + /* variables */ + static const char broken[] = "broken"; + static const char *cursor_image = "left_ptr"; +@@ -685,6 +697,7 @@ void + cleanupmon(struct wl_listener *listener, void *data) + { + Monitor *m = wl_container_of(listener, m, destroy); ++ DwlWmMonitor *mon, *montmp; + LayerSurface *l, *tmp; + int i; + +@@ -697,6 +710,10 @@ cleanupmon(struct wl_listener *listener, void *data) + wl_list_remove(&m->link); + m->wlr_output->data = NULL; + wlr_output_layout_remove(output_layout, m->wlr_output); ++ wl_list_for_each_safe(mon, montmp, &m->dwl_wm_monitor_link, link) { ++ wl_resource_set_user_data(mon->resource, NULL); ++ free(mon); ++ } + wlr_scene_output_destroy(m->scene_output); + wlr_scene_node_destroy(&m->fullscreen_bg->node); + +@@ -903,6 +920,7 @@ createmon(struct wl_listener *listener, void *data) + const MonitorRule *r; + size_t i; + Monitor *m = wlr_output->data = ecalloc(1, sizeof(*m)); ++ wl_list_init(&m->dwl_wm_monitor_link); + m->wlr_output = wlr_output; + + wlr_output_init_render(wlr_output, alloc, drw); +@@ -1852,6 +1870,7 @@ printstatus(void) + printf("%s tags %u %u %u %u\n", m->wlr_output->name, occ, m->tagset[m->seltags], + sel, urg); + printf("%s layout %s\n", m->wlr_output->name, m->lt[m->sellt]->symbol); ++ dwl_wm_printstatus(m); + } + fflush(stdout); + } +@@ -2289,6 +2308,7 @@ setup(void) + wl_signal_add(&output_mgr->events.test, &output_mgr_test); + + wlr_scene_set_presentation(scene, wlr_presentation_create(dpy, backend)); ++ wl_global_create(dpy, &znet_tapesoftware_dwl_wm_v1_interface, 1, NULL, dwl_wm_bind); + + #ifdef XWAYLAND + /* +@@ -2828,3 +2848,193 @@ main(int argc, char *argv[]) + usage: + die("Usage: %s [-v] [-s startup command]", argv[0]); + } ++ ++/* dwl_wm_monitor_v1 */ ++static void ++dwl_wm_monitor_handle_release(struct wl_client *client, struct wl_resource *resource) ++{ ++ wl_resource_destroy(resource); ++} ++ ++static void ++dwl_wm_monitor_handle_destroy(struct wl_resource *resource) ++{ ++ DwlWmMonitor *mon = wl_resource_get_user_data(resource); ++ if (mon) { ++ wl_list_remove(&mon->link); ++ free(mon); ++ } ++} ++ ++static void ++dwl_wm_printstatus_to(Monitor *m, const DwlWmMonitor *mon) ++{ ++ Client *c, *focused; ++ int tagmask, state, numclients, focused_client; ++ focused = focustop(m); ++ znet_tapesoftware_dwl_wm_monitor_v1_send_selected(mon->resource, m == selmon); ++ ++ for (int tag = 0; tagtagset[m->seltags]) != 0) ++ state = state | ZNET_TAPESOFTWARE_DWL_WM_MONITOR_V1_TAG_STATE_ACTIVE; ++ wl_list_for_each(c, &clients, link) { ++ if (c->mon != m) ++ continue; ++ if (!(c->tags & tagmask)) ++ continue; ++ if (c == focused) ++ focused_client = numclients; ++ numclients++; ++ if (c->isurgent) ++ state = state | ZNET_TAPESOFTWARE_DWL_WM_MONITOR_V1_TAG_STATE_URGENT; ++ } ++ znet_tapesoftware_dwl_wm_monitor_v1_send_tag(mon->resource, ++ tag, state, numclients, focused_client); ++ } ++ znet_tapesoftware_dwl_wm_monitor_v1_send_layout(mon->resource, m->lt[m->sellt] - layouts); ++ znet_tapesoftware_dwl_wm_monitor_v1_send_title(mon->resource, ++ focused ? client_get_title(focused) : ""); ++ znet_tapesoftware_dwl_wm_monitor_v1_send_frame(mon->resource); ++} ++ ++static void ++dwl_wm_printstatus(Monitor *m) ++{ ++ DwlWmMonitor *mon; ++ wl_list_for_each(mon, &m->dwl_wm_monitor_link, link) { ++ dwl_wm_printstatus_to(m, mon); ++ } ++} ++ ++static void ++dwl_wm_monitor_handle_set_tags(struct wl_client *client, struct wl_resource *resource, ++ uint32_t t, uint32_t toggle_tagset) ++{ ++ DwlWmMonitor *mon; ++ Monitor *m; ++ mon = wl_resource_get_user_data(resource); ++ if (!mon) ++ return; ++ m = mon->monitor; ++ if ((t & TAGMASK) == m->tagset[m->seltags]) ++ return; ++ if (toggle_tagset) ++ m->seltags ^= 1; ++ if (t & TAGMASK) ++ m->tagset[m->seltags] = t & TAGMASK; ++ ++ focusclient(focustop(m), 1); ++ arrange(m); ++ printstatus(); ++} ++ ++static void ++dwl_wm_monitor_handle_set_layout(struct wl_client *client, struct wl_resource *resource, ++ uint32_t layout) ++{ ++ DwlWmMonitor *mon; ++ Monitor *m; ++ mon = wl_resource_get_user_data(resource); ++ if (!mon) ++ return; ++ m = mon->monitor; ++ if (layout >= LENGTH(layouts)) ++ return; ++ if (layout != m->lt[m->sellt] - layouts) ++ m->sellt ^= 1; ++ ++ m->lt[m->sellt] = &layouts[layout]; ++ arrange(m); ++ printstatus(); ++} ++ ++static void ++dwl_wm_monitor_handle_set_client_tags(struct wl_client *client, struct wl_resource *resource, ++ uint32_t and, uint32_t xor) ++{ ++ DwlWmMonitor *mon; ++ Client *sel; ++ unsigned int newtags; ++ mon = wl_resource_get_user_data(resource); ++ if (!mon) ++ return; ++ sel = focustop(mon->monitor); ++ if (!sel) ++ return; ++ newtags = (sel->tags & and) ^ xor; ++ if (newtags) { ++ sel->tags = newtags; ++ focusclient(focustop(selmon), 1); ++ arrange(selmon); ++ printstatus(); ++ } ++} ++ ++static const struct znet_tapesoftware_dwl_wm_monitor_v1_interface dwl_wm_monitor_implementation = { ++ .release = dwl_wm_monitor_handle_release, ++ .set_tags = dwl_wm_monitor_handle_set_tags, ++ .set_layout = dwl_wm_monitor_handle_set_layout, ++ .set_client_tags = dwl_wm_monitor_handle_set_client_tags, ++}; ++ ++/* dwl_wm_v1 */ ++static void ++dwl_wm_handle_release(struct wl_client *client, struct wl_resource *resource) ++{ ++ wl_resource_destroy(resource); ++} ++ ++static void ++dwl_wm_handle_get_monitor(struct wl_client *client, struct wl_resource *resource, ++ uint32_t id, struct wl_resource *output) ++{ ++ DwlWmMonitor *dwl_wm_monitor; ++ struct wlr_output *wlr_output = wlr_output_from_resource(output); ++ struct Monitor *m = wlr_output->data; ++ struct wl_resource *dwlOutputResource = wl_resource_create(client, ++ &znet_tapesoftware_dwl_wm_monitor_v1_interface, wl_resource_get_version(resource), id); ++ if (!resource) { ++ wl_client_post_no_memory(client); ++ return; ++ } ++ dwl_wm_monitor = calloc(1, sizeof(DwlWmMonitor)); ++ dwl_wm_monitor->resource = dwlOutputResource; ++ dwl_wm_monitor->monitor = m; ++ wl_resource_set_implementation(dwlOutputResource, &dwl_wm_monitor_implementation, ++ dwl_wm_monitor, dwl_wm_monitor_handle_destroy); ++ wl_list_insert(&m->dwl_wm_monitor_link, &dwl_wm_monitor->link); ++ dwl_wm_printstatus_to(m, dwl_wm_monitor); ++} ++ ++static void ++dwl_wm_handle_destroy(struct wl_resource *resource) ++{ ++ /* no state to destroy */ ++} ++ ++static const struct znet_tapesoftware_dwl_wm_v1_interface dwl_wm_implementation = { ++ .release = dwl_wm_handle_release, ++ .get_monitor = dwl_wm_handle_get_monitor, ++}; ++ ++static void ++dwl_wm_bind(struct wl_client *client, void *data, ++ uint32_t version, uint32_t id) ++{ ++ struct wl_resource *resource = wl_resource_create(client, ++ &znet_tapesoftware_dwl_wm_v1_interface, version, id); ++ if (!resource) { ++ wl_client_post_no_memory(client); ++ return; ++ } ++ ++ wl_resource_set_implementation(resource, &dwl_wm_implementation, NULL, dwl_wm_handle_destroy); ++ ++ for (int i = 0; i < LENGTH(tags); i++) ++ znet_tapesoftware_dwl_wm_v1_send_tag(resource, tags[i]); ++ for (int i = 0; i < LENGTH(layouts); i++) ++ znet_tapesoftware_dwl_wm_v1_send_layout(resource, layouts[i].symbol); ++} +diff --git a/protocols/net-tapesoftware-dwl-wm-unstable-v1.xml b/protocols/net-tapesoftware-dwl-wm-unstable-v1.xml +new file mode 100644 +index 0000000..4fe5b73 +--- /dev/null ++++ b/protocols/net-tapesoftware-dwl-wm-unstable-v1.xml +@@ -0,0 +1,164 @@ ++ ++ ++ ++ Copyright (c) 2021 Raphael Robatsch ++ ++ Permission is hereby granted, free of charge, to any person obtaining a ++ copy of this software and associated documentation files (the ++ "Software"), to deal in the Software without restriction, including ++ without limitation the rights to use, copy, modify, merge, publish, ++ distribute, sublicense, and/or sell copies of the Software, and to ++ permit persons to whom the Software is furnished to do so, subject to ++ the following conditions: ++ ++ The above copyright notice and this permission notice (including the ++ next paragraph) shall be included in all copies or substantial portions ++ of the Software. ++ ++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ++ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, ++ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE ++ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ++ ++ ++ ++ ++ This interface is exposed as a global in the wl_registry. ++ ++ Clients can use this protocol to receive updates of the window manager ++ state (active tags, active layout, and focused window). ++ Clients can also control this state. ++ ++ After binding, the client will receive the available tags and layouts ++ with the 'tag' and 'layout' events. These can be used in subsequent ++ dwl_wm_monitor_v1.set_tags/set_layout requests, and to interpret the ++ dwl_wm_monitor_v1.layout/tag events. ++ ++ ++ ++ ++ This request indicates that the client will not use the dwl_wm ++ object any more. Objects that have been created through this instance ++ are not affected. ++ ++ ++ ++ ++ ++ Gets a dwl monitor for the specified output. The window manager ++ state on the output can be controlled using the monitor. ++ ++ ++ ++ ++ ++ ++ ++ This event is sent immediately after binding. ++ A roundtrip after binding guarantees that the client has received all tags. ++ ++ ++ ++ ++ ++ ++ This event is sent immediately after binding. ++ A roundtrip after binding guarantees that the client has received all layouts. ++ ++ ++ ++ ++ ++ ++ ++ Observes and controls one monitor. ++ ++ Events are double-buffered: Clients should cache all events and only ++ redraw themselves once the 'frame' event is sent. ++ ++ Requests are not double-buffered: The compositor will update itself ++ immediately. ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ This request indicates that the client is done with this dwl_monitor. ++ All further requests are ignored. ++ ++ ++ ++ ++ ++ If 'selected' is nonzero, this monitor is the currently selected one. ++ ++ ++ ++ ++ ++ ++ Announces the update of a tag. num_clients and focused_client can be ++ used to draw client indicators. ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ Announces the update of the selected layout. ++ ++ ++ ++ ++ ++ ++ Announces the update of the selected client. ++ ++ ++ ++ ++ ++ ++ Sent after all other events belonging to the status update has been sent. ++ Clients should redraw themselves now. ++ ++ ++ ++ ++ ++ Changes are applied immediately. ++ ++ ++ ++ ++ ++ ++ ++ tags are updated as follows: ++ new_tags = (current_tags AND and_tags) XOR xor_tags ++ ++ Changes are applied immediately. ++ ++ ++ ++ ++ ++ ++ ++ Changes are applied immediately. ++ ++ ++ ++ ++ +-- +2.39.1 + diff --git a/protocols/net-tapesoftware-dwl-wm-unstable-v1.xml b/protocols/net-tapesoftware-dwl-wm-unstable-v1.xml new file mode 100644 index 0000000..4fe5b73 --- /dev/null +++ b/protocols/net-tapesoftware-dwl-wm-unstable-v1.xml @@ -0,0 +1,164 @@ + + + + Copyright (c) 2021 Raphael Robatsch + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice (including the + next paragraph) shall be included in all copies or substantial portions + of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + + + This interface is exposed as a global in the wl_registry. + + Clients can use this protocol to receive updates of the window manager + state (active tags, active layout, and focused window). + Clients can also control this state. + + After binding, the client will receive the available tags and layouts + with the 'tag' and 'layout' events. These can be used in subsequent + dwl_wm_monitor_v1.set_tags/set_layout requests, and to interpret the + dwl_wm_monitor_v1.layout/tag events. + + + + + This request indicates that the client will not use the dwl_wm + object any more. Objects that have been created through this instance + are not affected. + + + + + + Gets a dwl monitor for the specified output. The window manager + state on the output can be controlled using the monitor. + + + + + + + + This event is sent immediately after binding. + A roundtrip after binding guarantees that the client has received all tags. + + + + + + + This event is sent immediately after binding. + A roundtrip after binding guarantees that the client has received all layouts. + + + + + + + + Observes and controls one monitor. + + Events are double-buffered: Clients should cache all events and only + redraw themselves once the 'frame' event is sent. + + Requests are not double-buffered: The compositor will update itself + immediately. + + + + + + + + + + + This request indicates that the client is done with this dwl_monitor. + All further requests are ignored. + + + + + + If 'selected' is nonzero, this monitor is the currently selected one. + + + + + + + Announces the update of a tag. num_clients and focused_client can be + used to draw client indicators. + + + + + + + + + + Announces the update of the selected layout. + + + + + + + Announces the update of the selected client. + + + + + + + Sent after all other events belonging to the status update has been sent. + Clients should redraw themselves now. + + + + + + Changes are applied immediately. + + + + + + + + tags are updated as follows: + new_tags = (current_tags AND and_tags) XOR xor_tags + + Changes are applied immediately. + + + + + + + + Changes are applied immediately. + + + + + -- cgit v1.2.3