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

From: Jochen Sprickerhof <suckless_AT_jochen.sprickerhof.de>
Date: Tue, 4 Apr 2023 23:48:49 +0200

I've pushed a similar/more complete patch using dmenu-wl[1] here:

https://gitlab.com/jspricke/surf/-/commit/3787ac989303a316ad08cb4c1a26fc5258ce7926

[1] https://github.com/nyyManni/dmenu-wayland

Cheers Jochen

* hazardchem <pthom44_AT_live.com.au> [2023-04-04 18:07]:
>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 - 23:48:49 CEST

This archive was generated by hypermail 2.3.0 : Wed Apr 05 2023 - 00:48:36 CEST