Editing .desktop to solve wacom cursor offset problem


in libreoffice, the actual position of my wacom cursor is offset from the visual cursor, so I wanted to apply the solution from Wacom Pen clicks not working in some applications.
It works starting libreoffice from the terminal like

But If I modify the .dektop file to make the solution permanent
sudo nano ~/.local/share/applications/libreoffice-writer.desktop
and prepend env (source: https://wiki.archlinux.org/index.php/Desktop_entries) to both open and newfile entries:
Exec=env QT_XCB_TABLET_LEGACY_COORDINATES=1 libreoffice --writer %U
Exec=env QT_XCB_TABLET_LEGACY_COORDINATES=1 libreoffice --writer
the offset problem still persists.

What am I doing wrong?
Any better solution to apply this fix to all affected applications than editing each desktop file?

BTW: Is libreoffice a QT application at all? Editing /etc/profile.d/libreoffice-still.sh like https://wiki.archlinux.org/index.php/LibreOffice#Theme suggested did not seem to help (at least without restart).

1 Like

Whoa, this!!! I've been struggling with virtualbox and VLC for ages as they seem to register the click coordinates totally wrong (I'm using my tablet as a mouse). I was suspecting it might have something to do with QT, but had no idea where to start debugging. You have made my day!

Edit: Actually your syntax is correct.

Exec=env QT_XCB_TABLET_LEGACY_COORDINATES=1 /usr/bin/vlc --started-from-file %U

I confirm this works with virtualbox and VLC so the problem might be with libreoffice itself?

You could try wrapping the command in a script file:

exec libreoffice --writer

and launch this script in the .desktop file... it's a workaround, maybe it would work for you.

Never use sudo to edit files inside your home directory!
The file you want to use is:

cp /usr/lib/libreoffice/share/xdg/writer.desktop ~/.local/share/applications/writer.desktop

then edit it
kate ~/.local/share/applications/writer.desktop
and replace the last line with
Exec=QT_XCB_TABLET_LEGACY_COORDINATES=1 libreoffice --writer

but that will create 2 entries of Libre Writer in the Menu; to avoid that is better to either:

  • add export QT_XCB_TABLET_LEGACY_COORDINATES=1 to ~/.profile (this will only help for vlc)
  • add export QT_XCB_TABLET_LEGACY_COORDINATES=1 to /etc/profile.d/libreoffice-fresh.sh for LibreOffice (so each will work with no need to edit the shortcut) a restart of the session is required.

Create that sort of *.sh file for each application you want to start with that option... For example /etc/profile.d/virtualbox.sh

But the best is to add it to ~/.bash_profile as export QT_XCB_TABLET_LEGACY_COORDINATES=1 logout and back in and all applications will now use properly the Stylus :wink:



Thanks a lot!

Could you explain this, please?

This would be the best fix-all solution, but it doesn't work for me. At least not with VLC
But anyway there's so many good solutions in your reply already. Thank you.

That's weird. It solved all my issues, in libreoffice and vlc 3.0.8-6 (from the extra repo).

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by