✔️ FIXED BUG: Hardware Doesn’t Always Show

Eggheads talking about bytes and stuff.
Post Reply
User avatar
Krishty
Site Admin
Posts: 1364
Joined: 2022-Jan-09, 00:59

✔️ FIXED BUG: Hardware Doesn’t Always Show

Post by Krishty »

If you have connected a Joystick to your computer, it doesn’t always show up under Settings > Hardware. Sometimes you have to go to another settings screen (e.g. View) and back before it appears.

This is caused by the hardware dialog activating too early. This, in turn, happens due to a strange property of Win32:

If a window becomes visible or hidden, it receives the WM_SHOWWINDOW message. The visible state of child windows, however, is overridden by their parent: If you hide the parent, then the child is hidden as well, even if it was visible before. So far so good. But if you then make the parent visible again, the child window does not receive WM_SHOWWINDOW message even though it just became visible again. This is probably because its visibility flag hasn’t changed, only its parent’s has.

Anyway. I implicitly built on this behavior by making the hardware dialog visible during initialization. One cannot see it because its parent, the Settings window, is hidden until you open it – but the flag is set and so the hardware settings do not receive WM_SHOWWINDOW when you first visit the screen, thus displaying a potentially incomplete state from during initialization.
User avatar
Krishty
Site Admin
Posts: 1364
Joined: 2022-Jan-09, 00:59

Re: ✔️ FIXED BUG: Hardware Doesn’t Always Show

Post by Krishty »

Fix has landed.
Post Reply