ihhub / fheroes2

fheroes2 is a recreation of Heroes of Might and Magic II game engine.
https://ihhub.github.io/fheroes2/
GNU General Public License v2.0
2.71k stars 375 forks source link

Program screen goes completely black after the program is minimized in taskbar and then brought to the foreground #6036

Open LeHerosInconnu opened 2 years ago

LeHerosInconnu commented 2 years ago

Preliminary checks

Platform

Windows

Describe the bug

In windowed mode (when a View spell is active or the View World screen is used), when the game window is minimized in the taskbar, then the game is brought to the foreground (by clicking on the game icon in the taskbar), the game window is completely black (or sometimes completely white). It is necessary to switch to another program (by clicking its icon in the taskbar) and then return to the game window (again by clicking its icon in the taskbar) so that the content of the window is displayed correctly.

In fheroes2:

View spells 001

View spells 002

Save file

Not needed.

Additional info

Related closed issue: https://github.com/ihhub/fheroes2/issues/3392.

zenseii commented 2 years ago

This is a different OS (Linux), but it might be relevant: https://github.com/ihhub/fheroes2/issues/4770

oleg-derevenetz commented 2 years ago

Interesting, I was not able to reproduce this issue so far using the "View World" screen. Is this observed with SDL1 or SDL2? What resolution is set in the game?

LeHerosInconnu commented 2 years ago

Hello @oleg-derevenetz,

Interesting, I was not able to reproduce this issue so far using the "View World" screen. Is this observed with SDL1 or SDL2? What resolution is set in the game?

Windows 7 - 64 bits - SDL2 - 640 x 480

zenseii commented 2 years ago

I tested this on my 32-bit Win 7 SDL2 and I was able to replicate it. I had version 0.9.14 on the same PC and it did not show this behavior when restoring from minimized. It did not happen on my Win 10 device.

ihhub commented 2 years ago

These symptoms indicate that we do not refresh frame for this dialog. I think we can come up with something simple and efficient at the same time by calling an internal sdl function to refresh screen.

ihhub commented 1 year ago

Hi @LeHerosInconnu , can you please test the latest build to se if the issue is gone?

zenseii commented 1 year ago

Hi, @ihhub. I tested this on my win 7 x86 setup with latest SDL2 snapshot and the problem was still reproducible.

LeHerosInconnu commented 1 year ago

Hello @ihhub,

Hi @LeHerosInconnu , can you please test the latest build to se if the issue is gone?

This is still the case on Windows 7 - 64 bits - SDL2 - 640 x 480, with version 0.9.21 6251.

ihhub commented 1 year ago

Hi, @ihhub. I tested this on my win 7 x86 setup with latest SDL2 snapshot and the problem was still reproducible.

Could you please run the engine in debug mode and then attach the log file? I would like to see if there is something related to SDL.