eww icon indicating copy to clipboard operation
eww copied to clipboard

[BUG] focusable windows on wayland have exclusive focus

Open dangerousdan opened this issue 2 years ago • 8 comments

Checklist before submitting an issue

  • [X] I have searched through the existing closed and open issues for eww and made sure this is not a duplicate
  • [X] I have specifically verified that this bug is not a common user error
  • [X] I am providing as much relevant information as I am able to in this bug report (Minimal config to reproduce the issue for example, if applicable)

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

dangerousdan avatar Dec 22 '22 22:12 dangerousdan

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

mewoocat avatar Apr 21 '23 19:04 mewoocat

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.")
)

N0tAI avatar Jul 23 '23 17:07 N0tAI

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

killmlana avatar Aug 11 '23 11:08 killmlana

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 ?

GaspardCulis avatar Feb 21 '24 15:02 GaspardCulis

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.

Dr-42 avatar Jun 26 '24 20:06 Dr-42

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

djmaze avatar Sep 08 '24 18:09 djmaze

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

djmaze avatar Sep 09 '24 11:09 djmaze

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

GaspardCulis avatar Sep 09 '24 12:09 GaspardCulis