QL-Win / QuickLook

Bring macOS “Quick Look” feature to Windows
http://pooi.moe/QuickLook/
GNU General Public License v3.0
17.42k stars 1.09k forks source link

Preview window is too large on one of multiple monitors with different resolution & scaling settings #827

Open zyLiu6707 opened 3 years ago

zyLiu6707 commented 3 years ago

Bug Description

Hi, I encountered the bug in issue #420 previously that the preview window is too large on my 1080p monitor that I plugged in, so I installed the zip version in the link mentioned by @xupefei in issue 420. Now on the 1080p monitor, the size of preview window is normal now. However, on my main 4k monitor of my laptop, the preview window is too larger instead.

I also viewed the issue #801 and tried the latest Nightly version - QuickLook-3.6.10-27-g826cda0.msi, in this version this bug reported here will not occurred. However, it has another bug that previewing some (not all) png file will frequently crash ("Failed to preview"), so I uninstalled this version in the end. (I could open another new issue if necessary.)

I'm using ASUS ZenBook Pro Duo, it has two built-in monitors itself, a 4k main monitor (3840 2160, monitor 1) and a secondary 4k monitor (3840 1100, monitor 2) on the top of the keyboard. I am not sure whether the bug is related to my hardware. And I also plug in a third 1080p monitor (1920 * 1080, monitor 3). As settings below. (More detail in the end) image

Bug Reproduce

I am not sure whether this issue is caused by my specific laptop and can only be reproduced on my laptop.

Steps to reproduce the behavior:

  1. Find a file to be tested, for example, a PDF file.
  2. Select this file on main monitor, and press space button to preview, and you will see that the preview window is too large.
  3. However, if you drag the PDF in this example to the 1080p monitor and press space again, the preview window just has a normal size.

Expected Behavior The size of the preview window should be appropriate on all monitors with different resolution and scaling settings.

Desktop

Screen Shots Below are the screenshots.

xupefei commented 3 years ago

QuickLook-3.6.10-5-g0243636.msi will not work due to another bug. Use this or the latest one will solve your problem.

zyLiu6707 commented 3 years ago

It's much better now, thanks! By the way, in this version of QuickLook, when I preview some large image on my external monitor (the 1080p one), the preview window will spread across all my three monitors. Is this an expected behavior? screenshot 1

xupefei commented 3 years ago

It's not. Is this happens on all monitors for all images, or only this small monitor and large images?

zyLiu6707 commented 3 years ago

For small images, the preview window is ok on all monitors. For large images and preview it on my external 1080p monitor, the preview window will spread across all my three monitors. However, I also tried some other large images, not all of them will behave like this. (e.g., a 1.23 MB image file will make the preview window spread across when preview it on the 1080p monitor, but another 2.17 MB image file will not, and the preview window just looks like quite normal.) Currently I have not find the common characteristics of the large images that will cause the preview window spread across yet.

zyLiu6707 commented 3 years ago

I tested more image files, and noticed that some small images will also make the preview window spread across different monitors, too.

It seems like this mainly depends on the pixel size of the image as well as the image orientation (portrait or landscape), rather than the size of the image file.

I created a simple paint with 4289 631 pixels (width height, same as the following) using Microsoft Paint, and this image file is only 28.2 KB. When I preview it on the 1080p monitor, the preview window will still spread across all my three monitors.

As for the image orientation, I notice that if the image is a portrait image (the image is taller that it is wider), seems no matter what the pixel size is (as well as the file size), the preview window is quite normal. For example, when previewing an image with pixel size of 1280 3705, 2334 3000, 1240 2203 on 1080p monitor, the preview window is normal. However, when previewing a landscape image (the image is wider than it is taller), most of this kind of images will have a too-large preview window — only few of the landscape images with quite small pixel size (e.g., 598 245, 675 * 555) will have a normal preview window.

Hope these information is useful.

xupefei commented 3 years ago

Could you do the following to debug?

  1. Install the latest nightly version of QL from https://ci.appveyor.com/project/xupefei/quicklook/build/artifacts
  2. Download test images dpi72.tar.gz and extract included images to a folder.
  3. Open the folder in Explorer and make sure the Explorer window is in Screen 3.
  4. Select each image and press the spacebar. Examine if the centre of the cross is at the centre of Screen 3. If not, take a screenshot (or you can record the whole process as a video).
  5. After previewing each image, press the spacebar again to close it. Do not move the preview window during the whole process.
  6. Upload all screenshots/video to here.
zyLiu6707 commented 3 years ago

After previewing the images you provided while following the above instruction, it turns out that only the 800 * 600 one has a normal preview window, and the cross is at the center of monitor 3. Other four images have a preview window that spreads across all three monitors.

Below are the screenshots. 800: results-800

1700: results-1700

2400: results-2400

5000: results-5000

7000: results-7000

In my last test, I also followed the instruction that you just mentioned, cause I noticed that if I first preview a image that will have a normal preview window, and preview the next image (which supposed to have a too-large preview window) by pressing the buttons on my keyboard (rather than hit space - select the next one - hit space again), the preview window will be normal.