Fixes #3531 at least on KDE Plasma (tested when opening files from Nautilus). 
On GNOME / Ubuntu there is not change, but things also do not work for Gedit, 
so that might be an issue on their side.

This works by looking for the `DESKTOP_STARTUP_ID` environment variable when 
Geany is started. Normally, this is consumed by GTK automatically to use the 
proper protocols ([Startup 
notification](https://specifications.freedesktop.org/startup-notification-spec/latest/
) or [xdg-activation](https://wayland.app/protocols/xdg-activation-v1
) on X11 and Wayland respectively). However, when activating an already running 
Geany instance, this needs to be passed onto it and supplied to GTK there.

This is done by adding a new message to the socket communication for this 
purpose. This is always parsed, but only has an effect if Geany is running on 
X11 or Wayland.

Tested (on Ubuntu 24.04):
 - KDE Plasma (kwin 5.27.11): Geany can focus itself with this patch (opening 
files from Nautilus)
 - GNOME (mutter 46.2): no change (but Gedit also does not work)
 - Wayfire: always works, does not care about having a valid activation token
 
Not tested on X11, could potentially improve behavior there as well on WMs that 
are especially strict with focus stealing prevention.






You can view, comment on, or merge this pull request online at:

  https://github.com/geany/geany/pull/4071

-- Commit Summary --

  * socket: support startup_id tokens on X11 and Wayland
  * socket: add GTK version check for setting startup notification ID

-- File Changes --

    M src/libmain.c (6)
    M src/socket.c (34)
    M src/socket.h (2)

-- Patch Links --

https://github.com/geany/geany/pull/4071.patch
https://github.com/geany/geany/pull/4071.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/4071
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/pull/[email protected]>

Reply via email to