Comments (9)
Are you sure? Selecting a full-screen for me captures from 0x0 to 1919x1079, counting the 0x0, is 1920 by 1080 pixels.
Looking at the picture I took with maim: it does include every pixel. Including when selecting windows.
Can you show me some examples of it not working properly? Because I can't reproduce it. (In fact, I did try to increase the selection by 1x1. It actually made it too wide and too tall when I selected windows. Causing it to select some of my desktop with the window.)
from slop.
Tried selecting the whole screen with mouse:
$ slop
X=0
Y=0
W=1919
H=1079
As you can see, the width and height are 1px too low. I also tried maim -s
and selecting the whole screen manually, which resulted in 1919x1079 (from 0x0 to 1918x1078) screenshot, while just maim
to capture full screen gave me the right size (which is 1920x1080, from 0x0 to 1919x1079). Slop seems not to catch the last row and column of pixels. This problem isn't specific just for me, as my friend (using Openbox) also isn't able to select manually the whole screen.
The second issue however, seems to be a problem with my window manager (herbstluftwm). I just noticed that slop doesn't catch my right and bottom border, because selection starts 1px too "early". This is probably a result of herbstluftwm's unusual separation between frames (which can contain multiple windows) and windows. Here you can see a screenshot of a single window (the borders are cut off), and here is an example of 2 windows in a frame (borders show up properly). Therefore the problem is not slop-related, however I hope you can help me find the solution, to properly capture windows.
from slop.
Oh yup you were right. I had the border color set to black, and I couldn't see that it was indeed off.
I made normal selections have +1 to the width and height. Which should be visible directly from the selection rectangle.
However I haven't changed window selections-- It grabs the window width and height directly from X11 when you click on windows (So I'm assuming it's working as well as possible). Could you see if your problem has been fixed?
from slop.
Apparently herbstluftwm window's x and y (as given by xwininfo) are the upper left corner of border. I did a dirty hack, by removing all operations of subtraction and addition of the t.m_border
variable to x, y, w and h (so the slop's selection shows up in the right place), and added t.m_border * 2
to both width and height. That dirty, dirty hack worked for me (no matter what's the window's border size), and probably will only work on herbstluftwm. herbstluftwm is probably a special case, but I think I'll experiment with more window managers soon.
Thanks for help.
from slop.
Oh you're right! Would you kindly submit a pull request? Because this isn't just a herbstluftwm bug. I really did do my m_border math wrong. I wasn't even sure I needed it because my window manager doesn't even report window border size. So I didn't really notice it was wrong in the first place.
Thanks for figuring that all out!
from slop.
Nevermind-- I found a few more problems myself and fixed them, and just fixed the error you spotted on the way.
Thanks again!
from slop.
Hah, just as I was commiting :). Glad I could help.
from slop.
Sadly, your commit didn't fix my problem. Not sure if it's actually a herbstluftwm-specific issue or not...
from slop.
Woops, now it's fixed.
from slop.
Related Issues (20)
- Persisten slop for recording HOT 3
- Keyboard navigation HOT 2
- Programmatically select region HOT 2
- strange behavior with --nodrag and moving started selection HOT 1
- transparency in shader HOT 8
- Using the "magnifying glass" (based on shaderexamples) to select a pixel HOT 4
- Optionally disable border drawing and highlighting of windows.
- Slop crashes randomly when selecting
- Expose rectangle start position to shaders HOT 6
- Feature Request: Add parameter to show coordinates and horizontal/vertical lines while selecting a point or region
- Feature Request: Option to output the size of the window
- Feature request: Exclude bars and window manager windows HOT 1
- Screen edge compensation causes misalignment in shader
- Feature request: Use a different window class name (WM_CLASS) for selection
- No compositor found HOT 1
- Feature request: Option to keep rectangle and refine selection
- Feature request: select window from command argument
- Feature request: get display geometry HOT 3
- Feature request: "Ruler" style croshair HOT 5
- Option to not build or install the dynamic library
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slop.