-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New swaymsg message type: get_cursor that returns cursor position #8780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…nd information about the node under it
|
Could you describe your use-case for this? |
|
Hi, For example, Kando, for which I plan to add Sway support (got it working on my forked Sway). |
|
I don't think Kando needs access to the global cursor position via the Sway IPC. Kando can open a full-screen layer-shell surface, receive the |
|
Kando is just an example of a tool that would benefit from swaymsg being able to return information about the cursor position and the element under it. |
|
🥺 👉 👈 |
|
I think emersion's point is correct; while adding this to Sway's IPC would be convenient, it isn't the proper way to get this information. It would be better to use the wlr-layer-protocol (or some other Wayland protocol), which would also be more portable to other WMs. |
|
A pull-request was accepted today on the Kando project, which adds support for Niri. The contributor used the full-screen layer-shell trick. I tried to use his work for the Sway backend, but the result is unsatisfactory: the trick does indeed allow Kando to receive the cursor position, but as no pointer-enter event is sent at surface creation, the capture of the cursor position hangs until the mouse moves. But then again, this new IPC command would have other uses than simply Kando compatibility: it would enable conditional actions based on cursor position. |
That's a Sway bug. |
Add an IPC command to Sway that allows swaymsg to request information about the cursor:
Cursor over container:
{ "x": 1024, "y": 768, "surface_x": 24, "surface_y": 48, "node_type": "con", "window_title": "Terminal", "app_id": "termite", "workspace_name": "1", "pid": 25370 }Cursor over workspace:
{ "x": 1024, "y": 768, "node_type": "workspace", "workspace_name": "1" }