-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Main/secondary display issue #420
Comments
I have just merged RP related to the DPI a few days before. |
Weird. System DPI scaling is disabled,which is desired. But WPF's DPI scaling is not working, which is unexpected. Get window version by open CMD, type Besides, what's your monitor's DPI scaling setting? Does preview other type of files produce the same behavior? Also, does open preview on your main display and move it to the secondary display changes the window size (if DPI setting are different)? |
Windows version is 1809, .NET Framework 4.7.2.
|
It seems that the font size has been scaled down (which is desired) but the window size did not. Let me check ... |
https://docs.microsoft.com/en-us/windows/desktop/api/wingdi/nf-wingdi-getdevicecaps:
I think here is the reason. Can you try the follows:
If so, then I think I should replace |
I can reproduce the issue. Here's the workaround: Ignore DPI of var screen = Screen.FromPoint(Cursor.Position).WorkingArea;
return new Rect(
new Point(screen.X , screen.Y ),
new Size(screen.Width , screen.Height )); call
Call @xupefei |
I signed out between step 1 and 2 so GDI is aware of change of primary monitor.
I mean since QL is now declared as Per monitor DPI aware, we should not care DPI any more if we're using native WPF controls. Similar to UWP, we just ignore DPI when designing and thinking, and system will make sure it looked great on any DPI scaling factors. I'll investigate what will happen if we remove all explicit DPI queries. |
Update: Ouch I am wrong. The I don't think we can get rid of DPI things when moving the window because I use Win32 API to resize the window and move it to the desired position: https://github.com/QL-Win/QuickLook.Common/blob/44448c9f28dc826db4c15e3e1b0b352b743b0885/Helpers/WindowHelper.cs#L56. I wonder when the numbers go wrong. Can you check:
Maybe we can move the window to the target display before calling |
Well, I guess:
|
The rect is scaled down. (683,364)*200%=(1366,768)
The reason is that var screen = Screen.FromPoint(Cursor.Position).WorkingArea;
var scale = DpiHelper.GetCurrentScaleFactor();
return new Rect(
new Point(screen.X / scale.Horizontal, screen.Y / scale.Vertical),
new Size(screen.Width / scale.Horizontal, screen.Height / scale.Vertical)); As I mentioned in workaround, I think we should remove the DPI query here.
If this is the case, maybe we can
Update: Not working☹ |
Found the culprit! |
If you change
to
Will the window scale? |
Found this: https://stackoverflow.com/questions/13230151/how-to-force-wpf-startup-window-to-specific-screen:
Seems like yet another lovely bug of Windows 10. Hostely, I am already tired to play with all kinds of freaking bugs and workarounds for all day. There is a reason why Windows Development Environment sucks. To the problem, if what this guy said is true, we can then get rid of |
I've report the issue to WPF team at M$ and is expecting no response🙂. And I agree with you, Windows Desktop Development definitely sucks. It's 8102 , even Electron, a Web based GUI framework, handles GUI stuff better than the native Windows GUI framework Winform/WPF have not been updated in years and UWP is nowhere function equivalent of them Alright, enough complaint. I'll try your suggestion when I have time |
This issue should be fixed in https://ci.appveyor.com/project/xupefei/quicklook/builds/35688242/artifacts. Could you have a try? |
* Update Translations.config * Update Translations.config * Update Translations.config * Create Privacy.md * Rename Privacy.md to PRIVACY.md * Update PRIVACY.md * Update PRIVACY.md * Fix QL-Win#579: search box changed in Windows 10 1909 * Fix QL-Win#579: also deal with non-English UIs * don't bring existing window to the front * Revert "Fix QL-Win#644: still use focusable window on Windows 7 and 8" This reverts commit 452574e. Revert "Fix QL-Win#644 step 1: correctly bring window back to top when clicked" This reverts commit af608dc. * Fix QL-Win#401: use the native image provider to render static GIFs * Update Translations.config Hungarian language added. * Fix QL-Win#669: convert image to sRGB only when the original ColorSpace is RGB, sRGB, or scRGB * Upgrade Magick.NET packages * Fix QL-Win#669 again: stupid syntax mistake :( * Bulk update NuGet packages * Update Translations.config Typo correction on line 61 and 69. Fixing slight translation mistakes and some words also replaced with more commonly used words. * Support File Path longer than 260 (tweak needed: https://www.tenforums.com/tutorials/51704-enable-disable-win32-long-paths-windows-10-a.html) * Add EXR to ImageViewer * Add MXF to VideoViewer * Decrease update checking frequency to monthly * Fix QL-Win#715: add 1s timeout before any previewing request * Fix QL-Win#711: adjust UI before loading any PDF page * Fix QL-Win#729: add a config flag to hide the tray icon * Fix QL-Win#731: use app folder for saving data in the portable mode * Fix QL-Win#733: detect Markdown encoding * Fix QL-Win#734: add AVIF format * Update .appveyor.yml * added german translation for newly added string * fix a typo * Fix QL-Win#744: Components are not correctly disposed upon exit * Fix QL-Win#477: Add JFIF files * Update bug_report.md * typo * Fix QL-Win#420, QL-Win#452, QL-Win#757: windows positioning for monitors with different DPIs * Update Common to fix plugin resize * Fix QL-Win#759: fix thumbnail orientation for some camera models * Fix QL-Win#760, support CR3 * removed dup of ".asf" and added ".mka" for testing Co-authored-by: Piteriuz <piteriuz@outlook.com> Co-authored-by: Pengfei Xu <xupaddy@gmail.com> Co-authored-by: Bobcruise <bobcruise07@gmail.com> Co-authored-by: davinhanif <39960696+davinhanif@users.noreply.github.com> Co-authored-by: Alexander Raab <alexander.raab1@gmx.de>
When I press spacebar to open QuickLook when File Explorer is on my secondary display, the window opens up really large, and it's too big to even see or click on the title bar to resize. It fills the whole screen and you have to press spacebar to close it, because the X button is off the screen. Pressing spacebar to open a file on the main display works perfectly normal and correct size.
I have a main display with 2736 x 1824 resolution, and the secondary display with 1280 x 1024 (the problem is on the secondary display).
Steps to reproduce the behavior:
Expected behaviour:
The QuickLook windows opens but it is really big, fills the whole screen, and the title bar is off the top of the screen (can't click there).
Desktop:
Screenshots
The text was updated successfully, but these errors were encountered: