这是indexloc提供的服务,不要输入任何密码
Skip to content

[wayland] Mouse position #477

@tarik02

Description

@tarik02

Is your feature request related to a problem? Please describe.
There is comment left in code and location method implementation that returns Err and prints error:

"You tried to get the mouse location. I don't know how this is possible under Wayland. Let me know if there is a new protocol"

Describe the solution you'd like

  1. Create transparent overlay surface.
  2. Listen for mouse events on that surface.
  3. If available - use virtual pointer protocol and move cursor by (0, 0) (to ensure that we will get event).
  4. Once mouse event received, you get mouse coordinates with it.

There is implementation of this tenchique: https://github.com/cjacker/wl-find-cursor/

Describe alternatives you've considered
Didn't see any alternatives (real protocols for getting cursor position).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions