slop icon indicating copy to clipboard operation
slop copied to clipboard

Select region is a bit off?

Open mkoskar opened this issue 7 years ago • 4 comments

I think this one might be a small inconsistency in behavior.

Below image is a composition of 4 screenshots from left to right in sequence:

  • I place cursor near the 1px vert. line on the left side
  • now I move mouse to the right/down, creating a region and the border is right next to the vert. line (OK)
  • now I try from the opposite side, placing cursor near the vert. line on the right side
  • moving mouse to the left/down I would expect basically symmetric result (ignore dimensions), though the border is actually set 1px further than expected (BUG?)

1474819892

mkoskar avatar Sep 25 '16 16:09 mkoskar

Took me forever to respond because I couldn't figure out how to fix it. It has to do with how X11 does mouse input. After writing the Wayland port where the mouse input is floating point, I rebased the x11 port to the cleaner code, and it seems to be fixed!

naelstrof avatar May 30 '17 23:05 naelstrof

I've tested this with latest -git version. There is no longer the crosshair thingy so I've tested with crosshair shader.

My laptop screen is 1600x900.

  1. I start at left slamming mouse against left edge (so I'm sure it's at position 0) then drag selection to right edge and slam it against it (so it's at position 1599), resulting region reads width of 1600

  2. I start at right edge and proceed analogically to 1), resulting region reads width of 1598

  3. top to bottom case behaves similarly as 1)

  4. bottom to top behaves specially, region border is visible on the bottom but moves out of screen once I slam cursor to the top edge, giving height 900 but then moving it just one pixel down I get 898 because the bottom border move back up a bit

mkoskar avatar May 31 '17 15:05 mkoskar

Unfortunately that's just how xorg handles mouse input. If you used crosshair to select a character in your terminal, you can see no matter what angle you attempt to select from it will always select it perfectly.

Due to how xorg constrains the screen slop seemingly doesn't work right when you hit the borders. wayland-slop doesn't have this issue despite running the exact same code.

Now the question is if I should make a literal edge-case detection to solve the issue you just described.

naelstrof avatar May 31 '17 17:05 naelstrof

I see, well this was just something I've come across and it is edge case, though I thought easily fixed. Otherwise it doesn't affect me really and if it requires some unreasonable effort to fix it, it's probably not worth it. I suggest we keep this issue open then so it's kinda documented.

mkoskar avatar Jun 01 '17 14:06 mkoskar