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

FATAL: Failed to grab keyboard #26

Closed
matheusfillipe opened this issue Oct 13, 2020 · 20 comments
Closed

FATAL: Failed to grab keyboard #26

matheusfillipe opened this issue Oct 13, 2020 · 20 comments

Comments

@matheusfillipe
Copy link
Contributor

I am not sure what happened but I can't quite use warpd anymore :(

$ warpd -f
rescan_devices: detected keyboard: Power Button (6)
rescan_devices: detected keyboard: Video Bus (7)
rescan_devices: detected keyboard: Video Bus (8)
rescan_devices: detected keyboard: Power Button (9)
rescan_devices: detected keyboard: Sleep Button (10)
rescan_devices: detected keyboard: USB OPTICAL MOUSE  Keyboard (13)
rescan_devices: detected keyboard: BY Tech Usb Gaming Keyboard (15)
rescan_devices: detected keyboard: BY Tech Usb Gaming Keyboard System Control (16)
rescan_devices: detected keyboard: BY Tech Usb Gaming Keyboard (18)
rescan_devices: detected keyboard: Integrated Webcam: Integrated W (20)
rescan_devices: detected keyboard: Intel HID events (23)
rescan_devices: detected keyboard: Intel HID 5 button array (24)
rescan_devices: detected keyboard: Dell WMI hotkeys (25)
rescan_devices: detected keyboard: USB OPTICAL MOUSE  Consumer Control (27)
rescan_devices: detected keyboard: BY Tech Usb Gaming Keyboard Consumer Control (28)
rescan_devices: detected keyboard: Corsair Raptor HS40 (11)
rescan_devices: detected keyboard: AT Translated Set 2 keyboard (26)
main_loop: Waiting for activation key
main_loop: Processing activation key M-x.
input_grab_keyboard: Grabbing keyboard
FATAL: Failed to grab keyboard

I tried to bypass this on ~ line 340 of inputs.c by ignoring this error just to see what would happen and of course that was a terrible idea :P :

main_loop: Waiting for activation key
main_loop: Processing activation key M-x.
input_grab_keyboard: Grabbing keyboard
input_grab_keyboard: Done
hint_mode: Entering main hint loop
input_ungrab_keyboard: Ungrabbing keyboard
input_ungrab_keyboard: Waiting for neutral keyboard state.
input_ungrab_keyboard: Done
input_ungrab_keyboard: Attempting to perform ungrab on all grabbed devices.
input_ungrab_keyboard: Ungrabbing 6

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 7

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 8

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 9

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 10

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 13

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 15

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 16

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 18

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 20

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 23

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 24

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 25

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 27

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 28

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 11

input_ungrab_keyboard: Done
input_ungrab_keyboard: Attempting to perform ungrab on all grabbed devices.
input_ungrab_keyboard: Ungrabbing 6

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 7

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 8

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 9

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 10

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 13

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 15

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 16

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 18

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 20

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 23

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 24

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 25

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 27

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 28

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 11

input_ungrab_keyboard: Done
^CReceived termination signal, cleaning up...
input_ungrab_keyboard: Ungrabbing keyboard
input_ungrab_keyboard: Attempting to perform ungrab on all grabbed devices.
input_ungrab_keyboard: Ungrabbing 6

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 7

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 8

My actual cursor then disappears and only returns if I kill warpd. (Which I guess is expected). But warpd works, I can use any mode if that exit(-1) is commented out of inputs.c but then it will fail to ungrab. That is on 65e8cd6.

I also tried 0dff1f0, which was working before and now I get on it:

$ warpd -f
rescan_devices: detected keyboard: Power Button (6)
rescan_devices: detected keyboard: Video Bus (7)
rescan_devices: detected keyboard: Video Bus (8)
rescan_devices: detected keyboard: Power Button (9)
rescan_devices: detected keyboard: Sleep Button (10)
rescan_devices: detected keyboard: USB OPTICAL MOUSE  Keyboard (13)
rescan_devices: detected keyboard: BY Tech Usb Gaming Keyboard (15)
rescan_devices: detected keyboard: BY Tech Usb Gaming Keyboard System Control (16)
rescan_devices: detected keyboard: BY Tech Usb Gaming Keyboard (18)
rescan_devices: detected keyboard: Integrated Webcam: Integrated W (20)
rescan_devices: detected keyboard: Intel HID events (23)
rescan_devices: detected keyboard: Intel HID 5 button array (24)
rescan_devices: detected keyboard: Dell WMI hotkeys (25)
rescan_devices: detected keyboard: USB OPTICAL MOUSE  Consumer Control (27)
rescan_devices: detected keyboard: BY Tech Usb Gaming Keyboard Consumer Control (28)
rescan_devices: detected keyboard: Corsair Raptor HS40 (11)
rescan_devices: detected keyboard: AT Translated Set 2 keyboard (26)
main: Built from commit: 0dff1f0736c5b7c202ef977fc72ed3a290b777d8

main: Waiting for activation key
X Error of failed request:  BadAccess (attempt to access private resource denied)
  Major opcode of failed request:  33 (X_GrabKey)
  Serial number of failed request:  514
  Current serial number in output stream:  519

And that also happens on 08ed81a... So something surelly changed on my system but I am not sure what....

@rvaiya
Copy link
Owner

rvaiya commented Oct 13, 2020 via email

@matheusfillipe
Copy link
Contributor Author

I found the cause. I used to use xmodmap to remap my keys but recently found that KDE had a built in way to do those remappings which surely affects the way warp crashes:
image

I am not sure of what kde is using to do remap the keyboard. Here is the output on the latest commit with the option as the screenshot above:

$ warpd -f
rescan_devices: detected keyboard: Power Button (6)
rescan_devices: detected keyboard: Video Bus (7)
rescan_devices: detected keyboard: Video Bus (8)
rescan_devices: detected keyboard: Power Button (9)
rescan_devices: detected keyboard: Sleep Button (10)
rescan_devices: detected keyboard: USB OPTICAL MOUSE  Keyboard (13)
rescan_devices: detected keyboard: BY Tech Usb Gaming Keyboard (15)
rescan_devices: detected keyboard: BY Tech Usb Gaming Keyboard System Control (16)
rescan_devices: detected keyboard: BY Tech Usb Gaming Keyboard (18)
rescan_devices: detected keyboard: Integrated Webcam: Integrated W (20)
rescan_devices: detected keyboard: Intel HID events (23)
rescan_devices: detected keyboard: Intel HID 5 button array (24)
rescan_devices: detected keyboard: Dell WMI hotkeys (25)
rescan_devices: detected keyboard: USB OPTICAL MOUSE  Consumer Control (27)
rescan_devices: detected keyboard: BY Tech Usb Gaming Keyboard Consumer Control (28)
rescan_devices: detected keyboard: Corsair Raptor HS40 (11)
rescan_devices: detected keyboard: AT Translated Set 2 keyboard (26)
main_loop: Waiting for activation key
main_loop: Processing activation key M-z.
input_grab_keyboard: Grabbing keyboard
FATAL: Failed to grab keyboard AT Translated Set 2 keyboard: 1

@rvaiya
Copy link
Owner

rvaiya commented Oct 13, 2020 via email

@matheusfillipe
Copy link
Contributor Author

I rebooted now and I have warpd on my kde's startup script. It works fine until I restart warpd, then I start having FATAL: Failed to grab keyboard AT Translated Set 2 keyboard: 1.

@rvaiya
Copy link
Owner

rvaiya commented Oct 14, 2020 via email

@matheusfillipe
Copy link
Contributor Author

The problem is that after exiting warpd and ungrabing the DE's mouse cursor doesn't appear again. If I unplug the mouse and plug it again, or kill warpd, it reappears. Is like if warpd is failing to ungrab? I believe I only have this problem in kde. I didn't have this problem on i3. Guess Ill have to disable kde's input handling, I'll test that later.

$ warpd -f
rescan_devices: detected keyboard: Power Button (6)
rescan_devices: detected keyboard: Video Bus (7)
rescan_devices: detected keyboard: Video Bus (8)
rescan_devices: detected keyboard: Power Button (9)
rescan_devices: detected keyboard: Sleep Button (10)
rescan_devices: detected keyboard: Integrated Webcam: Integrated W (20)
rescan_devices: detected keyboard: Intel HID events (23)
rescan_devices: detected keyboard: Intel HID 5 button array (24)
rescan_devices: detected keyboard: Dell WMI hotkeys (25)
rescan_devices: detected keyboard: Corsair Raptor HS40 (28)
rescan_devices: detected keyboard: BY Tech Usb Gaming Keyboard (15)
rescan_devices: detected keyboard: BY Tech Usb Gaming Keyboard System Control (16)
rescan_devices: detected keyboard: BY Tech Usb Gaming Keyboard Consumer Control (18)
rescan_devices: detected keyboard: BY Tech Usb Gaming Keyboard (19)
rescan_devices: detected keyboard: USB OPTICAL MOUSE  Keyboard (11)
rescan_devices: detected keyboard: USB OPTICAL MOUSE  Consumer Control (13)
rescan_devices: detected keyboard: AT Translated Set 2 keyboard (26)
main_loop: Waiting for activation key
main_loop: Processing activation key M-z.
input_grab_keyboard: Grabbing keyboard
input_grab_keyboard: Done
input_ungrab_keyboard: Ungrabbing keyboard
input_ungrab_keyboard: Waiting for neutral keyboard state.
input_ungrab_keyboard: Done
input_ungrab_keyboard: Attempting to perform ungrab on all grabbed devices.
input_ungrab_keyboard: Ungrabbing 6

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 7

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 8

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 9

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 10

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 20

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 23

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 24

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 25

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 28

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 15

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 16

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 18

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 19

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 11

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 13

input_ungrab_keyboard: Done
input_ungrab_keyboard: Attempting to perform ungrab on all grabbed devices.
input_ungrab_keyboard: Ungrabbing 6

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 7

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 8

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 9

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 10

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 20

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 23

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 24

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 25

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 28

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 15

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 16

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 18

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 19

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 11

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 13

input_ungrab_keyboard: Done
input_ungrab_keyboard: Attempting to perform ungrab on all grabbed devices.
input_ungrab_keyboard: Ungrabbing 6

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 7

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 8

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 9

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 10

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 20

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 23

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 24

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 25

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 28

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 15

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 16

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 18

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 19

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 11

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 13

input_ungrab_keyboard: Done
input_ungrab_keyboard: Attempting to perform ungrab on all grabbed devices.
input_ungrab_keyboard: Ungrabbing 6

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 7

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 8

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 9

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 10

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 20

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 23

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 24

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 25

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 28

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 15

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 16

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 18

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 19

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 11

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 13

input_ungrab_keyboard: Done
input_ungrab_keyboard: Attempting to perform ungrab on all grabbed devices.
input_ungrab_keyboard: Ungrabbing 6

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 7

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 8

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 9

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 10

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 20

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 23

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 24

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 25

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 28

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 15

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 16

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 18

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 19

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 11

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 13

input_ungrab_keyboard: Done
input_ungrab_keyboard: Attempting to perform ungrab on all grabbed devices.
input_ungrab_keyboard: Ungrabbing 6

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 7

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 8

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 9

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 10

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 20

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 23

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 24

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 25

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 28

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 15

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 16

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 18

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 19

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 11

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 13

input_ungrab_keyboard: Done
input_ungrab_keyboard: Attempting to perform ungrab on all grabbed devices.
input_ungrab_keyboard: Ungrabbing 6

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 7

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 8

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 9

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 10

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 20

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 23

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 24

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 25

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 28

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 15

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 16

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 18

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 19

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 11

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 13

input_ungrab_keyboard: Done
input_ungrab_keyboard: Attempting to perform ungrab on all grabbed devices.
input_ungrab_keyboard: Ungrabbing 6

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 7

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 8

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 9

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 10

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 20

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 23

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 24

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 25

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 28

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 15

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 16

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 18

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 19

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 11

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 13

input_ungrab_keyboard: Done
input_ungrab_keyboard: Attempting to perform ungrab on all grabbed devices.
input_ungrab_keyboard: Ungrabbing 6

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 7

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 8

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 9

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 10

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 20

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 23

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 24

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 25

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 28

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 15

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 16

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 18

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 19

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 11

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 13

input_ungrab_keyboard: Done
input_ungrab_keyboard: Attempting to perform ungrab on all grabbed devices.
input_ungrab_keyboard: Ungrabbing 6

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 7

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 8

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 9

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 10

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 20

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 23

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 24

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 25

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 28

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 15

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 16

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 18

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 19

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 11

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 13

input_ungrab_keyboard: Done
input_ungrab_keyboard: Attempting to perform ungrab on all grabbed devices.
input_ungrab_keyboard: Ungrabbing 6

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 7

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 8

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 9

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 10

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 20

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 23

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 24

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 25

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 28

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 15

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 16

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 18

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 19

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 11

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 13

input_ungrab_keyboard: Done
input_ungrab_keyboard: Attempting to perform ungrab on all grabbed devices.
input_ungrab_keyboard: Ungrabbing 6

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 7

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 8

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 9

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 10

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 20

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 23

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 24

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 25

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 28

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 15

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 16

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 18

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 19

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 11

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 13

input_ungrab_keyboard: Done
input_ungrab_keyboard: Attempting to perform ungrab on all grabbed devices.
input_ungrab_keyboard: Ungrabbing 6

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 7

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 8

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 9

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 10

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 20

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 23

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 24

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 25

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 28

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 15

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 16

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 18

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 19

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 11

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 13

input_ungrab_keyboard: Done
input_ungrab_keyboard: Attempting to perform ungrab on all grabbed devices.
input_ungrab_keyboard: Ungrabbing 6

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 7

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 8

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 9

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 10

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 20

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 23

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 24

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 25

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 28

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 15

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 16

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 18

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 19

input_ungrab_keyboard: Done
X Error of failed request:  XI_BadDevice (invalid Device parameter)
  Major opcode of failed request:  131 (XInputExtension)
  Minor opcode of failed request:  48 ()
  Device id in failed request: 0xb
  Serial number of failed request:  1060
  Current serial number in output stream:  1060

@rvaiya
Copy link
Owner

rvaiya commented Oct 15, 2020 via email

@matheusfillipe
Copy link
Contributor Author

matheusfillipe commented Oct 15, 2020

That last log was produced by launching warpd, pressing the hints mode keybind, then pressing Esc and then I don't have my "normal" cursor back.

The behavior changes sometimes and warpd stops being able to grab my keyboard:

$ warpd -f
Built from commit: def543553d53528609dff7171c1ce88b6c11f2eb
rescan_devices: detected keyboard: Power Button (6)
rescan_devices: detected keyboard: Video Bus (7)
rescan_devices: detected keyboard: Video Bus (8)
rescan_devices: detected keyboard: Power Button (9)
rescan_devices: detected keyboard: Sleep Button (10)
rescan_devices: detected keyboard: Integrated Webcam: Integrated W (20)
rescan_devices: detected keyboard: Intel HID events (23)
rescan_devices: detected keyboard: Intel HID 5 button array (24)
rescan_devices: detected keyboard: Dell WMI hotkeys (25)
rescan_devices: detected keyboard: Corsair Raptor HS40 (28)
rescan_devices: detected keyboard: BY Tech Usb Gaming Keyboard (15)
rescan_devices: detected keyboard: BY Tech Usb Gaming Keyboard System Control (16)
rescan_devices: detected keyboard: BY Tech Usb Gaming Keyboard Consumer Control (18)
rescan_devices: detected keyboard: BY Tech Usb Gaming Keyboard (19)
rescan_devices: detected keyboard: USB OPTICAL MOUSE  Keyboard (11)
rescan_devices: detected keyboard: USB OPTICAL MOUSE  Consumer Control (13)
rescan_devices: detected keyboard: AT Translated Set 2 keyboard (26)
main_loop: Waiting for activation key
main_loop: Processing activation key M-x.
input_grab_keyboard: Grabbing keyboard
FATAL: Failed to grab keyboard AT Translated Set 2 keyboard: 1

Do all devices really need to be grabbed? I did something like this on input.c to ignore the error:

void input_grab_keyboard(int wait_for_keyboard)
{
	size_t i, not_grabbed_count=0;
	XIEventMask mask;

	dbg("Grabbing keyboard");

	mask.deviceid = XIAllDevices;
	mask.mask_len = XIMaskLen(XI_LASTEVENT);
	mask.mask = calloc(mask.mask_len, sizeof(char));
	XISetMask(mask.mask, XI_KeyPress);
	XISetMask(mask.mask, XI_KeyRelease);

	for (i = 0; i < nkbds; i++) {
		int rc;
		if((rc = XIGrabDevice(dpy, kbds[i],
				      DefaultRootWindow(dpy),
				      CurrentTime,
				      None,
				      GrabModeAsync,
				      GrabModeAsync,
				      False, &mask))) {
			int n;
      not_grabbed_count++;
			XIDeviceInfo *info = XIQueryDevice(dpy, kbds[i], &n);
			fprintf(stderr, "FATAL: Failed to grab keyboard %s: %d\n", info->name, rc);
		}
	}
  if (not_grabbed_count==nkbds)
			exit(-1);

	XSync(dpy, False);
	clear_keys();
	grabbed = 1;
	dbg("Done");
}

Which I have no idea if would be right but at least it warpd shows and work then, but when exiting I still don't get my mouse cursor back unless if I kill it manually. Maybe is just something being held? I have to kill warpd with sigkill after I hit esc though.

@rvaiya
Copy link
Owner

rvaiya commented Oct 15, 2020 via email

@matheusfillipe
Copy link
Contributor Author

I was able to fix it here and made a pull request to you can understand what solved it and see if that's possible and correct it. I don't know much C :P. Here: #27

I restarted warp many times and seems like that solved. I hope that's fine and won't create a regression to the Xorg crashing problem. If a device fails to be grabbed then we skip it and skip attempting to ungrab it too. It fixed for me, been testing since a while and restarted warpd without problems with the KDE remap also on.

@rvaiya
Copy link
Owner

rvaiya commented Oct 15, 2020

Silently failing is the wrong solution. Please confirm whether or not the problem disappears when you disable all input mapping in KDE. I have asked several times but it is still unclear whether or not turning that feature off causes the problem to disappear.

@matheusfillipe
Copy link
Contributor Author

Sorry. Doesn't seem to be related to the KDE's input remaping. I rebooted and was able to run def5435 just fine now... Another thing I am running is imwheel. Do you think it could be related?

By the way weirdly now I am able to restart warpd and use (def5435) just fine...With all my input mess running (synergy+imwheel+kde remapping). I just tested having only one of them separately and turns out none are a problem now :P

I'll report if this happens again and close if not, maybe was your last commit.

@rvaiya
Copy link
Owner

rvaiya commented Oct 15, 2020

The last two commits (def5435 and ae82680) made superficial changes which should not have changed anything. 65e8cd6 did indeeed introduce some stability related change to the input system but I'm assuming you were running from the tip of master when you posted your logs. I am not familiar with imwheel but a cursory grep through the source suggests it doesn't use xinput and should not be a problem. As discussed in #17 synergy does use xinput and should be considered mutually incompatible with warpd. In this particular instance it might be synergy, KDE or a combination of the two. Given that the problem spontaneously disappeared you may also have been running on an older commit. Without being able to consistently reproduce the issue it is difficult to isolate. The next time you have issues try disabling synergy. If it doesn't fix the problem then it is probably caused by the KDE input layer. I would recommend using setxkpmap to do remapping in your startup scripts anyway unless you need some feature only provided by KDE.

@matheusfillipe
Copy link
Contributor Author

matheusfillipe commented Oct 15, 2020

I was going to post the problem happened again but finally figured out what is causing this it!! Haha might sound stupid now but I am using a usb keyboard attached to the laptop and I like to turn the laptop keyboard off sometimes and place the usb keyboard over it.

I am using something like this this to disable it:
xinput disable 26

This is causing warpd to loop forever on the upgrade, it keeps printing:

input_ungrab_keyboard: Attempting to perform ungrab on all grabbed devices.
input_ungrab_keyboard: Ungrabbing 6

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 7

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 8

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 9

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 10

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 11

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 13

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 15

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 16

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 18

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 20

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 23

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 24

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 25

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 28

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 29

input_ungrab_keyboard: Done
input_ungrab_keyboard: Attempting to perform ungrab on all grabbed devices.
input_ungrab_keyboard: Ungrabbing 6

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 7

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 8

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 9

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 10

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 11

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 13

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 15

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 16

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 18

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 20

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 23

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 24

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 25

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 28

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 29

input_ungrab_keyboard: Done
-input_ungrab_keyboard: Attempting to perform ungrab on all grabbed devices.
input_ungrab_keyboard: Ungrabbing 6

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 7

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 8

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 9

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 10

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 11

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 13

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 15

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 16

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 18

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 20

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 23

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 24

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 25

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 28

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 29

input_ungrab_keyboard: Done
-----------------input_ungrab_keyboard: Attempting to perform ungrab on all grabbed devices.
input_ungrab_keyboard: Ungrabbing 6

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 7

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 8

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 9

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 10

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 11

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 13

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 15

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 16

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 18

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 20

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 23

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 24

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 25

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 28

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 29

input_ungrab_keyboard: Done
-input_ungrab_keyboard: Attempting to perform ungrab on all grabbed devices.
input_ungrab_keyboard: Ungrabbing 6

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 7

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 8

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 9

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 10

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 11

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 13

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 15

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 16

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 18

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 20

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 23

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 24

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 25

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 28

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 29

input_ungrab_keyboard: Done
--------input_ungrab_keyboard: Attempting to perform ungrab on all grabbed devices.
input_ungrab_keyboard: Ungrabbing 6

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 7

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 8

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 9

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 10

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 11

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 13

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 15

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 16

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 18

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 20

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 23

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 24

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 25

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 28

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 29

input_ungrab_keyboard: Done
^CReceived termination signal, cleaning up...
input_ungrab_keyboard: Ungrabbing keyboard
input_ungrab_keyboard: Attempting to perform ungrab on all grabbed devices.
input_ungrab_keyboard: Ungrabbing 6

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 7

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 8

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 9

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 10

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 11

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 13

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 15

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 16

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 18

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 20

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 23

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 24

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 25

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 28

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 29

input_ungrab_keyboard: Done
^C^Cinput_ungrab_keyboard: Attempting to perform ungrab on all grabbed devices.
input_ungrab_keyboard: Ungrabbing 6

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 7

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 8

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 9

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 10

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 11

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 13

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 15

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 16

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 18

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 20

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 23

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 24

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 25

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 28

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 29

input_ungrab_keyboard: Done
^C
input_ungrab_keyboard: Attempting to perform ungrab on all grabbed devices.
input_ungrab_keyboard: Ungrabbing 6

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 7

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 8

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 9

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 10

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 11

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 13

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 15

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 16

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 18

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 20

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 23

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 24

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 25

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 28

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 29

input_ungrab_keyboard: Done
input_ungrab_keyboard: Attempting to perform ungrab on all grabbed devices.
input_ungrab_keyboard: Ungrabbing 6

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 7

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 8

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 9

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 10

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 11

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 13

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 15

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 16

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 18

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 20

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 23

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 24

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 25

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 28

input_ungrab_keyboard: Done
input_ungrab_keyboard: Ungrabbing 29

input_ungrab_keyboard: Done
^Z
[1]  + 35948 suspended  warpd -f

And even if I kill it the cursor doesn't get back and Xorg gets frost sometimes. I think warpd can work just fine with synergy (on the host machine) and KDE remapping. The problem is that it should detect disabled devices I believe? Maybe kinda like what my pull request does but instead of ignoring the error, skipping disable devices.

@rvaiya
Copy link
Owner

rvaiya commented Oct 15, 2020

You seem to do a lot of weird things with your input devices :P. I can't reproduce this, the rescan logic seems to be working fine. It is possible (likely) that synergy is interfering. Can you disable it and see if you can reproduce the problem? Also, please always include the full log output. If it is too large to fit in the commit include it as an attachment.

Thanks

@matheusfillipe
Copy link
Contributor Author

Yeah. I disabled synergy. Look, if you might only be able to reproduce this if you have a laptop or two attached keyboards I guess. Run xinput disable $device_id. You can see the device_id with xinput list. Then run warpd or with it already running you will get an infinite loop when trying to ungrab and the normal cursor won't show up again.

I did this test with synergy killed, is not it's fault, is because it is trying to grab a manually disabled device (and trying to ungrab it).

@rvaiya
Copy link
Owner

rvaiya commented Oct 15, 2020

I've already done exactly that without issue. warpd should not be trying to ungrab anything if you able to run xinput disable id. It only grabs the keyboard when it is active. I'm not sure what you are doing. It shouldn't even be possible to type the command if warp is active, I can only assume you are calling it from a script which is getting triggered while warp is active. To properly isolate the problem please start with a fresh X session with no other programs running (ideally running a simple window manager like fluxbox) and list the steps you are performing in order to reproduce the issue. Also please include the full output.

@rvaiya
Copy link
Owner

rvaiya commented Oct 15, 2020

I was finally able to reproduce it by scripting the xinput command to trigger while it is active. This was not clear in your original post. Please always include a list of steps to reproduce the issue. Sometimes minor details which may seem insignificant are key to reproduction, and it also helps you isolate the problem on your own system. I will look into this and release a patch soon.

@rvaiya
Copy link
Owner

rvaiya commented Oct 16, 2020

I believe this should be fixed in the latest commit. In general there are no guarantees of compatibility with programs that use xinput, so things like this are not officially supported. Synergy might work under certain conditions but it is entirely possible for either of the programs to introduce a breaking change at any point so please be aware of this moving forward. While It was possible to address this particular issue, there are certain things that will inevitably break. This is just a limitation of the X input system.

other attempts at a keyboard driven mouse program appear to have run into some of the same problems I ran into while designing warp though warp is the only program I am aware of that circumvents them by abusing xinput (which is an ugly kludge). A byproduct of this approach is that while certain normally impossible things are made possible, other things will break. Really you should be glad warpd works at all :P.

@matheusfillipe
Copy link
Contributor Author

Fixed! Sorry for not making clear I was disabling a device after warpd was launched :P.

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

No branches or pull requests

2 participants