Why does Okular change my Cinnamon key bindings?

I’m using Ubuntu 24.04.4 LTS with Cinnamon 6.0.4.

I’ve configured Ctrl-Alt-T to open a new terminal (xfce4-terminal) and PrtScrn to open gnome-screenshot.

When starting Okular to open a PDF the key bindings change (temporarily): Ctrl-Alt-T opens Konsole, PrtScrn opens Spectacle. Why?

When starting Okular without (!) opening a PDF the key bindings don’t change.

When key bindings have changed and I restart Cinnamon (wether by logging in/out or by restarting it from the taskbar’s context menu), my intended key bindings are back again.

well… ubuntu comes with gnome, and while cinnamon is also GTK based, okular is Qt based belonging to the KDE plasma desktop.

so you have quite a mix going on there… you should expect some weirdness.

the only advice i can offer is that i use this command to list what files were changed in the last minute to help ferret out what is going on.

find -not  \( -path './snap' -prune \) -not \( -path './.cache'  -prune \) -type f -mmin -1  -printf "%C+ %p\n" | sort -n | tail -10

I’ve never seen this weirdness in two decades running this mix of a gnome-based desktop environment and some additional kde/qt-based software. That’s why I’m curious about it.

The only changed files your nice find command lists are these two

~/.local/share/kactivitymanagerd/resources/database-shm
~/.config/okularrc

My guess is that Okular (or a used lib) changes something within the shared memory. If I restart Cinnamon the original settings are back. Fun fact: If I start Okular (btw: 23.08.5) the second time after having restarted Cinnamon then Okular won’t change the key bindings again. This is somewhat weird, too. :smiley:

Mystery half solved: Okular (and other KDE Plasma programs like Kate, Konversation or Krunner) start /usr/bin/kglobalaccel5.

Solution: Restart Cinnamon or killall -HUP kglobalaccel5 (attention: kills all children, too)

A final note on this: In my opinion it is a bad design that an application changes the system’s global key bindings. That should be the job of the desktop environment but not of an individual application. No KDE/QT application but the Plasma desktop should start /usr/bin/kglobalaccel5.

So it only happens when opening a PDF, not just starting Okular? Might mean Okular’s pulling in some KDE config when it actually has to render something. That would explain the kactivitymanagerd changes.

So it only happens when opening a PDF, not just starting Okular?

Yes, see initial post.

Looks like you’re running into the following bug: https://bugs.kde.org/show_bug.cgi?id=435420

Based on the lack of any recent activity, I’d guess it was somehow addressed in the foundational transitions that were part of the KDE MegaRelease 6 a couple years back.

Ubuntu 24.04 will forever be stuck on Plasma/Frameworks 5 and those old versions of KDE Gear, though - so if this is in fact fixed in the newer versions, a fix landing in Ubuntu 24.04 would require someone at the distribution level to develop/backport a patch to the old versions of KDE software that they are still distributing.

Thanks for this interesting link. :+1: Now being aware of what’s going on I know how to deal with it. May be an upgrade to 26.04 will heal it, may be not, we’ll see…