elkowar / eww

ElKowars wacky widgets
https://elkowar.github.io/eww
MIT License
9.3k stars 382 forks source link

[BUG] focusable windows on wayland have exclusive focus #651

Open dangerousdan opened 1 year ago

dangerousdan commented 1 year ago

Checklist before submitting an issue

Description of the bug

On wayland, windows with :focusable true cause the window to have exclusive keyboard focus. This renders any :focusable window unusable.

This seems to be caused by GTK keyboard mode not being set properly.

Reproducing the issue

eww 0.4.0 678e4dbc6b6439bf50898ae2b13fcc65900c439c

(defwindow example
    :focusable true
    (label :text "I cant type in any windows behind this")
)

Expected behaviour

Use GTK_LAYER_SHELL_KEYBOARD_MODE_ON_DEMAND by default.

Additional context

No response

mewoocat commented 1 year ago

I'm having this same issue. Did you find a workaround?

N0tAI commented 1 year ago

I came across this last night and found that if you specify that setting the stacking property to bg fixed this to only initially grab focus but allowed you to then focus on other apps (in my case this was also stealing all mouse input on the monitor).

eg

(defwindow example
    :focusable true
    :stacking "bg"
    (label :text "You should be able to type to other windows once you focus on them.")
)
killmlana commented 1 year ago

I came across this last night and found that if you specify that setting the stacking property to bg fixed this to only initially grab focus but allowed you to then focus on other apps (in my case this was also stealing all mouse input on the monitor).

eg

(defwindow example
    :focusable true
    :stacking "bg"
    (label :text "You should be able to type to other windows once you focus on them.")
)

It works but the eww window doesn't overlay the other windows even when it has gained focus

GaspardCulis commented 8 months ago

Having the same issue, when setting :focusable to true the widget gets exclusive focus and I can't type in other windows.

Noticed the function gtk_layer_shell::set_keyboard_interactivity called in src/display_backend.rs:66 is deprecated since gtk_layer_shell v0.6, which might be causing the issue ?

Dr-42 commented 3 months ago

I am having the same issue. I am trying to create a notification daemon with support for inline replies and hence can't use the "bg" hack since notifs need to be displayed on top of everything. So, Currently, in my testing, I can either not type anything, or I have to forsake my keyboard for the duration of the display of the notification.

djmaze commented 1 month ago

Anyone have a solution to this problem? With this behaviour, it seems eww is not a viable waybar alternative on Wayland.

djmaze commented 1 month ago

Turns out this problem does not occur on the latest master version for me anymore. (I had installed 0.6.0 previously.)

GaspardCulis commented 1 month ago

I still have the same issue even after updating to 8661abf