~sircmpwn/visurf-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH v2] nsvi: request server-side decorations

Details
Message ID
<20211105105413.18221-1-umar@handlerug.me>
DKIM signature
pass
Download raw message
Patch: +26 -1
visurf doesn't have CSD, so the code just calls set_mode without setting
up a listener. This fixes occasionally disappearing SSD in sway.
---

Oops, indeed, forgot to check for NULL. Fixed in this revision, sorry.

 frontends/visurf/Makefile | 11 ++++++++++-
 frontends/visurf/main.c   |  4 ++++
 frontends/visurf/visurf.h |  2 ++
 frontends/visurf/window.c |  9 +++++++++
 frontends/visurf/window.h |  1 +
 5 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/frontends/visurf/Makefile b/frontends/visurf/Makefile
index 7eda515c9..3695b96e9 100644
--- a/frontends/visurf/Makefile
+++ b/frontends/visurf/Makefile
@@ -35,7 +35,16 @@ $(OBJROOT)/xdg-shell.c: $(XDG_SHELL_PROTOCOL) $(OBJROOT)/xdg-shell.h
$(OBJROOT)/xdg-shell.h: $(XDG_SHELL_PROTOCOL)
	$(WAYLAND_SCANNER) client-header $< $@

S_WAYLAND := $(OBJROOT)/xdg-shell.c
XDG_DECORATION_PROTOCOL := \
	$(WAYLAND_PROTOCOLS)/unstable/xdg-decoration/xdg-decoration-unstable-v1.xml

$(OBJROOT)/xdg-decoration.c: $(XDG_DECORATION_PROTOCOL) $(OBJROOT)/xdg-decoration.h
	$(WAYLAND_SCANNER) private-code $(XDG_DECORATION_PROTOCOL) $@

$(OBJROOT)/xdg-decoration.h: $(XDG_DECORATION_PROTOCOL)
	$(WAYLAND_SCANNER) client-header $< $@

S_WAYLAND := $(OBJROOT)/xdg-shell.c $(OBJROOT)/xdg-decoration.c

S_FRONTEND := main.c bitmap.c commands.c fetch.c getopt.c keybindings.c \
		layout.c pool-buffer.c plotters.c window.c
diff --git a/frontends/visurf/main.c b/frontends/visurf/main.c
index be7841b2e..9ad1c54b6 100644
--- a/frontends/visurf/main.c
+++ b/frontends/visurf/main.c
@@ -42,6 +42,7 @@
#include "visurf/visurf.h"
#include "visurf/window.h"
#include "xdg-shell.h"
#include "xdg-decoration.h"

char **respaths;
struct nsvi_state *global_state;
@@ -779,6 +780,9 @@ registry_global(void *data, struct wl_registry *wl_registry,
				name, &xdg_wm_base_interface, 1);
		xdg_wm_base_add_listener(state->xdg_wm_base,
				&xdg_wm_base_listener, state);
	} else if (strcmp(interface, zxdg_decoration_manager_v1_interface.name) == 0) {
		state->xdg_decoration_manager = wl_registry_bind(wl_registry,
				name, &zxdg_decoration_manager_v1_interface, 1);
	} else if (strcmp(interface, wl_seat_interface.name) == 0) {
		state->wl_seat = wl_registry_bind(wl_registry,
				name, &wl_seat_interface, 7);
diff --git a/frontends/visurf/visurf.h b/frontends/visurf/visurf.h
index e799a811e..921cb5cb3 100644
--- a/frontends/visurf/visurf.h
+++ b/frontends/visurf/visurf.h
@@ -7,6 +7,7 @@
#include <xkbcommon/xkbcommon.h>
#include "visurf/keybindings.h"
#include "xdg-shell.h"
#include "xdg-decoration.h"
#include "utils/nsurl.h"

enum pointer_event_mask {
@@ -88,6 +89,7 @@ struct nsvi_state {
	struct wl_shm *wl_shm;
	struct wl_compositor *wl_compositor;
	struct xdg_wm_base *xdg_wm_base;
	struct zxdg_decoration_manager_v1 *xdg_decoration_manager;
	struct nsvi_output *outputs;

	struct nsvi_window *windows;
diff --git a/frontends/visurf/window.c b/frontends/visurf/window.c
index d811d0f9d..185992a4f 100644
--- a/frontends/visurf/window.c
+++ b/frontends/visurf/window.c
@@ -24,6 +24,7 @@
#include "visurf/visurf.h"
#include "visurf/window.h"
#include "xdg-shell.h"
#include "xdg-decoration.h"

struct pool_buffer *activebuffer;

@@ -677,6 +678,14 @@ nsvi_window_create(void)
		&xdg_toplevel_listener, win);
	xdg_toplevel_set_title(win->xdg_toplevel, "visurf");
	xdg_toplevel_set_app_id(win->xdg_toplevel, "visurf");
	if (global_state->xdg_decoration_manager != NULL) {
		win->xdg_toplevel_decoration =
			zxdg_decoration_manager_v1_get_toplevel_decoration(
					global_state->xdg_decoration_manager,
					win->xdg_toplevel);
		zxdg_toplevel_decoration_v1_set_mode(win->xdg_toplevel_decoration,
			ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE);
	}
	wl_surface_commit(win->wl_surface);
	return win;
}
diff --git a/frontends/visurf/window.h b/frontends/visurf/window.h
index ccdc366b0..11fb63dc8 100644
--- a/frontends/visurf/window.h
+++ b/frontends/visurf/window.h
@@ -65,6 +65,7 @@ struct nsvi_window {
	struct wl_surface *wl_surface;
	struct xdg_surface *xdg_surface;
	struct xdg_toplevel *xdg_toplevel;
	struct zxdg_toplevel_decoration_v1 *xdg_toplevel_decoration;
	struct pool_buffer buffers[2];

	struct gui_window **tabs;
-- 
2.33.0
Details
Message ID
<CFHT2VXR80R6.NG5XQP2F13KQ@taiga>
In-Reply-To
<20211105105413.18221-1-umar@handlerug.me> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
Thanks!

To git@git.sr.ht:~sircmpwn/visurf
   11a88e1f8..edae26b5a  master -> master
Reply to thread Export thread (mbox)