Skip to content
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

Window size not restoring properly after sleep #22250

Open
AGlezB opened this issue Feb 7, 2025 · 0 comments
Open

Window size not restoring properly after sleep #22250

AGlezB opened this issue Feb 7, 2025 · 0 comments
Labels
GUI GUI-related issues/changes

Comments

@AGlezB
Copy link

AGlezB commented Feb 7, 2025

qBittorrent & operating system versions

qBittorrent: v5.0.3 (64-bit)
Operating system: Windows 10 Pro x64 (22H2) 19045.5371
Qt: 6.7.3
Libtorrent: 2.0.11.0
Boost: 1.86.0
OpenSSL: 3.4.0
zlib: 1.3.1

What is the problem?

After waking up from sleep, qBittorrent's window size is set to 1024x768 a moved to the top-left corner of the screen.
The reason I'm reporting this as a bug is that all other applications maintain window size and possition as expected. Only qBittorrent has this issue.

Steps to reproduce

IMPORTANT:
Do not try to replicate the issue by manually turning off the monitor. I tried and for some reason the issue only happens when the monitors enter sleep mode via Windows APM. It is possible the issue can be replicated by manually disconnecting the signal cable from the monitor.

  1. Copy qbittorrent.exe to a new folder
  2. Create a profile folder in the same location
  3. Run it
  4. Check the Behavior\Desktop\Minimize qbittorrent to notification area

Image

  1. Resize and move the window as shown here:

Image

The window size in the image is about 1720x1020 on a 1440p desktop. The important part is for the windows to be larger than 1024x768.

  1. Minimize the qbittorrent to the tray:

Image

  1. Lock the session and wait for the monitors to enter sleep mode.
  2. Press a key and wait for the monitor to wake up and Windows to show the login screen.
  3. Log back in.
  4. Restore qbittorrent from the tray. It will look like this:

Image

Check the size of the window, it should be 1024x768.

Additional context

My best guess about the cause is the monitors are detected as "disconnected" by Windows when they enter sleep mode. This causes the desktop to resize to the default size (1024x768). At that resolution qBittorrent's window is out of bounds so it reacts by repositioning and resizing, which souldn't happen because the window was minimized. Then the monitors come back online and Windows restores the desktop to 1440p and every other application remains in the size and position where I left them when I locked the session. All except qBittorrent, that is.

I don't know if this a Qt issue or a qBittorrent one but I can say for certain this didn't happen with qBittorrent v4.6.6 (qbittorrent_4.6.6_lt20_qt6_x64_setup.exe) which is the last v4 I used before upgrading to v5.

My PC is configured with the HP power plan and to never go to sleep, like this:

Image

Image

I have dual 1440p monitors connected via DisplayPort and the normal behavior when I lock the session is for the monitors to enter sleep mode a few seconds after locking. In my case the monitors first display a black screen and then a message indicating the DP signal was lost and a few seconds after that they enter sleep mode. That signal loss message is why I pointed out the issue might be replicating by disconnectin the DP cable. I don't know if this can be replicated with HDMI instead of DP but it is very like since the issue only requires Windows to "loose" the monitors for the desktop to revert to 1024x768.

In case it was a problem with the dual-monitor setup I tested this with one monitor disconnected and the issue still happens regrdless of the number of monitors.

Log(s) & preferences file(s)

qBittorrent doesn't log desktop size change events.

@thalieht thalieht added the GUI GUI-related issues/changes label Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI GUI-related issues/changes
Projects
None yet
Development

No branches or pull requests

2 participants