summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defconst.el
diff options
context:
space:
mode:
authorDaniel Colascione <dancol@dancol.org>2024-12-23 13:34:11 -0500
committerDaniel Colascione <dancol@dancol.org>2024-12-28 13:28:40 -0500
commit72eb5f8bedbe441f6a3952557b9aa3ef6fd6235d (patch)
tree42d421c1de07e411efa43904a26dcee0091df962 /test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defconst.el
parent0334b0743f83a3e69d1d3a426efbba1d2a5f2cc6 (diff)
downloademacs-72eb5f8bedbe441f6a3952557b9aa3ef6fd6235d.tar.gz
emacs-72eb5f8bedbe441f6a3952557b9aa3ef6fd6235d.tar.bz2
emacs-72eb5f8bedbe441f6a3952557b9aa3ef6fd6235d.zip
Make browser windows pop up when browsing URLs on Wayland
When a user invokes browse-url, the browser window viewing the URL should be raised in the user's desktop environment. On X11, running xdg-open as a subprocess does the job. However, on Wayland, this approach doesn't work: xdg-open makes the web browser browse a URL all right, but doesn't raise the browser window in the GUI. Therefore, if the browser window is behind Emacs, browse-url appears to do nothing. Repeated invocations of browse-url cause the browser to load multiple tabs in the background, surprising the user when he gives up in frustration and manually switches to the browser window. There's no subprocess we can run to make the right thing happen. Wayland requires that we pass along event activation information to the browser using the xdg_activation_v1 protocol. This change adds x-gtk-launch-uri to invoke GTK-native URL-dispatch machinery. This machinery DTRT on both X11 and Wayland. We fall back to the default browser machinery if we're not on a GTK frame. The logic is more complicated than it has to be because the GTK URI launch mechanism requires that we launch with respect to a specific GTK window, and in some environments (e.g., running emacs -nw in a PGTK Emacs) we don't have a GTK window. We also want to preserve the effect of customizing browse-url-browser-function, so adding an entry to browse-url-default-handlers that preempts URI open when we happen to be on a GTK frame is the wrong thing to do. * lisp/net/browse-url.el (browse-url--browser-defcustom-type): (browse-url--inhibit-pgtk): avoid infinite recursion (browse-url-default-browser): use pgtk launch (x-gtk-launch-uri): new function (browse-url-default-gtk-browser): ues it * src/pgtkfns.c (unwind_gerror_ptr): new function (Fx_gtk_launch_uri): new function (syms_of_pgtkfns): register it * etc/NEWS: mention the new feature
Diffstat (limited to 'test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-defconst.el')
0 files changed, 0 insertions, 0 deletions