GithubHelp home page GithubHelp logo

Select region is a bit off? about slop HOT 4 OPEN

naelstrof avatar naelstrof commented on May 24, 2024
Select region is a bit off?

from slop.

Comments (4)

naelstrof avatar naelstrof commented on May 24, 2024

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!

from slop.

mkoskar avatar mkoskar commented on May 24, 2024

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

from slop.

naelstrof avatar naelstrof commented on May 24, 2024

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.

from slop.

mkoskar avatar mkoskar commented on May 24, 2024

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.

from slop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.