Obsidian violates universal UI conventions regarding hover/focus [Linux]

The usual UI/UX convention is that a program shows a blinking cursor only when it has focus, so that if the user types something they can visually know which window the keystrokes are going to.

Thus, When a window loses focus, the expectation is that a blinking cursor disappears. Except for ancient X-windows systems (in which focus-follows mouse), giving focus to a window requires a click on it.
Confusingly, Obsidian shows a blinking cursor even if the window doesn’t have focus, when the user’s cursor hovers over the Obsidian.

The unfortunate result is that the user sometimes sees the blinking cursor in obsidian and innocently starts typing, while their keystrokes get sent to another window and wreck havoc there (triggering esoteric shortcuts, closing windows, entering weird modes), until the user figures out what’s going on and then has to undo the damage.

This happens to me several times a day, and it’s infuriating.

Classic scenario: taking notes while watching a lecture on Youtube. Browser on the left, obsidian on the right. I switch the video to full-screen, and leave FS mode only when I want to write some notes in obsidian. When I exit full-screen, the browser still has focus but, if my mouse happens to be on top of the obsidian window, Obsidian shows me a blinking cursor as if it has focus and I just start typing. Depending on what keystrokes I enter until I realize my error, I may close browser tabs or do other damage by accident. Then I have to waste time undoing the damage, reloading the video, finding the seek time I was at, by which point I’ve lost my train of thought and can’t remember what I intended to write. It is maddening.

Please fix this.

I’m using Sway/wlroots/wayland.

I see the expected behavior on Mac (cursor disappears when I click on a different app), so the problem may be platform-specific.

I tested under Linux/KDE and It works Okay.

Interesting. I’m using the official Appimage on linux. Could it be a sway thing?

But this behavior definitely doesn’t happen with chromium (or anything else I use) in sway, and obsidian is electron-based, right? So It seems like it’s obsidian that’s doing something unusual, not that it’s a bug in sway.

output
Here’s a grab showing the issue:

  1. the title bar at top of window shows focus (red=focused).
  2. moving cursor over obsidian triggers a blinking cursor, even when obsidian doesn’t have focus.
  3. typing while obsidian shows a blinking cursor sends keystrokes to the focused VIM window, even though obsidian is visually signalling that it is “ready” for input.

On linux, we only test/against support KDE and GNOME. It usually works in other DE and if it doesn’t, it’s probably problem of the desktop environment not ours.

I am sorry, but we are not going to look into this. I am going to leave this conversation open in the help section, perhaps somebody can point you in the right direction.

Sorry to hear that. But you get to choose your support matrix so I guess that’s that.

For the record:

  1. chromium doesn’t have this issue.
  2. VScode (also electron) doesn’t have this issue
  3. I haven’t had this issue with other electron-based software I’ve used in the past.

Perhaps it’s a DE issue after all, but It doesn’t seem like it.

This is a long shot, but I wonder if changing Settings > Appearance > Window Frame Style would make a difference.

Wayland here, and I don’t see the problem

Thank you both.

@CawlinTeffid , I tried it but no change.
@cristian, can you say which specific compositor you’re using (sway/wlroots-based/other)?
both KDE/GNOME run on wayland by default on major distros, so we know wayland itself is probably not the issue.

Just wanted to add that I see the expected behavior on my end: the cursor disappears when the window is not in focus. I run the latest version of Pop_Os.

Perhaps it is a sway issue after all, and Obsidian is just the first reliable repro I’ve found so far. I have seen other types of weirdness, rarely and unreliably, and I didn’t make the connection until now.

Thanks for all the help, I’ll try to figure out a bug report for sway upstream.

Update:
For the 1.3 people who will experiences similar in the future and end up here:

  1. I could not reproduce on another laptop using the exact same setup.
  2. This behavior disappeared after a reboot (with new kernel version, but I think that’s not related).

The only possible explanations I can think of are either:

  1. rare memory corruption /hardware glitch.
  2. OOM-killer kicked in over many days of uptime, and killed something it shouldn’t, which put the system in a weird state.

Both are very difficult to reproduce reliably.
The Sway issue I opened on github got no response from maintainers.

And it’s definitely not an issue with obsidian, as the developers rightly insisted. My bad.

2 Likes