[hackers] [surf][PATCH] Add support for wayland based compositors.

From: hazardchem <pthom44_AT_live.com.au>
Date: Tue, 4 Apr 2023 18:07:18 +1000

This doesn't fix sending a URL via dmenu in config.def.h as that will need
different methods depending on the compositor.

This could be a patch or an improvement.

Sourced from:

https://github.com/Michasze/surf-wayland
Signed-off-by: hazardchem <pthom44_AT_live.com.au>
---
 surf.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/surf.c b/surf.c
index 001f776..dec8dd2 100644
--- a/surf.c
+++ b/surf.c
_AT_@ -614,10 +614,13 @@ geturi(Client *c)
 void
 setatom(Client *c, int a, const char *v)
 {
+  if (GDK_IS_X11_DISPLAY (dpy))
+	{
 	XChangeProperty(dpy, c->xid,
 	                atoms[a], atoms[AtomUTF8], 8, PropModeReplace,
 	                (unsigned char *)v, strlen(v) + 1);
 	XSync(dpy, False);
+	}
 }
 
 const char *
_AT_@ -1400,7 +1403,12 @@ showview(WebKitWebView *v, Client *c)
 	gtk_widget_grab_focus(GTK_WIDGET(c->view));
 
 	gwin = gtk_widget_get_window(GTK_WIDGET(c->win));
+	 #ifdef GTK_WINDOWING_X11
+	 if (GTK_IS_X11_DISPLAY (dpy))
+	 {
 	c->xid = gdk_x11_window_get_xid(gwin);
+	}
+	#endif
 	updatewinid(c);
 	if (showxid) {
 		gdk_display_sync(gtk_widget_get_display(c->win));
-- 
2.40.0
Received on Tue Apr 04 2023 - 10:07:18 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 04 2023 - 20:24:36 CEST