ppy / osu

rhythm is just a *click* away!
https://osu.ppy.sh
MIT License
15.07k stars 2.23k forks source link

Black screen on reopening minimized lazer window #1512

Closed Iodid closed 6 years ago

Iodid commented 6 years ago

Part of the problems mentioned in #1473 were fixed with ppy/osu-framework#1146 in version 2017.1111.0 First problem mentioned in #1473 still remains as in version 2017.1116.0

black screen on bringing lazer window back up; highly reproduceable The music is still playing, but you can't directly interact with the (now vanished) window content with your mouse anymore. Keyboard input doesn't work as well. When you try to exit lazer using alt+F4 or with the 'x' on the window border the "see you next time" jingle plays, but the window doesn't close. The window closes only after pressing alt+F4 or the 'x' a second time. On the black screen the fps rises to 6000+ from ~1500 during the regular working main menu. The issue is highly reproduceable for me and is not limited to the main menu.

Another small note: Those problems seem to be windowed mode specific. I couldn't reproduce them with either borderless-window or fullscreen yet.

Obviously since it's impossible to minimze borderless windows or fullscreen. Having lazer in the background instead of minimizing it provides no problems and works fine.

LovelyA72 commented 6 years ago

Hightly agree. It happends on me everytime.

btw: in china we said:''the best music player in china is music163 and the next is osu!''. that will make it very hard to be a music player if i can not minimize it. :D

peppy commented 6 years ago

Which windows version are you on to make this happen?

Can't replicate on MacOS or Windows 10.

Iodid commented 6 years ago

Happens to me on Windows 10 Pro; version 1709; build 16299.19 Though I doubt that it has something to do with it, I'm using a Nvidia GTX 980

When I hover over the taskbar and look at the windows 10 "window preview" it shows me a static image of the screen from the moment I minimized it.

Iodid commented 6 years ago

Okay, I've pinned down the cause of the problem:

The issue only occurs when you have the framerate limiter set to any value over VSync. I don't know if it may have something to do with me having a 144hz refreshrate monitor. Can anyone confirm having the same issue with 60hz refreshrate and with framelimter set to anything over VSync?

If you enable the show fps setting and reopen the minimized window the screen is still black and it doesn't register input like posted above, but the fps display is still visible and working.

peppy commented 6 years ago

Are you reproducing on the live build of lazer?

Iodid commented 6 years ago

I have reproduced it in build 2017.1116.0

Psyborg8 commented 6 years ago

Test results on latest build, Windows 10, NVidia GTX 1070

@ 90Hz - VSync = False @ 90Hz - 4x refresh rate = True @ 90Hz - Unlimited = True

@ 60Hz - VSync = False @ 60Hz - 4x refresh rate = False @ 60Hz - Unlimited = False

@ 50Hz - VSync = False @ 50Hz - 4x refresh rate = True @ 50Hz - Unlimited = True

So yeah, it doesn't like refresh rates that aren't 60Hz without VSync. Tested with and without GSync for complete-ness sake, didn't make a difference.

MattiaPette commented 6 years ago

I also tried with a 144hz monitor, can confirm @PsYcHo96 tests also for 144Hz

VPeruS commented 6 years ago

https://github.com/ppy/osu-framework/blob/48ea66774c76427b871b71c6c5f4e01ebecf1af2/osu.Framework/Platform/Windows/WindowsGameHost.cs#L30. Maybe opentk didn't send event?

LovelyA72 commented 6 years ago

Here are some test that i done on my laptop tested on lazer 2017.1116, Windows 10 Pro, NVidia Quadro M2000M

I am using my built-in display (Lenovo ThinkPad LEN40BD) @ 60Hz - VSync = Sometimes happends (first time ok but happends on the next time, still able to see the frame counter) @ 60Hz - 4x = Happend (still able to see the frame counter) @ 60Hz - Unlimited = Happend (still able to see the frame counter)

Hope it can provide some extra test data :)

PoULkY commented 6 years ago

Hello I don't know if this will fix issue When i debug it, looks like initial window coordinate is not valid (even Y coordinate is NaN)

1

When i force it to zero, it works

2

Hope it helps

peppy commented 6 years ago

Nice find, that definitely sounds like something which could cause this to happen.

peppy commented 6 years ago

@PoULkY when the value is NaN, what does your WindowedPositionY look like in your framework.ini file?

PoULkY commented 6 years ago

Sorry but when i run it again, it become normal so i can't reproduce the error again. But when i try change WindowedPositionY in framework.ini file, it doesn't change WindowedPositionY variable.

And i found that looks like InitialiseDefaults() function in FrameworkConfigManager.cs is not sync with framework.ini When i close osu, some configuration in InitialiseDefaults() is not saved to framework.ini file.

image

2 issues here :

Maybe this is not answer your question regarding NaN window coordinate problems, but i hope this info will help.

peppy commented 6 years ago

Are you sure you're looking at the right configuration file? Is the modified date up-to-date? Sounds very weird that it'd be out of sync. I can confirm it's saving correctly at my end.

PoULkY commented 6 years ago

Oops, looks like my mistake. You're right, my file is synced perfectly. I thought that by change Set() function parameter in FrameworkConfigManager will change value in framework.ini file as well.

Not opening osu project for a long time makes me confuse with all this code here and there. Sorry

FreezyLemon commented 6 years ago

Image For reference.

Just had this issue a moment ago, and from looking around in the Draw Visualiser (Ctrl + F1, that and also the performance overlay still worked) I could see that the OsuGameDesktop instance and the Container one instance below it are still "fine" (as in, still display, and have correct values from what I can tell). However, the first child of the Container (the DrawSizePreservingFillContainer) has some weird values: Firstly, IsPresent is false, meaning it's not displaying (that's why the screen is black, or seems to be why). Then, all the DrawSize variables (and related LayoutSize, LayoutRectangle, etc.) were 1000x that of the OsuGameDesktop, the Height was 999.9999 instead of 1 (I'm always comparing these values to the OsuGameDesktop values) and the Scale was 0.001 instead of 1.

This is all I could find before it crashed again when trying to access more values. Hope this helps