-
Notifications
You must be signed in to change notification settings - Fork 6
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
Bug: region selection incorrect on Wayland with scaling #195
Comments
That's very interesting! For context about how gscreenshot does region selection, it takes a screenshot of the entire display then crops it based on the output of the region selection tool, in your case slurp. It's possible that gscreenshot needs to adjust something by the scaling ratio. |
Reproducible in KDE |
This should be working in gscreenshot 3.6.1 |
I'm afraid it still doesn't work for me, but I'll do some more digging |
Try out version 3.6.2 which I just released this morning and see if it works any better. One of the Gtk calls was wrong and gscreenshot was falling back to another method of getting the scaling that might not have been accurate on your setup. |
Unfortunately no, now I get something like this: It seems to be larger (dilated down and to the right) than the region selection I had chosen, even going off the screen. For comparison, with grim/slurp: One thing to consider is that I am currently using two monitors with different scaling; this could potentially be a problem in detecting scaling. One is a 1920x1080 external display with no scaling and the other is a 2256x1504 laptop screen with 1.5 scaling. However, even when I disconnect the external display, the problem persists, so I doubt this is the cause of the issue. If it would help, I'd be happy to run a version with debugging/print statements and send the output here. |
Here's a Python script you can run which should output the scaling factor of the current screen. It will call into gscreenshot's functions as well as another call that uses a different approach.
|
I'm having the same issue as davis above, where taking a screenshot by selecting an area is offset from where it should be (and contains black spaces). I'm using KDE Plasma and wayland, and I have my screen scaling set to 125%. Changing it to 100% does fix the issue, so that does seem to be the source of the problem. The output I get from your script is the following:
I'm using gscreenshot 3.6.3. |
Fantastic, thank you! That's a really good datapoint. Interesting variation between those with only one of them actually having the correct value for your setup. |
This appears to be fixed for me in the latest version, 3.8.0-1 |
Thanks @Momo8289! I did slip some scaling improvements into 3.8.0 :). Glad to hear it helped someone. While I think it's better "in general," on my own setup I still have some misalignment of selections so there's still room for improvement. |
Summary
I am having trouble using gscreenshot's region capture on Wayland. I am using sway with fractional scaling (1.5x). When I attempt to take a screenshot via a region selection, the resulting image is of a smaller region than I selected, with corners up and to the left of the selected region.
gscreenshot examples
For example, here is a screenshot of the entire screen (no region selection):
And here is a screenshot where I have used selected the entire screen as a region:
I do not have this problem when sway is unscaled (
swaymsg output eDP-1 scale 1.0
or similar). Here is a screenshot using a region selection of the whole screen with 1.0 scaling:The problem persists with 2.0 scaling, so it is not an issue of fractional or whole-number scaling. Here is a screenshot using region selection of the whole screen with 2.0 scaling:
This screenshot is (visually) exactly half the screen, so I imagine the program somehow misinterprets scaled coordinates.
grim/slurp examples
I do not have this same problem with "raw" grim/slurp region selection (
grim -g "$(slurp)"
).No region selection:
Region selection of the entire screen:
Some information
gscreenshot --version
The text was updated successfully, but these errors were encountered: