mirror of
https://codeberg.org/dwl/dwl-patches.git
synced 2025-09-07 11:44:51 +00:00
ipc: 2024-08-16
This commit is contained in:
parent
3c690cfb8b
commit
158de28bc6
@ -7,7 +7,8 @@ Note to [pertag](../pertag/) users: apply [this](./ipcpertag.patch) for ipc tags
|
||||
|
||||
### Download
|
||||
- [git branch](https://codeberg.org/notchoc/dwl/src/branch/ipc)
|
||||
- [2024-07-29](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/ipc/ipc.patch) don't focus other outputs (apply [this minipatch](./focus-tagset-output.patch) if you'd prefer that)
|
||||
- [2024-08-16](https://codeberg.org/dwl/dwl-patches/raw/branch/main/patches/ipc/ipc.patch)
|
||||
- [2024-07-29](https://codeberg.org/dwl/dwl-patches/raw/commit/d235f0f88ed069eca234da5a544fb1c6e19f1d33/patches/ipc/ipc.patch) don't focus other outputs (apply [this minipatch](./focus-tagset-output.patch) if you'd prefer that)
|
||||
- [2024-07-16](https://codeberg.org/dwl/dwl-patches/raw/commit/642b2559d522034785c1c1203c6d426855ec19ca/patches/ipc/ipc.patch)
|
||||
- [2024-06-30](https://codeberg.org/dwl/dwl-patches/raw/commit/9a751e5020133d3ab9219e68a43109c6f3c931a7/patches/ipc/ipc.patch)
|
||||
- [2024-06-21](https://codeberg.org/dwl/dwl-patches/raw/commit/f96ee44cbaef06bd38b8fa29ac7ecba8b1b5abd5/patches/ipc/ipc.patch)
|
||||
|
@ -1,23 +1,23 @@
|
||||
From 9afb899ea8b63894499d39f4ab7f430eefce5392 Mon Sep 17 00:00:00 2001
|
||||
From 6c6d655b68770ce82a24fde9b58c4d97b672553a Mon Sep 17 00:00:00 2001
|
||||
From: choc <notchoc@proton.me>
|
||||
Date: Mon, 23 Oct 2023 10:35:17 +0800
|
||||
Subject: [PATCH] implement dwl-ipc-unstable-v2
|
||||
Subject: [PATCH 1/2] implement dwl-ipc-unstable-v2
|
||||
https://codeberg.org/dwl/dwl-patches/wiki/ipc
|
||||
|
||||
---
|
||||
Makefile | 14 +-
|
||||
config.def.h | 1 +
|
||||
dwl.c | 260 ++++++++++++++++++++++++++----
|
||||
dwl.c | 257 ++++++++++++++++++++++++++----
|
||||
protocols/dwl-ipc-unstable-v2.xml | 181 +++++++++++++++++++++
|
||||
4 files changed, 419 insertions(+), 37 deletions(-)
|
||||
4 files changed, 419 insertions(+), 34 deletions(-)
|
||||
create mode 100644 protocols/dwl-ipc-unstable-v2.xml
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index f955e7b..10f3c98 100644
|
||||
index 8db7409..a79a080 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -17,12 +17,14 @@ DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(DWLCPPFLAGS) $(DWLDEVCFLAGS) $(CF
|
||||
LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` -lm $(LIBS)
|
||||
@@ -17,12 +17,14 @@ DWLCFLAGS = `$(PKG_CONFIG) --cflags $(PKGS)` $(WLR_INCS) $(DWLCPPFLAGS) $(DWLDEV
|
||||
LDLIBS = `$(PKG_CONFIG) --libs $(PKGS)` $(WLR_LIBS) -lm $(LIBS)
|
||||
|
||||
all: dwl
|
||||
-dwl: dwl.o util.o
|
||||
@ -60,10 +60,10 @@ index 22d2171..1593033 100644
|
||||
{ MODKEY, XKB_KEY_k, focusstack, {.i = -1} },
|
||||
{ MODKEY, XKB_KEY_i, incnmaster, {.i = +1} },
|
||||
diff --git a/dwl.c b/dwl.c
|
||||
index ac9c36b..4a025f0 100644
|
||||
index 8a587d1..7a4949b 100644
|
||||
--- a/dwl.c
|
||||
+++ b/dwl.c
|
||||
@@ -67,6 +67,7 @@
|
||||
@@ -68,6 +68,7 @@
|
||||
#include <xcb/xcb_icccm.h>
|
||||
#endif
|
||||
|
||||
@ -71,7 +71,7 @@ index ac9c36b..4a025f0 100644
|
||||
#include "util.h"
|
||||
|
||||
/* macros */
|
||||
@@ -143,6 +144,12 @@ typedef struct {
|
||||
@@ -144,6 +145,12 @@ typedef struct {
|
||||
uint32_t resize; /* configure serial of a pending resize */
|
||||
} Client;
|
||||
|
||||
@ -84,7 +84,7 @@ index ac9c36b..4a025f0 100644
|
||||
typedef struct {
|
||||
uint32_t mod;
|
||||
xkb_keysym_t keysym;
|
||||
@@ -188,6 +195,7 @@ typedef struct {
|
||||
@@ -189,6 +196,7 @@ typedef struct {
|
||||
|
||||
struct Monitor {
|
||||
struct wl_list link;
|
||||
@ -92,7 +92,7 @@ index ac9c36b..4a025f0 100644
|
||||
struct wlr_output *wlr_output;
|
||||
struct wlr_scene_output *scene_output;
|
||||
struct wlr_scene_rect *fullscreen_bg; /* See createmon() for info */
|
||||
@@ -285,6 +293,17 @@ static void destroysessionlock(struct wl_listener *listener, void *data);
|
||||
@@ -286,6 +294,17 @@ static void destroysessionlock(struct wl_listener *listener, void *data);
|
||||
static void destroysessionmgr(struct wl_listener *listener, void *data);
|
||||
static void destroykeyboardgroup(struct wl_listener *listener, void *data);
|
||||
static Monitor *dirtomon(enum wlr_direction dir);
|
||||
@ -118,7 +118,7 @@ index ac9c36b..4a025f0 100644
|
||||
static void togglefloating(const Arg *arg);
|
||||
static void togglefullscreen(const Arg *arg);
|
||||
static void toggletag(const Arg *arg);
|
||||
@@ -413,6 +433,9 @@ static struct wlr_box sgeom;
|
||||
@@ -411,6 +431,9 @@ static struct wlr_box sgeom;
|
||||
static struct wl_list mons;
|
||||
static Monitor *selmon;
|
||||
|
||||
@ -128,7 +128,7 @@ index ac9c36b..4a025f0 100644
|
||||
#ifdef XWAYLAND
|
||||
static void activatex11(struct wl_listener *listener, void *data);
|
||||
static void associatex11(struct wl_listener *listener, void *data);
|
||||
@@ -706,6 +729,10 @@ cleanupmon(struct wl_listener *listener, void *data)
|
||||
@@ -703,6 +726,10 @@ cleanupmon(struct wl_listener *listener, void *data)
|
||||
LayerSurface *l, *tmp;
|
||||
size_t i;
|
||||
|
||||
@ -139,7 +139,7 @@ index ac9c36b..4a025f0 100644
|
||||
/* m->layers[i] are intentionally not unlinked */
|
||||
for (i = 0; i < LENGTH(m->layers); i++) {
|
||||
wl_list_for_each_safe(l, tmp, &m->layers[i], link)
|
||||
@@ -986,6 +1013,8 @@ createmon(struct wl_listener *listener, void *data)
|
||||
@@ -983,6 +1010,8 @@ createmon(struct wl_listener *listener, void *data)
|
||||
m = wlr_output->data = ecalloc(1, sizeof(*m));
|
||||
m->wlr_output = wlr_output;
|
||||
|
||||
@ -148,7 +148,7 @@ index ac9c36b..4a025f0 100644
|
||||
for (i = 0; i < LENGTH(m->layers); i++)
|
||||
wl_list_init(&m->layers[i]);
|
||||
|
||||
@@ -1337,6 +1366,192 @@ dirtomon(enum wlr_direction dir)
|
||||
@@ -1334,6 +1363,192 @@ dirtomon(enum wlr_direction dir)
|
||||
return selmon;
|
||||
}
|
||||
|
||||
@ -247,8 +247,8 @@ index ac9c36b..4a025f0 100644
|
||||
+ appid = focused ? client_get_appid(focused) : "";
|
||||
+
|
||||
+ zdwl_ipc_output_v2_send_layout(ipc_output->resource, monitor->lt[monitor->sellt] - layouts);
|
||||
+ zdwl_ipc_output_v2_send_title(ipc_output->resource, title ? title : broken);
|
||||
+ zdwl_ipc_output_v2_send_appid(ipc_output->resource, appid ? appid : broken);
|
||||
+ zdwl_ipc_output_v2_send_title(ipc_output->resource, title);
|
||||
+ zdwl_ipc_output_v2_send_appid(ipc_output->resource, appid);
|
||||
+ zdwl_ipc_output_v2_send_layout_symbol(ipc_output->resource, monitor->ltsymbol);
|
||||
+ if (wl_resource_get_version(ipc_output->resource) >= ZDWL_IPC_OUTPUT_V2_FULLSCREEN_SINCE_VERSION) {
|
||||
+ zdwl_ipc_output_v2_send_fullscreen(ipc_output->resource, focused ? focused->isfullscreen : 0);
|
||||
@ -341,13 +341,12 @@ index ac9c36b..4a025f0 100644
|
||||
void
|
||||
focusclient(Client *c, int lift)
|
||||
{
|
||||
@@ -2037,41 +2252,9 @@ void
|
||||
@@ -2033,38 +2248,9 @@ void
|
||||
printstatus(void)
|
||||
{
|
||||
Monitor *m = NULL;
|
||||
- Client *c;
|
||||
- uint32_t occ, urg, sel;
|
||||
- const char *appid, *title;
|
||||
|
||||
- wl_list_for_each(m, &mons, link) {
|
||||
- occ = urg = 0;
|
||||
@ -359,10 +358,8 @@ index ac9c36b..4a025f0 100644
|
||||
- urg |= c->tags;
|
||||
- }
|
||||
- if ((c = focustop(m))) {
|
||||
- title = client_get_title(c);
|
||||
- appid = client_get_appid(c);
|
||||
- printf("%s title %s\n", m->wlr_output->name, title ? title : broken);
|
||||
- printf("%s appid %s\n", m->wlr_output->name, appid ? appid : broken);
|
||||
- printf("%s title %s\n", m->wlr_output->name, client_get_title(c));
|
||||
- printf("%s appid %s\n", m->wlr_output->name, client_get_appid(c));
|
||||
- printf("%s fullscreen %d\n", m->wlr_output->name, c->isfullscreen);
|
||||
- printf("%s floating %d\n", m->wlr_output->name, c->isfloating);
|
||||
- sel = c->tags;
|
||||
@ -385,7 +382,7 @@ index ac9c36b..4a025f0 100644
|
||||
}
|
||||
|
||||
void
|
||||
@@ -2626,6 +2809,8 @@ setup(void)
|
||||
@@ -2584,6 +2770,8 @@ setup(void)
|
||||
LISTEN_STATIC(&output_mgr->events.apply, outputmgrapply);
|
||||
LISTEN_STATIC(&output_mgr->events.test, outputmgrtest);
|
||||
|
||||
@ -394,7 +391,7 @@ index ac9c36b..4a025f0 100644
|
||||
/* 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
|
||||
* compositor has Xwayland support */
|
||||
@@ -2723,6 +2908,13 @@ tile(Monitor *m)
|
||||
@@ -2681,6 +2869,13 @@ tile(Monitor *m)
|
||||
}
|
||||
}
|
||||
|
||||
@ -598,3 +595,28 @@ index 0000000..0a6e7e5
|
||||
--
|
||||
2.43.0
|
||||
|
||||
|
||||
From bdbeea524233471246a3b6174df877a60cb0939c Mon Sep 17 00:00:00 2001
|
||||
From: choc <notchoc@disroot.org>
|
||||
Date: Mon, 29 Jul 2024 21:26:06 +0800
|
||||
Subject: [PATCH 2/2] ipc: focus set_tag'd output
|
||||
|
||||
---
|
||||
dwl.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/dwl.c b/dwl.c
|
||||
index 7a4949b..1936e32 100644
|
||||
--- a/dwl.c
|
||||
+++ b/dwl.c
|
||||
@@ -1530,6 +1530,7 @@ dwl_ipc_output_set_tags(struct wl_client *client, struct wl_resource *resource,
|
||||
if (!ipc_output)
|
||||
return;
|
||||
monitor = ipc_output->mon;
|
||||
+ selmon = monitor;
|
||||
|
||||
if (!newtags || newtags == monitor->tagset[monitor->seltags])
|
||||
return;
|
||||
--
|
||||
2.43.0
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user