wayfire icon indicating copy to clipboard operation
wayfire copied to clipboard

Pointer constraints do not warp to cursor hint

Open fbushstone opened this issue 1 year ago • 3 comments

Describe the bug On destruction of a pointer constraint, a committed locked pointer constraint should warp the cursor to the set hint. Sway has a good reference implementation of this: https://github.com/swaywm/sway/blob/bbabb9aae8d7b7771d02489b6f20301cf1c090c9/sway/input/cursor.c#L1348

To Reproduce The only program that I use that makes use of this feature is the game Dungeons and Dragons Online, so I will describe the behavior in that context.

  1. Launch the game
  2. Press t in-game in order to enable camera-follows-cursor.
  3. Move mouse.

Expected behavior A clear and concise description of what you expected to happen. I expected the camera to follow the cursor in the game mentioned above.

Wayfire version 0.8.0

I am willing to provide a PR in the next few weeks, it shouldn't be too hard given that I already know the cause and Sway already has an implementation.

fbushstone avatar Dec 24 '23 19:12 fbushstone

A PR sounds very nice :)

ammen99 avatar Dec 24 '23 20:12 ammen99

@ammen99 Apologies for the beginner question- how do you get a node/client/view in the Wayfire codebase? My only experience with wlroots comes from dwl.

fbushstone avatar Dec 25 '23 18:12 fbushstone

@fbushstone I am not sure I understand the question. Where to you want to get a node or a view? What is the context, which view do you want to get, etc?

Pointer-constraints are implemented here in wayfire: https://github.com/WayfireWM/wayfire/blob/master/src/view/wlr-surface-pointer-interaction.hpp#L25-L164

Take a look at the implementation, most likely the majority of the functions you need are already there.

ammen99 avatar Dec 26 '23 07:12 ammen99