Menu

#246 glutWarpPointer does nothing when running under wayland

open
nobody
None
5
2018-04-12
2018-04-11
Bert Peters
No

Like the title says. When running a GLUT program in a wayland session, glutWarpPointer does nothing at all. Please see the attached sample program attempting to make use of glutWarpPointer to implement mouse-based look around functionality. When running in an X11 based session, everything works fine.

Tested with:
OS: Arch Linux
Freeglut: 3.0.0
DE: GNOME (in both Xorg and Wayland modes) 3.28.1

1 Attachments

Discussion

  • rcmaniac25

    rcmaniac25 - 2018-04-12

    I don't know a lot about Wayland, but from doing some searches, Wayland doesn't support pointer warping.

    I did find https://phoronix.com/scan.php?page=news_item&px=XWayland-Pointer-Warp-Emulate but I don't see anything say warping exists... just that they now can use relative positions and people emulate warping with virtual pointers.

     
  • Bert Peters

    Bert Peters - 2018-04-12

    I'm not familliar enough with the code of either wayland or freeglut so I'm not sure if it doesn't work of if it doesn't try anything.

    In the former case, I'm curious what the problem is, and in the latter case, perhaps a warning message (akin to the warnings you get when you call glutGetModifiers() outside of key handlers) that what you're doing isn't supported? That would probably save other developers the headache of figuring out why their program sometimes doesn't work.

     
  • rcmaniac25

    rcmaniac25 - 2018-04-12

    I don't know about former case, but in terms of the latter:
    If you call glutGetModifiers outside an input handler, we do log a warning.
    If you call glutWarpPointer, we also already have a warning saying it isn't supported.

    Just need to register a warning handler (glutInitWarningFunc) and it will get called with those warnings.

    If you were expecting a printout to stderr, you need to have compiled freeglut with "FREEGLUT_PRINT_WARNINGS" defined.

     

Log in to post a comment.