kando-menu / kando

🥧 The Cross-Platform Pie Menu.
https://ko-fi.com/post/Kando-1-0-0-released-G2G5Z1DOS
Other
1.22k stars 28 forks source link

Kando menu rarely opens in KDE Wayland 5.27, and Keyboard remote portal does not work (it's fine in X11) #313

Closed nor2101 closed 5 months ago

nor2101 commented 5 months ago

OS: Fedora 39 KDE Spin KDE Version: 5.27.10 Kando version: 0.4.0 (also tested 0.3.0)

Hello, thanks for your awesome work on this project.

I've been using Kando since version 0.3.0 in KDE Plasma X11 and it works amazingly well.

Unfortunately under Plasma Wayland it has a couple of issues for me:

I tried to use the "kando --menu "Prototype Menu"" command to open it, but it works reliably only if I run it in an open terminal window; if I try to run it as an application shortcut command (or if I put it in a shell script file and try to run it without a terminal open) it exhibits the same erratic behaviour as right-clicking on the icon.

It seems to open more reliably when a window is open on the desktop.

The current workaround I use in Wayland is to run the Kando command in a shell script from a desktop shortcut with the option "Terminal=true". This way I have a terminal window appearing briefly before the menu, but it opens every time.

If you need any log or other kinds of debug output I will be happy to provide them.

Thanks!

Schneegans commented 5 months ago

Hey thanks for the detailed report! I'll try to test this as soon as possible, but I think that I do not have a working KDE VM currently. So it may take some time.

Until then, you could try running Kando in a terminal and check for any error messages. Have you tried this already?

I think that it's very dubious that the tray icon does not work properly. There is not much code which could create a problem there. The only thing I can think of is the communication with the KWin script to get the information on the currently active window.... I suspect this method to not properly return for whatever reason.

If you have some time and JavaScript experience, you could also try to check what's going on there :wink:

nor2101 commented 5 months ago

Hi, thanks for your answer.

I've tried to run it from the terminal, this is the output of me opening the menu from the taskbar and hovering a bit:

Running on Linux (KDE on wayland).
Loading settings from /home/norman/.config/Kando/config.json
Loading settings from /home/norman/.config/Kando/menus.json
Gtk-Message: 19:06:13.265: Failed to load module "appmenu-gtk-module"
src/gbm_drv_common.c:57: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 538982482

src/gbm_drv_common.c:57: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 943215175

src/gbm_drv_common.c:57: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 842094158

src/gbm_drv_common.c:57: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 842094169

src/gbm_drv_common.c:57: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 808530000

src/gbm_drv_common.c:57: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 538982482

src/gbm_drv_common.c:57: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 943215175

src/gbm_drv_common.c:57: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 842094158

src/gbm_drv_common.c:57: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 842094169

src/gbm_drv_common.c:57: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 808530000

src/gbm_drv_common.c:57: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 538982482

src/gbm_drv_common.c:57: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 943215175

src/gbm_drv_common.c:57: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 842094158

src/gbm_drv_common.c:57: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 842094169

src/gbm_drv_common.c:57: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 808530000

src/gbm_drv_common.c:57: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 538982482

src/gbm_drv_common.c:57: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 943215175

src/gbm_drv_common.c:57: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 842094158

src/gbm_drv_common.c:57: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 842094169

src/gbm_drv_common.c:57: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 808530000

src/gbm_drv_common.c:57: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 538982482

src/gbm_drv_common.c:57: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 943215175

src/gbm_drv_common.c:57: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 842094158

src/gbm_drv_common.c:57: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 842094169

src/gbm_drv_common.c:57: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 808530000

Successfully loaded Kando's renderer process.
Kando 0.4.0 is ready.
Press <Ctrl>+<Space> to open the prototype menu!
Currently focused: org.kde.plasmashell (Desktop @ QRect(0,0 2560x1440) — Plasma)
Hover item: /

(kando:4179): LIBDBUSMENU-GLIB-WARNING **: 19:06:32.184: About to Show called on an item wihtout submenus.  We're ignoring it.

(kando:4179): LIBDBUSMENU-GLIB-WARNING **: 19:06:32.188: About to Show called on an item wihtout submenus.  We're ignoring it.

(kando:4179): LIBDBUSMENU-GLIB-WARNING **: 19:06:32.244: About to Show called on an item wihtout submenus.  We're ignoring it.
Hover item: /8
Hover item: /7
Hover item: /6

(kando:4179): LIBDBUSMENU-GLIB-WARNING **: 19:06:34.089: About to Show called on an item wihtout submenus.  We're ignoring it.
Hover item: /
Hover item: /
Hover item: /6
Hover item: /5
Hover item: /
Hover item: /6
Cancel selection.
Warning: /usr/lib/libvulkan_broadcom.so: classe ELF errata: ELFCLASS32
Warning: loader_icd_scan: Failed loading library associated with ICD JSON /usr/lib/libvulkan_broadcom.so. Ignoring this JSON
Warning: /usr/lib/libvulkan_freedreno.so: classe ELF errata: ELFCLASS32
Warning: loader_icd_scan: Failed loading library associated with ICD JSON /usr/lib/libvulkan_freedreno.so. Ignoring this JSON
Warning: /usr/lib/libvulkan_intel_hasvk.so: classe ELF errata: ELFCLASS32
Warning: loader_icd_scan: Failed loading library associated with ICD JSON /usr/lib/libvulkan_intel_hasvk.so. Ignoring this JSON
Warning: /usr/lib/libvulkan_intel.so: classe ELF errata: ELFCLASS32
Warning: loader_icd_scan: Failed loading library associated with ICD JSON /usr/lib/libvulkan_intel.so. Ignoring this JSON
Warning: /usr/lib/libvulkan_lvp.so: classe ELF errata: ELFCLASS32
Warning: loader_icd_scan: Failed loading library associated with ICD JSON /usr/lib/libvulkan_lvp.so. Ignoring this JSON
Warning: /usr/lib/libvulkan_panfrost.so: classe ELF errata: ELFCLASS32
Warning: loader_icd_scan: Failed loading library associated with ICD JSON /usr/lib/libvulkan_panfrost.so. Ignoring this JSON
Warning: /usr/lib/libvulkan_radeon.so: classe ELF errata: ELFCLASS32
Warning: loader_icd_scan: Failed loading library associated with ICD JSON /usr/lib/libvulkan_radeon.so. Ignoring this JSON
Currently focused: org.kde.konsole (~ : kando — Konsole)
Hover item: /
Hover item: /7
Hover item: /6
Hover item: /5
Hover item: /4
Hover item: /
Select item: /4

Oddly enogh, the "not opening from taskbar" behaviour (related to the method you mentioned I assume) is not present when running with the terminal window open, BUT if I minimize all open windows including the terminal, this is the output:

(node:4179) UnhandledPromiseRejectionWarning: DBusError: No such object path '/2'
    at t.flags.f._methodReturnHandlers.<computed> (/usr/lib/kando/resources/app/.webpack/main/index.js:2:146392)
    at e (/usr/lib/kando/resources/app/.webpack/main/index.js:2:144013)
    at EventEmitter.<anonymous> (/usr/lib/kando/resources/app/.webpack/main/index.js:2:144653)
    at EventEmitter.emit (node:events:517:28)
    at /usr/lib/kando/resources/app/.webpack/main/index.js:2:154634
    at Socket.<anonymous> (/usr/lib/kando/resources/app/.webpack/main/index.js:2:172153)
    at Socket.emit (node:events:517:28)
    at emitReadable_ (node:internal/streams/readable:601:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:81:21)
(Use `kando --trace-warnings ...` to show where the warning was created)
(node:4179) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
Failed to show menu: Did not receive an answer by the Kando KWin script.

As far as "opening Kando with the keyboard shortcut not working", sadly there is no terminal output of that, it simply does not work (I assume it is an issue related to Wayland desktop portals, despite me giving authorization to read the keyboard Kando might be still blocked by the permission system...).

Schneegans commented 5 months ago

Thanks again for the detailed report! I just set up a KDE again and did some testing. The global shortcuts were a regression and should be fixed now in the fix/#313 branch.

However, I cannot reproduce the not-working-if-no-window issue. Nevertheless, I have a suspicion what could be the reason and if that guess is right, this should also be fixed. Would it be possible for you to test Kando from the fix/#313 branch? If you need some help for this, I could provide a step-by-step guide.

nor2101 commented 5 months ago

Hello,

I tried compiling and running the branch (git status output afer git checkout fix/#313):

Sul branch fix/#313
non c'è nulla di cui eseguire il commit, l'albero di lavoro è pulito

And then I compiled with npm install and npm start.

Unfortunately I have the same results as before, same error when no window is open:

(node:30223) UnhandledPromiseRejectionWarning: DBusError: No such object path '/2'
    at _methodReturnHandlers.<computed> (/home/norman/Scaricati/kando/.webpack/main/index.js:15473:27)
    at handleMessage (/home/norman/Scaricati/kando/.webpack/main/index.js:15227:11)
    at EventEmitter.<anonymous> (/home/norman/Scaricati/kando/.webpack/main/index.js:15277:9)
    at EventEmitter.emit (node:events:517:28)
    at /home/norman/Scaricati/kando/.webpack/main/index.js:16247:14
    at Socket.<anonymous> (/home/norman/Scaricati/kando/.webpack/main/index.js:17937:9)
    at Socket.emit (node:events:517:28)
    at emitReadable_ (node:internal/streams/readable:601:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:81:21)
(Use `electron --trace-warnings ...` to show where the warning was created)
(node:30223) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
Failed to show menu: Did not receive an answer by the Kando KWin script.

I tried the following:

but unfortunately no changes.

Keyboard shortcut is also still ignored.

If there's anything else I can try I'll do it.

Schneegans commented 5 months ago

Well, that's weird. Could you please try opening the System Settings and navigate to Shortcuts -> KWin and search for "Kando"? It could be that there are multiple shortcuts registered (as the name of the trigger changed over the prototype versions). The most recent one should be prefixed with "Kando -". Could make sure that your hotkey is assigned to that one?

Regarding the UnhandledPromiseRejectionWarning: Could you please open a terminal and run journalctl -f and then reproduce the issue? I would hope that there is some more helpful error is printed by the KWin script...

nor2101 commented 5 months ago

Well, that's weird. Could you please try opening the System Settings and navigate to Shortcuts -> KWin and search for "Kando"? It could be that there are multiple shortcuts registered (as the name of the trigger changed over the prototype versions). The most recent one should be prefixed with "Kando -". Could make sure that your hotkey is assigned to that one?

Regarding the UnhandledPromiseRejectionWarning: Could you please open a terminal and run journalctl -f and then reproduce the issue? I would hope that there is some more helpful error is printed by the KWin script...

You know what's weird?

I JUST updated Fedora today to kernel 6.6.11-200.fc39.x86_64, and the problems are GONE.

Keyboard shortcut works (I'm testing branch fix/#313) and no more UnhandledPromiseRejectionWarning.

It's a shame I didn't test with journalctl before updating.

It's good that everything works now though

nor2101 commented 5 months ago

I can confirm though that both problems are still present in Release 0.4.1, even now.

So either I'm really dumb and somehow I compiled master instead of branch fix/#313, or something else happened.

I'm switching back and forth from branch fix to release 0.4.1 and yeah, branch fix seems to really fix everything

EDIT: Just for curiosity and reference, this is the error that journalctl spits out with release 0.4.1 and older:

gen 16 19:17:54 normpc kwin_wayland[13409]: kwin_scripting: /tmp/kando/get-info.js:1: error: Cannot read property 'caption' of null

Schneegans commented 5 months ago

Ok, cool! Thanks again for the very detailed report! Let me know if you find any other issues :wink: