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

Skip to content

Screenshot area issues when monitor count changes on windows #722

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

Open
dchen327 opened this issue Sep 27, 2021 · 26 comments
Open

Screenshot area issues when monitor count changes on windows #722

dchen327 opened this issue Sep 27, 2021 · 26 comments
Labels

Comments

@dchen327
Copy link

Describe the bug
If ksnip is launched on just a laptop screen, when a second monitor is plugged in and extends the first, taking a screenshot puts the two screens squished onto the main laptop, and the screenshot area is broken. A relaunch of ksnip fixes this issue; however, after switching from extended back to single laptop display, ksnip opened in extended mode will stretch the screenshot area a bit on the main laptop.

To Reproduce

  1. Launch ksnip in single monitor mode.
  2. Add a second monitor that extends the first.
  3. Try to take a screenshot

Expected behavior
I'd expect the screenshot cursor to show up on both monitors, but instead both screens get squished onto the laptop, and the cursor can't be moved to the top monitor (the cross goes blank).

Desktop (please complete the following information):

  • OS: Windows 10
  • ksnip version v1.9.1 continuous
  • installed through .msi
@dchen327 dchen327 added the bug label Sep 27, 2021
@DamirPorobic
Copy link
Member

Yes, valid issue. Problem is that that we only on startup detect what the scaling and screen size is. We need some mechanic to detect a change there, I think it is supported by Qt.

@dchen327
Copy link
Author

Yeah, makes sense that it isn't too easy to detect when the screen changes -- is the current solution to just quit and restart each time?

@DamirPorobic
Copy link
Member

Yeah, I don't think that there is an alternative in the moment.

@DamirPorobic
Copy link
Member

We should be able to handle that automatically, Qt can inform us about changed screen counts https://doc.qt.io/qt-5/qguiapplication.html#screenRemoved, we just need to listen to the signal and recalculate the display.

@DamirPorobic
Copy link
Member

I'll see if I can provide a fix tomorrow.

@DamirPorobic DamirPorobic self-assigned this Nov 11, 2021
@DamirPorobic DamirPorobic changed the title Screenshot area issues when switching between single and extended monitors Screenshot area issues when monitor count changes on windows Nov 11, 2021
@DamirPorobic
Copy link
Member

@200210qb I've pushed a quick fix, if you want to test latest build and see if the behavior has improved.

DamirPorobic added a commit that referenced this issue Nov 11, 2021
@dchen327
Copy link
Author

Hey! Thanks a ton for the fix -- however, when I plug in a second monitor to my laptop on ksnip continuous 1.10, screenshotting still shows both monitors squished onto my main monitor

@DamirPorobic
Copy link
Member

Is it the same as before or a different behavior?

@dchen327
Copy link
Author

I believe it's the same behavior

@DamirPorobic
Copy link
Member

Well, that happens when you write code without testing. Anyways, I believe I have fixed that now, I was able to reproduce and fix it locally, can you please test it one more time. The CI needs ~20min from now to build the package.

@DamirPorobic
Copy link
Member

Assuming this one is fixed now, closing the issue, please reopen if the issue persists.

@dchen327
Copy link
Author

Sorry -- just had a chance to test. I think it's fixed when going from extended monitors to just one monitor, but when I go from my laptop screen to extended, I still see both monitors squished onto my laptop monitor.

@DamirPorobic
Copy link
Member

but when I go from my laptop screen to extended, I still see both monitors squished onto my laptop monitor.

I'm not sure that I get what this means? You have an extended monitors and laptop and then turn of the laptop monitor?

@DamirPorobic DamirPorobic reopened this Nov 14, 2021
@dchen327
Copy link
Author

If I open ksnip with just my laptop, then plug in an external monitor that extends the laptop above, ksnip's screenshot area will squish both screens onto just the laptop screen

@DamirPorobic
Copy link
Member

So it works when you remove one monitor after ksnip was started but not when you add one monitor?

@dchen327
Copy link
Author

dchen327 commented Nov 14, 2021

Yes -- before, changing from extended mode to single laptop would do a weird offset when I screenshotted, but that seems to be fixed.

EDIT: I just tested again (I think the first time I did something different), but actually it doesn't seem this is fixed. When I move from extended to laptop, I get a very zoomed in and distorted screenshot area.

@DamirPorobic
Copy link
Member

I cannot reproduce that. What I'm doing is start ksnip, the power off one monitor, take screenshot, looks ok, then close ksnip. Next I tried starting ksnip with one monitor still turned of, then power on the one monitor that I have power off eralier, take screenshot, looks ok. Can you check if we are using the same version? Help > About > Version check version and build number.

@dchen327
Copy link
Author

I'm on Version: 1.10.0-continuous, Build: 1-302efd3
Let me try and take a picture to show what happens -- that might help more!

@dchen327
Copy link
Author

20211114_112633

Here's a picture of having ksnip open on laptop, then plugging in top monitor

@DamirPorobic
Copy link
Member

You just start ksnip and don't take any screenshots before plugging in the second monitor?

Oh and you have installed it via MSI? Can you test with the zip package?

Really strange, for me seems to be working, don't know what the difference is that might be causing it.

@dchen327
Copy link
Author

You just start ksnip and don't take any screenshots before plugging in the second monitor?
Yep! If I take a screenshot beforehand too it's the same bug.

I'll test the zip right now

@dchen327
Copy link
Author

Yes -- I get the same bug with the zip Version: 1.10.0-continuous Build: 1-ba9af9f

@DamirPorobic
Copy link
Member

Pushed a version now that should log to a file in your documents directory every time a screen change occurs. The CI need a couple of minutes to build it. Can you please test and share the log content here?

@DamirPorobic
Copy link
Member

@dchen327 can you check again and share the mentioned log?

@DamirPorobic
Copy link
Member

As I haven't got any feedback from you I'll be removing the logger and this issue from the 1.9.2 patch.

@DamirPorobic DamirPorobic removed their assignment Nov 22, 2021
@luisccgoncalves
Copy link

I also have this bug.

Maybe the issue is not monitor count, but monitor layout.

Here is a screen recording of me reproducing the bug:
https://user-images.githubusercontent.com/19171493/145574012-44726f61-94e4-4b32-8a11-4ada38b99607.mp4

I'm running:
Version: 1.10.0-continuous msi
Build: 1-660fea8
OS: Windows 10 21H1 19043.1151

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

No branches or pull requests

3 participants