bk138 / gromit-mpx

Gromit-MPX is an on-screen annotation tool that works with any Unix desktop environment under X11 as well as Wayland.
GNU General Public License v2.0
1.01k stars 84 forks source link

Error grabbing Device 'Virtual core pointer' while grabbing all, ignoring. #174

Closed federico-arias closed 1 year ago

federico-arias commented 1 year ago

The above error is thrown when trying to execute gromit-mpx --toggle from Openbox configuration file.

I want to do this to be able to trigger gromit with the mouse buttons, which is more convenient than using F9.

To Reproduce

  1. Add the following mousebinding to openbox config (rc.xml):

         <mousebind button="Button9" action="Press">
            <action name="Execute">
               <command> gromit-mpx --toggle</command>
            </action>
         </mousebind>
  1. Restart Openbox

  2. Use that button in the mouse.

  3. Error grabbing Device 'Virtual core pointer' while grabbing all, ignoring. error is thrown on the running instance of gromit-mpx.

Additional info

If I execute this in the command line or if I press F9, everything works as expected. Only executing it in Openbox config file gives this error. I also tried to set the DISPLAY variable by calling a shell script from Openbox, but that also throws the same error, so I presume it's not related to the display.

Environment:

bk138 commented 1 year ago

If it works from the command line (and I know it works in GNOME keyboard shortcuts as well), it might be an Openbox issue (you should probably file an issue with them). One idea though: what does xinput list give you on the command line vs from Openbox?

Edit: Idea2: it might be related to the fact that you triggering the grab from the pointing device you'tr trying to grab. You could test and see what happens if you try to grab from a key instead of from a button.

federico-arias commented 1 year ago

xinput list > openbox.txt

⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Dell Computer Corp Dell Universal Receiver Mouse  id=10   [slave  pointer  (2)]
⎜   ↳ Dell Computer Corp Dell Universal Receiver Consumer Control   id=11   [slave  pointer  (2)]
⎜   ↳ Compx 2.4G Wireless Receiver Mouse        id=14   [slave  pointer  (2)]
⎜   ↳ Compx 2.4G Wireless Receiver Keyboard     id=15   [slave  pointer  (2)]
⎜   ↳ SINO WEALTH RK Bluetooth Keyboard Consumer Control    id=17   [slave  pointer  (2)]
⎜   ↳ ELAN2204:00 04F3:3109 Mouse               id=21   [slave  pointer  (2)]
⎜   ↳ ELAN2204:00 04F3:3109 Touchpad            id=22   [slave  pointer  (2)]
⎜   ↳ Dell Mouse MS5320W Mouse                  id=28   [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Power Button                              id=8    [slave  keyboard (3)]
    ↳ Dell Computer Corp Dell Universal Receiver    id=9    [slave  keyboard (3)]
    ↳ Dell Computer Corp Dell Universal Receiver System Control id=12   [slave  keyboard (3)]
    ↳ Compx 2.4G Wireless Receiver              id=13   [slave  keyboard (3)]
    ↳ SINO WEALTH RK Bluetooth Keyboard         id=16   [slave  keyboard (3)]
    ↳ SINO WEALTH RK Bluetooth Keyboard         id=18   [slave  keyboard (3)]
    ↳ SINO WEALTH RK Bluetooth Keyboard System Control  id=19   [slave  keyboard (3)]
    ↳ ov9734_azurewave_camera: ov9734           id=20   [slave  keyboard (3)]
    ↳ Huawei WMI hotkeys                        id=23   [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=24   [slave  keyboard (3)]
    ↳ Dell Computer Corp Dell Universal Receiver Consumer Control   id=25   [slave  keyboard (3)]
    ↳ Compx 2.4G Wireless Receiver Keyboard     id=26   [slave  keyboard (3)]
    ↳ SINO WEALTH RK Bluetooth Keyboard Consumer Control    id=27   [slave  keyboard (3)]
    ↳ WH-1000XM4 (AVRCP)                        id=29   [slave  keyboard (3)]

From CLI:xinput list > cli.txt

⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Dell Computer Corp Dell Universal Receiver Mouse  id=10   [slave  pointer  (2)]
⎜   ↳ Dell Computer Corp Dell Universal Receiver Consumer Control   id=11   [slave  pointer  (2)]
⎜   ↳ Compx 2.4G Wireless Receiver Mouse        id=14   [slave  pointer  (2)]
⎜   ↳ Compx 2.4G Wireless Receiver Keyboard     id=15   [slave  pointer  (2)]
⎜   ↳ SINO WEALTH RK Bluetooth Keyboard Consumer Control    id=17   [slave  pointer  (2)]
⎜   ↳ ELAN2204:00 04F3:3109 Mouse               id=21   [slave  pointer  (2)]
⎜   ↳ ELAN2204:00 04F3:3109 Touchpad            id=22   [slave  pointer  (2)]
⎜   ↳ Dell Mouse MS5320W Mouse                  id=28   [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Power Button                              id=8    [slave  keyboard (3)]
    ↳ Dell Computer Corp Dell Universal Receiver    id=9    [slave  keyboard (3)]
    ↳ Dell Computer Corp Dell Universal Receiver System Control id=12   [slave  keyboard (3)]
    ↳ Compx 2.4G Wireless Receiver              id=13   [slave  keyboard (3)]
    ↳ SINO WEALTH RK Bluetooth Keyboard         id=16   [slave  keyboard (3)]
    ↳ SINO WEALTH RK Bluetooth Keyboard         id=18   [slave  keyboard (3)]
    ↳ SINO WEALTH RK Bluetooth Keyboard System Control  id=19   [slave  keyboard (3)]
    ↳ ov9734_azurewave_camera: ov9734           id=20   [slave  keyboard (3)]
    ↳ Huawei WMI hotkeys                        id=23   [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=24   [slave  keyboard (3)]
    ↳ Dell Computer Corp Dell Universal Receiver Consumer Control   id=25   [slave  keyboard (3)]
    ↳ Compx 2.4G Wireless Receiver Keyboard     id=26   [slave  keyboard (3)]
    ↳ SINO WEALTH RK Bluetooth Keyboard Consumer Control    id=27   [slave  keyboard (3)]
    ↳ WH-1000XM4 (AVRCP)                        id=29   [slave  keyboard (3)]

diff cli.txt openbox.txt is empty. Both files are the same.

federico-arias commented 1 year ago

Idea2 worked 😃 . Still, I think the ideal way to trigger would be from the pointing device itself. Now that you know the root cause, do you see any possible way to fix it?

bk138 commented 1 year ago

Idea2 worked smiley . Still, I think the ideal way to trigger would be from the pointing device itself. Now that you know the root cause, do you see any possible way to fix it?

I guess this is intrinsic to X11 and probably not fixable as they might have a very good reason do work like that, I guess. You might want to sift through https://tronche.com/gui/x/xlib/ or open an issue with them, but my guess is that it's impossible architecture-wise.