Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Snipping area incorrectly positioned with screen scaling #276

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

Closed
pbek opened this issue Mar 27, 2020 · 160 comments
Closed

Snipping area incorrectly positioned with screen scaling #276

pbek opened this issue Mar 27, 2020 · 160 comments
Assignees

Comments

@pbek
Copy link

pbek commented Mar 27, 2020

Following up on #275.

Unfortunately capturing rectangular screenshots (ksnip installed from the edge snap) doesn't seem to work for me in KDE Neon with my two 4k displays (zoomed to 150%). I guess that's because Qt is reporting the resolution after the zoom.

Primary screen resolution: 2560x1440
Screen resolution(s): 2560x1440, 2560x1440

ksnip thinks I have the full 4k resolutions but the screenshot only gets a part of full image.

How my screen should look like (screenshot take with Spectacle):

image

How it looks like when I want to grab a region with ksnip (sorry, hard to see because of the dark overlay of ksnip):

IMG_20200327_130749

On the left screen you see a big part of the right screen.

@pbek
Copy link
Author

pbek commented Mar 27, 2020

Btw. I also tested the AppImage and had (almost) the same result.

@DamirPorobic
Copy link
Member

Thanks for opening the bug. Is it a scaling problem or positioning problem? Looking at the right side which seems to have the correct height, just positioned wrong. Or am I looking at it wrong?

I'll try to install KDE Neon and try it out for myself, though I have currently the problem of having only one monitor. Does it happen with single monitor?

@pbek
Copy link
Author

pbek commented Mar 27, 2020

It's a positioning problem and the preview is also horizontally stretched.

I currently don't dare to turn one screen off, since I would need to reboot then. 😆 Having two high dpi screens still can make a lot of troubles under Linux. I can't test my other dual screen setup at work neither because of Corona. (Because I knew this issue will be hard to fix I initially just proposed #275. 😁) Spectacle manages to do it right, but that doesn't help a lot.

@pbek
Copy link
Author

pbek commented Mar 27, 2020

Damn it, I disabled the 2nd screen... 😆
It's even stranger now. Halve of the screen wasn't visible when capturing a rectangular screenshot.

IMG_20200327_134944

@DamirPorobic
Copy link
Member

That's very strange, thanks for double checking this. Don't bother yourself further with this, I'll try to test on my machine or a vm.

@pbek
Copy link
Author

pbek commented Mar 27, 2020

Reproducing such issues is a major PITA, I've quite some on https://github.com/pbek/QOwnNotes myself. 😆

@DamirPorobic
Copy link
Member

Yeah, I know, had few of them already, across different OS xD

@pbek
Copy link
Author

pbek commented Mar 28, 2020

No issues on a KDE Neon box with a single, non-zoomed display.

@DamirPorobic
Copy link
Member

Ok, that's at least something I can test, Single Display with Zoom.

@DamirPorobic
Copy link
Member

DamirPorobic commented Apr 5, 2020

I've testen now with a VM and 150% Scaling, seems kind of normal to me
image

You did have the issue with single monitor and scaling?

@DamirPorobic DamirPorobic self-assigned this Apr 5, 2020
@pbek
Copy link
Author

pbek commented Apr 6, 2020

Although only one screen, correct? Too bad I cannot test with my office setup right now. 😬
Thank you for the effort!

@DamirPorobic
Copy link
Member

Yeah, single Monitor. It's currently my only setup, have no external Monitors at home anymore.

@pbek
Copy link
Author

pbek commented Jun 9, 2020

I found something out.

If I remove the env variable QT_SCREEN_SCALE_FACTORS (currently is set to QT_SCREEN_SCALE_FACTORS=DVI-I-0=1.5;DVI-I-1=1.5;HDMI-0=1.5;DP-0=1.5;DVI-D-0=1.5;DP-1=1.5;) and set QT_AUTO_SCREEN_SCALE_FACTOR=0 (it was 0, but it must not be 1 for this to work) before starting ksnip the UI is too small but the screenshots are fine!

@DamirPorobic
Copy link
Member

Thanks for looking into this again. I'm finishing up the 1.7.0 release and wanted to look into this issue today after work. Your finding confirms that scaling is the problem, seems that some parts are scaled and other not which creates this strange behavior.

@pbek
Copy link
Author

pbek commented Jun 9, 2020

QT_SCREEN_SCALE_FACTORS seems to be set by KDE System Settings where I set the "Global scale" to 150%.

As a reference: Spectacle is ok with the env variables. UI and screenshots are as they should in Spectacle.

At least I can now unset the env variables in the ksnip desktop file and live with the small ui but gain correct screenshots! 😁

@pbek
Copy link
Author

pbek commented Jun 9, 2020

But if you can get around that behavior it would be awesome! 🥳

@pbek
Copy link
Author

pbek commented Jun 9, 2020

Oh, I have to correct myself. There is one issue in Spectacle I forgot. The screenshots are 50% too large (150% instead of 100%):

image

But that's the same with ksnip (with removed QT_SCREEN_SCALE_FACTORS):

image

@DamirPorobic
Copy link
Member

Will have a look at that too

@DamirPorobic
Copy link
Member

This is one nasty issue. I have the feeling that it's caused by some change in Qt with version 5.8 or 5.9. I know that the scaling was working for me with my last KDE Version, with my current it's not working for me anymore though the issue looks a bit different on my side. I have just disabled scaling for testing purpose for versions above 5.8. Could you quickly test how it behaves for you?

@pbek
Copy link
Author

pbek commented Jun 11, 2020

Edge snap?

@DamirPorobic
Copy link
Member

DamirPorobic commented Jun 11, 2020 via email

DamirPorobic added a commit that referenced this issue Jun 11, 2020
DamirPorobic added a commit that referenced this issue Jun 11, 2020
@DamirPorobic
Copy link
Member

Difficult issue indeed. Can you give it a try and test with the appImage or edge snap?

Also, what coordinates to you see on the mouse when the mouse cursor is in the top left corner on the left monitor? Do you see 0,0 or something else?

@pbek
Copy link
Author

pbek commented Jun 12, 2020

Can you give it a try and test with the appImage or edge snap?

Now the user interface is too small (like when I use my variables) but the screenshot is still wrong.
Using QT_AUTO_SCREEN_SCALE_FACTOR=0 QT_SCREEN_SCALE_FACTORS="" still helps getting a correct screenshot.

Do you see 0,0 or something else?

1280,0 on the top left corner of my left monitor when I don't use the env variables. (0,0 with env variables)

@DamirPorobic
Copy link
Member

Something's fishy, I get an offest too on my Plasma with scaling enabled and multiple screens but no clue where it's coming from. How does a fullscreens screenshot look? Did it work before? Is it still working?

@gubareve
Copy link

gubareve commented Dec 5, 2021

Changing the x value does not change the size of the top or bottom bar.

@DamirPorobic
Copy link
Member

The offset, x and y is just the position of the background image, it should not affect the size. I'm bit puzzled where it comes from. I have seen the on the left side in my testing but never at the top or bottom. Need to test again.

@ihipop
Copy link

ihipop commented Dec 6, 2021

@pbek

env QT_AUTO_SCREEN_SCALE_FACTOR=0 QT_SCREEN_SCALE_FACTORS="" ksnip & is still my workaround of choice.

this is the simplest way of workaround, I can use it with flameshot too, And, I don't know why, maybe because I have a fixed font DPI set by KDE, The UI of ksnip/flameshot looks some kind of normal when disable QT_SCREEN_SCALE_FACTORS

Before disabled QT_SCREEN_SCALE_FACTORS
image

After disabled QT_SCREEN_SCALE_FACTORS it looks a bit tiny ,but usable, a little weird of the delay seconds UI
image

I prefer to change the desktop file of ksnip/flameshot to apply this workaround

@ihipop
Copy link

ihipop commented Dec 6, 2021

I also tested the latest Continuous build,wow, it woks ,with out any weird of UI and only a simple settings of offset, I will accept this way as a temp solution before QT fixed the buggy scale behavior

@ihipop
Copy link

ihipop commented Dec 6, 2021

And there is a bug on the magnifier, I turned it off

微信图片_20211206154744

@ihipop
Copy link

ihipop commented Dec 6, 2021

and also image crop is not working

3.mp4

@DamirPorobic
Copy link
Member

I'll have a look at the magnifier. The crop issue is known ksnip/kImageAnnotator#250, would be nice if you could attach your video there.

@MirtoBusico
Copy link

Well, if I understand correctly you ask for the flameshot error
I confirm flameshot gives the same error. This is how flameshot sees the two screens
flameshot_error
Maybe I have to install a different flameshot version.
I'll ask in the other isuue

@DamirPorobic
Copy link
Member

@ihipop Adorner (magnifying glass, rulers, info text) should be positioned correctly now.

@ihipop
Copy link

ihipop commented Dec 8, 2021

magnifying glass

magnifying glass IS STILL not working with a new issue
see video

3.mp4

my left monitor is the primary monitor, when the crosshair pointer is on right monitor,it woks well
but when I just pass out the edge of each screen from right to left ,the magnifying glass fly to the very left of the primary monitor, and can not move properly on the left monitor

And the crosshair pointer is gone, only have a single horizontal red line left on screen, the vertical line disappears

@DamirPorobic DamirPorobic changed the title Problems capturing screenshots with dual 4k displays zoomed to 150% Snipping area incorrectly positioned with screen scaling Dec 8, 2021
@DamirPorobic
Copy link
Member

@ihipop can you test again, should be better now.

@gubareve I'm not able to reproduce that issue you're having with the top and bottom line. Tried with 100%, 125% and 150% scaling, the top and bottom lines are always aligned correctly.

@ihipop
Copy link

ihipop commented Dec 9, 2021

@ihipop can you test again, should be better now.

@gubareve I'm not able to reproduce that issue you're having with the top and bottom line. Tried with 100%, 125% and 150% scaling, the top and bottom lines are always aligned correctly.

works like a charm,-including the #250 :)-

@gubareve
Copy link

gubareve commented Dec 9, 2021

@ihipop can you test again, should be better now.

@gubareve I'm not able to reproduce that issue you're having with the top and bottom line. Tried with 100%, 125% and 150% scaling, the top and bottom lines are always aligned correctly.

Oh well, it's extremely minor so it's fine. Thanks for trying though.

@DamirPorobic
Copy link
Member

Awesome, thanks for checking.

@gubareve if you find a way to reproduce this I'll have another look into.

Closing this issue.

@teixeire
Copy link

I am having the same issue!

@DamirPorobic
Copy link
Member

@teixeire what issue? The initial? Have you tested with the continuous build of 1.10.0 https://github.com/ksnip/ksnip/releases/tag/continuous?

@dovahgab
Copy link

Hi, I have a similar problem: i run with double monitor,

  • main monitor 1902x1080, 100% scale
  • laptop monitor 2160x1440, 175% scale
    Launching the rectangular capture, i get a white band below both screens, and the upper band of the screens isn't visible (pic below)

Ubuntu 20.04, tried with ksnip continuous release that you mentioned above
Flameshot does not have any problem, if useful - let me know if any other info is

image

@Katuend
Copy link

Katuend commented Jul 30, 2022

I am also facing this bug, I'll provide as much information as I can

When you have Global scale enabled, using the Rectangular Area tool shifts the screens to the horizontally to the left, causing one to be cut off and the far right one to have a grey area to the right where the screen should have been.

Using a larger scale size seems to shift the screens more.

To Reproduce
Steps to reproduce the behavior:

  1. Go to System Settings > Display Configuration
  2. Set Global Scale higher than 100%
  3. Restart
  4. Start a Rectangular area section
  5. Note the shifted screens

Expected behavior
For the screens to be frozen in the position the screens should typically be, without shifting.

Screenshots
Scale 100%
Scale 112%
Scale 125%

Desktop (please complete the following information):
Operating System: Fedora Linux 36
KDE Plasma Version: 5.25.3
KDE Frameworks Version: 5.96.0
Qt Version: 5.15.3
Kernel Version: 5.18.13-200.fc36.x86_64 (64-bit)
Graphics Platform: X11
Processors: 16 × Intel® Core™ i9-9900K CPU @ 3.60GHz
Memory: 15.3 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1080 Ti/PCIe/SSE2

ksnip version: 1.10.0
Also tested with 1.10.1-continuous, Build 1-82ac27e, and still apparent

Flatpack for stable. Used continuous rpm

@EwolBash
Copy link

I managed to 'fix' this for myself, and I'm not sure why it works, but basically I have two monitors

1920x1200 and a 1920x1080. The 1920x1200 was the default monitor and like the examples above it was always off when taking a screenshot. I set the 1920x1080 as the default monitor instead and now the screenshots are perfect.

Only mentioning in case it helps someone out there.

@knulpi
Copy link

knulpi commented Mar 7, 2023

I can confirm upgrading from 1.9.0 to latest release of 1.10.0 solved the issue for me with a global scale >100% and a dual-monitor setup.

@qwc
Copy link

qwc commented Oct 13, 2023

Hi,

I have bad news, because this problem is somehow back. The only thing which might help is, that with spectacle or flameshot it happens aswell. So I am not completely sure if I actually should bother you with it, but more go to KDE/Plasma itself.

Happens when I choose a rectangular area.
(the magnifying lens is not a concern for me as long as this displacement happens)
Same with flameshot.
With spectacle it happens with a rectangular area and the window below the mouse cursor.

Data:
Operating System: Arch Linux
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.11
Kernel Version: 6.5.7-arch1-1 (64-bit)
Graphics Platform: X11
Processors: 24 × AMD Ryzen 9 5900X 12-Core Processor
Memory: 62.7 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 3080/PCIe/SSE2
Manufacturer: Gigabyte Technology Co., Ltd.
Product Name: X570S UD

Spectacle: 23.08.2
Flameshot: v12.1.0
Ksnip: 1.10.1

Here a screenshot of ksnip with the problem, taken by spectacle with delay and full screen screenshot (and an accidentally opened window of Exquisite).
Screenshot_20231013_111143

If you can provide me hints to solve or to take this problem further, please don't hesitate to point me to it. :)

@EureDudeheit
Copy link

I can confirm this:

It seems to be a KDE-specific issue, because i have the exact behaviour with Ksnip and Flameshot.
I have two monitors with global scaling of 150% and forced DPI to 120 within the KDE systemsettings.

My system:
Kubuntu 22.04.3 LTS
Flameshot 11.0.0-2
Ksnip 1.10.1

when i put the scaling back to 100% both of them work as they should.

@koriit-kontakt
Copy link

I'm experiencing the same issues on Kubuntu. I tried experimenting with different global scaling options and only on 100% everything is fine. The other I tried are: 106.25%, 112.5%, 150%, 200%. Since 200% was also affected I don't think the fractional scalling is the issue here. I also think that I haven't experienced this when I started using ksnip, on the same setup. It probably started happening after some system update.

Operating System: Kubuntu 22.04
KDE Plasma Version: 5.24.7
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3
Kernel Version: 5.15.0-91-generic (64-bit)
Graphics Platform: X11
Processors: 12 × AMD Ryzen 5 5500U with Radeon Graphics
Memory: 35,1 GiB of RAM
Graphics Processor: AMD RENOIR

Primary screen: 2560x1440
Secondary screen: 1920x1080

Here is how it looks on my primary screen when I try to take a snip:
image

@timdv91
Copy link

timdv91 commented Jan 22, 2024

Edit (12 oct 24):
I successfully disabled fractional scaling in Cinnamon, then resized and increased the size of all fonts en menu items manually. This solved the ksnip issues for me, working perfectly now.

Having the same issue on my 13 inch Framework, with Manjaro Cinnamon.

In my case the issue only occurs with fractional scaling enabled, which is labeled as "experimental" under the Cinnamon GUI. So I suspect this "fractional scaling" to be the cause of the issue.

If I could, I would disable this "fractional scaling" option. I sadly can't, because:

  • If I disable fractional scaling, I can only select 100% or 200% monitor scaling in the GUI.
  • If I enable fractional scaling, I also get the additional options 125%, 150% and 175% scaling.

My display is only 13 inch with 2256x1504 (3:2) resolution, so 100% scaling is unreadable small, whilst 200% is ridiculous large and clumsy. I prefer 125% as the optimal choice, which requires "fractional scaling" to be enabled.

One workaround that I discovered, is to select the option "Full screen (All monitors)" in "Ksnip", then crop the printscreen afterwards in "Ksnip" itself. Hope this solution helps others as wel.

@NeilMartin
Copy link

I'm getting this issue on Win11

OS: Windows 11 (10.0.22631) 64bit [WindowsEditor]
CPU: 12th Gen Intel(R) Core(TM) i9-12900HX [24 cores]
GPU: NVIDIA GeForce RTX 4080 Laptop GPU
GPU: Direct3D 11.0 [level 11.1] [Direct3D11]
GPU: SM: 5.0, FR: N/A, VRAM: 11997 MB
RAM: 65237 MB

I have two monitors, primary 1920x1200, secondary 4K. I try to capture a third of the screen on my primary, and a small section of the secondary is captured instead.

ksnip_20241010-082214-bug

Bonus bug, the attached image was saved from ksnip, and it the saved file has white borders that the image did not have within ksnip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests