Skip to content

Fix current desktop check on Wayland

Nicolas Fella requested to merge work/nico/fix-vd-check-wayland into master

On non-X11 platforms Kate doesn't know which virtual desktop it is on.

On Wayland KWindowSystem always gives 0 for the current desktop as well as the desktop the window is on

ce5aa0b3 changed the code to always use 1 as current desktop, so we end up comparing 1 and 0, which makes us think Kate isn't on the current desktop and causes a new Kate to be started when it should attach to an existing one.

To make matters even more confusing, on Windows, where VDs aren't supported either, KWindowSystem always gives 1 as desktop.

Consistently use 0 as desktop on non-X11 platforms, and, for clarity, isolate the actual desktop check to X11

Edited by Nicolas Fella

Merge request reports