moonlight-qt icon indicating copy to clipboard operation
moonlight-qt copied to clipboard

Maximized window keeps gap on top

Open reloxx13 opened this issue 2 years ago • 3 comments

Describe the bug After some time playing and switching fullscreen/window mode (switching max and non-maximized) with the ctrl+alt+shift+x shortcut, tab-ing in and out and I decide to keep the screen in maximize mode not in fullscreen mode, it won't maximize completely and keeps a gap on top while the bottom of the moonlight window is hidden under my taskbar.
This bug exists for a long time now and I was so annoyed now that I had to open an issue :D

I guess it has something to do with my taskbar having the double size (on purpose).

Steps to reproduce it happens randomly by often switching fullscreen, window, maximized window, non-maximized windows mode. Literally:

  • Start a stream
  • Switch window to maximize
  • Switch to Fullscreen
  • Disable fullscreen
  • Maximize has gap now

Screenshots grafik

More screenshots at next comment

Affected games It's a client issue, not a host issue.
Appeared in different games/app.

Moonlight settings (please complete the following information)

  • Have any settings been adjusted from defaults? Yes
  • If so, which settings have been changed? I don't know?!
  • Does the problem still occur after reverting settings back to default? I didn't try, but I think so, as it happens for a long time already.

Client PC details (please complete the following information)

  • OS: win10x64
  • Moonlight Version: 4.1.0
  • GPU: 860M,
  • 1080p resolution

Server PC details (please complete the following information)

  • OS: win10x64
  • GeForce Experience version: 3.25.1.27
  • Nvidia GPU driver: 512.95
  • Antivirus and firewall software: Windows Defender and Windows Firewall

Moonlight Logs (please attach) I'll upload if it happens again.

reloxx13 avatar May 30 '22 18:05 reloxx13

It just happened again, play around with maximize, normal and fullscreen and at some point maximize will keep a gap on top of it

Top gap grafik

Bottom client taskbar is hiding/overlapping host taskbar.
The host taskbar is the default size.
grafik

This only happens with moonlight client, never had it happen with other apps/programs

Moonlight-1653936320.zip

reloxx13 avatar May 30 '22 18:05 reloxx13

Yep, this is a known issue due to how Moonlight is re-entering windowed mode after exiting full-screen. This code is very sensitive to slight variance in OS behavior and timing. We have to do all the steps in very particular order otherwise we end up with worse issues.

I tried to fix this in https://github.com/moonlight-stream/moonlight-qt/commit/38396b26919d56dab02e3e06e7791ef9b748bacf but had to revert due to the issues described in https://github.com/moonlight-stream/moonlight-qt/commit/f10b547a498ee94ca225acd5809e8a5621cf34ea

I will probably take another stab at it eventually, but it's not high on my list given how minor the issue is and the high risk of breaking something else.

cgutman avatar May 31 '22 00:05 cgutman

Heya,

if i look at it, it set the window to center, while the window size itself is correct.

In my described problem, this SDL center function does not calculate the taskbar height to the horizontal center calculation, it takes the hole screen size.

If its possible to detect that the window "maximize" btn was triggered and not normal resized, you may force it to x,y = 0 (or maybe its fine not centering it with the function)

https://github.com/moonlight-stream/moonlight-qt/blob/1b96b18bc03b55d6da5c699284bd2e33039b82c0/app/streaming/session.cpp#L975

window size height = display height- taskbar,
center horizontal ignoring taskbar will leave a gap on top and bottom and in my case overlapping taskbar.

EDIT (some googling):

SDL_GetWindowFlags(), check the SDL_WINDOW_MINIMIZED & SDL_WINDOW_MAXIMIZED bits.

reloxx13 avatar May 31 '22 08:05 reloxx13

Closing per https://github.com/moonlight-stream/moonlight-qt/commit/e0fb7dfd14d47d28b04a5e15049d53f494c7efdd#commitcomment-87409606

cgutman avatar Oct 23 '22 18:10 cgutman