sublime_text icon indicating copy to clipboard operation
sublime_text copied to clipboard

[linux/wayland] Opening file in Sublime doesn't activate/focus existing Sublime window

Open ronjouch opened this issue 1 year ago • 4 comments

Description of the bug

When I open a file with ST under Wayland, regardless of the origin app where I initiate the open (file browser, terminal, etc),

  1. The file successfully opens ...
  2. ... but ST doesn't "activate". It stays unfocused, in the back. This is super annoying, as you expect to be able to type after ST opens your file 😕.

Screencast:

linux-wayland_sublime-fails-to-activate-window.webm

Steps to reproduce

  1. Start ST in safe mode
  2. Open a file with ST. For example:
    • Click a .txt file in Nautilus
    • subl file.txt in a terminal (with --safe-mode added if running in safe mode, of course)

Expected behavior

In ST under Xorg, the ST window correctly "activates". It is focused, it is brought to the front, I can immediately type in it.

Actual behavior

In ST under Wayland, the ST window doesn't "activate". It is not focused, it is not brought to the front, I cannot immediately type in it (if I type, my keypresses are received by the app I was in before opening the file, e.g. Nautilus or my terminal).

Sublime Text build number

4168 (dev channel)

Operating system & version

Arch Linux, up-to-date as of 2023-12-17

(Linux) Desktop environment and/or window manager

GNOME Shell 45.2, Wayland 1.22.0

Additional information

This might be a duplicate of https://github.com/sublimehq/sublime_text/issues/5374 , but this bug is A. overly specific (my bug here exhibits a failure case not involving workspaces), and B. by a user no longer on GitHub. So, for clarity I preferred creating a new, clearer task, whose title & description I can clarify at will.

OpenGL context information

N/A, not OpenGL-related.

ronjouch avatar Dec 17 '23 20:12 ronjouch

Blergh; not ST-specific.

I thought I had tested other apps, but I actually hadn't tested them in the same case of an already-running app being called to open a file.

Closing, looking if this is a general GNOME or Wayland problem.

EDIT a misconfiguration of mine, not specific to Sublime. See Arch Linux forums / [wayland/gnome] Opening file in already-running app fails to focus

ronjouch avatar Dec 17 '23 21:12 ronjouch

Can this be reopened? As I have a the same issue...

KDE Neon on Wayland, with Plasma 6. https://bugs.kde.org/show_bug.cgi?id=482999

It revolves around proper implementation of xdg_activation_v1 Wayland protocol

matijakovacevic avatar Mar 13 '24 08:03 matijakovacevic

@BenjaminSchaaf I thought that the issue here lied with GNOME/Wayland, but according to the above comment and KDE bug, Sublime Text actually lacks implementation of Wayland protocol xdg_activation_v1, which feels confirmed by the fact that I couldn’t find a mention of it in ST / dev changelog. Correct?

Hope you can look into it. Thanks for Sublime.

ronjouch avatar Mar 13 '24 09:03 ronjouch

Firstly, that's not how our changelog works. We use GTK3 which does implement the xdg_activation_v1 interface, but likely in a way that gets blocked by wayland security measures.

BenjaminSchaaf avatar Mar 13 '24 11:03 BenjaminSchaaf