Menu

#435 Mouse grab causes GTK+ 3 display to stop updating

v1.5.7
closed-fixed
5
2019-01-22
2018-09-14
No

Activating the mouse grab causes the GTK+ 3 display to stop updating. As a simple test, start Fuse as ./fuse --kempston-mouse, enter PRINT FLASH 1;"Working" and then click in the Fuse window - the blue "mouse" icon comes on at the bottom, but the text stops flashing. Nothing(?) seems capable of restarting the display, but the emulator is clearly still working - keyboard clicks, BEEP 1,0 etc all make noise as expected.

  • GTK+ 2 build is fine
  • Replacing the deprecated gdk_device_(un)grab functions with gdk_seat_(un)grab doesn't seem to make a difference.

GTK+ 3.22.30 if that makes any difference.

Discussion

  • Sergio Baldoví

    Sergio Baldoví - 2018-09-28

    It works for me on X11:
    GDK_BACKEND=x11 ./fuse --kempston-mouse --no-sound

    and crash on Wayland:
    GDK_BACKEND=wayland ./fuse --kempston-mouse --no-sound

    #0  0x00007ffff3b29950 in XWarpPointer () at /lib64/libX11.so.6
    #1  0x00000000004807d7 in gtkmouse_reset_pointer () at ui/gtk/gtkmouse.c:51
    #2  0x00000000004809b0 in ui_mouse_grab (startup=0) at ui/gtk/gtkmouse.c:123
    #3  0x000000000043dd67 in ui_mouse_button (button=2, down=0) at ui.c:181
    #4  0x00000000004808e5 in gtkmouse_button (widget=0x1bae0f0, event=0x7fffd400ddc0, data=0x0) at ui/gtk/gtkmouse.c:75
    

    Obviously we shouldn't use XWarpPointer on Wayland. I don't know the current status quo of relative/locking pointer, some years ago it was a missing feature on Wayland:
    http://www.phoronix.com/scan.php?page=news_item&px=MTMxMjQ

     
  • Philip Kendall

    Philip Kendall - 2018-10-14

    At least on my machine, this seems to be related to XWarpPointer even on X11; removing the call means that everything works.

     
  • Philip Kendall

    Philip Kendall - 2018-10-14

    Some further trial and error guessing shows that changing the window used as dest_w to XWarpPointer from gtkui_drawing_area to gtkui_window makes things work on my machine (on both GTK 2.x and 3.x). Sergio, could you test this on your machine?

     
  • Philip Kendall

    Philip Kendall - 2018-10-14

    And some more extensive testing shows that we do actually want gtkui_drawing_area on GTK+ 2.x. So therefore:

    • On GTK+ 2.x, warp relative to gtkui_drawing_area as before.
    • On GTK+ 3.x / X11, warp relative to gtkui_window.
    • On GTK+ 3.x / Wayland, don't warp.

    This is now all done in the bug-435-improve-kempston-mouse-handling branch. Please give it a test if you can...

    On Wayland, the values returned seem to be junk. I'll create a separate bug for that.

     
  • Philip Kendall

    Philip Kendall - 2018-10-14
    • labels: GTK+ --> GTK+, kempston-mouse
     
  • Philip Kendall

    Philip Kendall - 2018-10-24

    Merged as there were no objections :-)

     
  • Philip Kendall

    Philip Kendall - 2018-10-24
    • status: open --> pending-fixed
    • assigned_to: Philip Kendall
     
  • Sergio Baldoví

    Sergio Baldoví - 2018-10-24

    Sorry for the slow reply. I've seen a small issue. With Wayland backend I can't move the main window by dragging the title bar as the mouse is grabbed. With X11 backend the window can be moved as the mouse is only grabbed when clicking the drawing area.

     
  • Sergio Baldoví

    Sergio Baldoví - 2019-01-21

    I've figured out that Fuse shouldn't stop other handlers when the mouse is not grabbed. That allows moving and resizing the window on Wayland. Patch attached. I'll commit in a few days.

     
  • Sergio Baldoví

    Sergio Baldoví - 2019-01-22
    • status: pending-fixed --> closed-fixed
    • Group: future --> v1.5.7
     
  • Sergio Baldoví

    Sergio Baldoví - 2019-01-22

    Regression fixed in [ec1c37]. Will be released in the next version of v1.5.7

     

    Related

    Commit: [ec1c37]


Log in to post a comment.

MongoDB Logo MongoDB