Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input are not correctly forwarded to XWayland windows #4926

Closed
ghost opened this issue Jan 18, 2020 · 21 comments · Fixed by swaywm/wlroots#2035
Closed

Input are not correctly forwarded to XWayland windows #4926

ghost opened this issue Jan 18, 2020 · 21 comments · Fixed by swaywm/wlroots#2035

Comments

@ghost
Copy link

ghost commented Jan 18, 2020

Hello,

I'm currently testing the 1.3 version, and I have found a what I think could be a bug : When a popup is spawned by a XWayland window and I close it, Sway refocus the window that spawned the popup. Unfortunately, the keyboard is not sending any input to the window even if sway is marking this window as being currently focused.
I can reproduce this issue with several application on current release-candidate like vscode for instance.

Let me know if I can provide some details about this issue !

> swaymsg -t get_version
sway version 1.3-rc3
@ghost ghost changed the title [Bug] Input are not correctly forwarded to XWayland windows Input are not correctly forwarded to XWayland windows Jan 18, 2020
@emersion
Copy link
Member

Your bug report is missing debug logs. Please add a link to the full debug log file.
Your bug report is missing your config file. Please add a link to it.

@emberfade
Copy link

emberfade commented Jan 30, 2020

I think I have the same issue.

  • Sway Version:

sway version 1.4

Debug Log:

sway.log

Configuration File:

Default

Reproduction:

What I did in the debug log:

  • Open terminal (Super+Enter)
  • $ firefox
  • Open Bookmark Overview (Ctrl+Shift+O)
  • Make sure mouse cursor is above the newly spawned window
  • Close Bookmark Overview (Ctrl+W).
  • No keyboard input is possible on Firefox until focus has been switched to another window.

Additional Information:

This happened with other XWayland windows as well.

It is neccessary to move the mouse onto the new window. Otherwise the main window will take input from the keyboard as usual when the second window is closed.

Edit: Be more specific that it is about the input from the keyboard.

@ghost
Copy link
Author

ghost commented Jan 30, 2020

Hello, sorry for the late answer I was a bit short at the moment. I can confirm that what @emberfade is reporting is exactly the behavior I was first reporting.

@josefbachmann
Copy link

josefbachmann commented Feb 1, 2020

I think I have the same issue.

* Sway Version:

sway version 1.4

Same sway version, same problem. I can reproduce this as well and came here for this.

Firefox: Mozilla Firefox 72.0.2
Linux: 5.4.15-arch1-1

@emberfade
Copy link

I've tried using git bisect for the first time. So my result may not be accurate.

I believe that the commit introducing the bug is not within sway but wlroots swaywm/wlroots@c067fbc

@kdryja
Copy link

kdryja commented Feb 2, 2020

Same issue here.

Config and Debug

Repro

  1. Start Sway
  2. Open any XWayland app (tested on Google Chrome Version 80.0.3987.78 (Official Build) beta (64-bit) and IntelliJ)
  3. (For Google Chrome) Open any contextual window, e.g. Ctrl+O
  4. Close the contextual window by hitting ESC
  5. Focus on main Chrome window is now lost and can only be reclaimed by switching to different workspace and then back (e.g. if chrome is on workspace 1, I have to run $mod+2 then $mod+1 to regain focus)

Sway Version

sway version 1.4
xorg-server-xwayland 1.20.7
wlroots-0.10.0

@stlaz
Copy link

stlaz commented Feb 3, 2020

Seeing the same problem. I tried to tail -f on the debug log, but nothing seems to be logged (although eventually you get
2020-02-02 22:02:29 - [sway/input/cursor.c:730] denying request to set cursor from unfocused client, not sure if it's related to it)

Emantor added a commit to Emantor/wlroots that referenced this issue Feb 3, 2020
Even if we allow the focus change to the new window, we have to send the
focus explicitly. Otherwise the focus may get lost when we close a
window belonging to the same process, but do not send focus to the
remaining window.

Fixes swaywm/sway#4926
@Emantor
Copy link
Contributor

Emantor commented Feb 3, 2020

Please test swaywm/wlroots#2017, at least in my testing the chrome issue did not appear. I am currently on a train, so I can't realy test steam and other apps.

@m0ppers
Copy link

m0ppers commented Feb 4, 2020

same here. sway 1.2, wlroots 0.8.1 working. sway 1.4/wlroots 0.10 is not. My steps to reproduce:

open hexchat, dismiss the "shall I join a channel" popup after connecting. Input focus goes away and need to switch back and forth between workspaces to make input work again.

The first problem I ever had with sway :D keep up the good work :)

@jbiel
Copy link

jbiel commented Feb 17, 2020

I'm on Arch with wlroots 0.10.0-2 and sway 1.4-7 and this happens to me maybe 1 out of 20 times when opening a new tab in Firefox (using X11Wayland for it because native Wayland support was terrible last time I tried it.) The Firefox window is focused (blue title bar) with the cursor flashing in the address bar, but won't accept input until I focus another window and switch back.

@jfchevrette
Copy link

Arch with sway 1.4 with wlroots 0.10.0-2, this happens to me a lot when using Visual Studio code as well as Firefox

@norpol
Copy link

norpol commented Feb 18, 2020

Similar issue with Signal Desktop and attaching files, clicking onto my wallpaper and back into the main window of the application restores keyboard input focus for me.

@jbiel:

Firefox (using X11Wayland for it because native Wayland support was terrible last time I tried it

Maybe give it a try again, works quite well for me on arch.

@jubalh
Copy link
Contributor

jubalh commented Feb 18, 2020

@norpol ??

@Ogromny
Copy link

Ogromny commented Feb 19, 2020

Same issue with JetBrains >=2019.2.X IDE

emersion added a commit to emersion/wlroots that referenced this issue Feb 19, 2020
This reflects what i3 does [1].

[1]: https://github.com/i3/i3/blob/b3faf9fca9254679a4715486a4de80ebaee70410/src/handlers.c#L1076

Fixes: c067fbc ("xwm: allow applications to change focus between their own surfaces")
Closes: swaywm/sway#4926
@emersion
Copy link
Member

Can you try swaywm/wlroots#2035?

emersion added a commit to emersion/wlroots that referenced this issue Feb 19, 2020
This reflects what i3 does [1].

[1]: https://github.com/i3/i3/blob/b3faf9fca9254679a4715486a4de80ebaee70410/src/handlers.c#L1076

Fixes: c067fbc ("xwm: allow applications to change focus between their own surfaces")
Closes: swaywm/sway#4926
RedSoxFan pushed a commit to swaywm/wlroots that referenced this issue Feb 19, 2020
This reflects what i3 does [1].

[1]: https://github.com/i3/i3/blob/b3faf9fca9254679a4715486a4de80ebaee70410/src/handlers.c#L1076

Fixes: c067fbc ("xwm: allow applications to change focus between their own surfaces")
Closes: swaywm/sway#4926
@p-e-w
Copy link

p-e-w commented Feb 26, 2020

Is there going to be a patch release with this fix? This is a major regression from Sway 1.2, and makes many applications practically unusable, with no apparent workaround (other than downgrading Sway).

@emersion
Copy link
Member

I'm thinking about it. We'll discuss with the other core contributors.

@abmantis
Copy link

Also, considering that wlroots requires Wayland 1.18, it is impossible to easily update on Ubuntu 19.04 (the latest), in order to get this fix.

emersion added a commit to emersion/wlroots that referenced this issue Mar 7, 2020
This reflects what i3 does [1].

[1]: https://github.com/i3/i3/blob/b3faf9fca9254679a4715486a4de80ebaee70410/src/handlers.c#L1076

Fixes: c067fbc ("xwm: allow applications to change focus between their own surfaces")
Closes: swaywm/sway#4926
(cherry picked from commit 68820d6)
filips pushed a commit to filips/wlroots that referenced this issue Mar 15, 2020
This reflects what i3 does [1].

[1]: https://github.com/i3/i3/blob/b3faf9fca9254679a4715486a4de80ebaee70410/src/handlers.c#L1076

Fixes: c067fbc ("xwm: allow applications to change focus between their own surfaces")
Closes: swaywm/sway#4926
@glyh
Copy link

glyh commented Jul 21, 2022

I've encounter this in some DirectX games, is there some workaround or should it just work?

@ammgws
Copy link
Contributor

ammgws commented Jul 21, 2022

Have you tried running the game via gamescope?

@glyh
Copy link

glyh commented Jul 21, 2022

@ammgws I just tried it, it's working now. Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet