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 <[email protected]> [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 <[email protected]> --- 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 @@ -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 * @@ -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
signature.asc
Description: PGP signature
