swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.55k stars 1.11k forks source link

Rebase the cursor when re-ordering layer surfaces #3080

Open Limero opened 5 years ago

Limero commented 5 years ago

I first reported this to slurp, but this is apparently a sway bug according to @emersion, so the steps below will be from that issue.

When you run slurp, the cursor will remain regular until you move it, and then, it will turn into the crosshair.

This causes a problem when running slurp and directly doing a selection, the selection will not be highlighted and the resulting selection will have an empty x and y value, like this: 0,0 1144x753

Steps to replicate:

  1. Open a terminal and run slurp
  2. Don't move the cursor
  3. Notice the cursor still being regular, not a crosshair
  4. Press the primary mouse button and drag a selection
  5. Notice the selection not being highlighted and the result having x/y values set to 0

Sway version: sway version 1.0-beta.1-151-ge9c77970 (Nov 5 2018, branch 'master')

emersion commented 5 years ago

We now correctly rebase on map.

We should also rebase on commit if it re-arranges layer surfaces. This requires detecting when layer surfaces need to be moved or resized.

Limero commented 5 years ago

Is there more to be done or can this be closed? Cursor updates correctly in slurp after recent changes, so I'm happy :smile:

emersion commented 5 years ago

Yes, we should rebase the cursor when a layer surface changes its size.