Alt-Tab and UI disappearing

Jul 5, 2012 at 5:20 AM
Edited Jul 5, 2012 at 7:12 AM

When alt-tabbing back to an IGF game (Ace for example), any menus that were shown become invisible. This also seems to happen with some other UI items, but the 3d scene seems fine.

Edit: This only happens when the window is hidden (minimized, behind another window), simply losing focus does not cause it.

Is anyone else experiencing this issue? 

Jul 5, 2012 at 10:10 PM

Yep. Pretty sure it's just that the GUI doesn't get refreshed when you come back to the window-- which is probably not that hard a fix, I'd think-- but I haven't really poked at it since it's a low priority for my development at the moment.

Jul 9, 2012 at 9:01 AM

This is a bug related to how the GUI is linked to the GraphicsDevice reset/dispose events. I didn't found a good way to fix this so if any of you come up with a good solution, feel free to share it so others can get it ;)

Jul 10, 2012 at 12:52 AM

I figured it was related to the GraphicsDevice reset. I'll look into it and see if I can come up with something. What is your preferred method of code contribution?

Coordinator
Jul 10, 2012 at 7:52 PM

Ideally, I'd love to actually move IGF to git instead of the current TFS and thus allowing cloning and Pull requests... Until then, I guess, the best would be to make a patch and submit it in the source code tab.

Jul 10, 2012 at 8:01 PM

Ah, I to would love to see IGF in a git repo.

Jul 11, 2012 at 8:45 AM

Personally, I'd be happy if we could pull with Mercurial, but I don't recall if codeplex's Hg hosting is team-internal or generally available. Though Git and Hg are so similar it doesn't really matter that much to me which one gets used.

Jul 12, 2012 at 6:12 AM
Edited Jul 12, 2012 at 6:17 AM

Adding

 

Application.Graphics.DeviceReset += (sender, args) =>
{
    foreach (Control control in _controls)
    {
        ((IGuiElement)control).Invalidate();
    }
};

to the Indiefreaks.Xna.Rendering.Gui.Screen class seems to work for my implementation. This could probably be improved upon with some IsVisible checks etc, but this is the simplest form I could think of. 

It might be better to put this in the GuiManager, to make sure the screen is visible.