ShowFullScreen problem on Windows 7

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
Earned a small fee
Earned a small fee
Posts: 11
Joined: Thu Feb 24, 2011 1:46 am

ShowFullScreen problem on Windows 7

Post by TriKri » Sun Jul 10, 2011 1:24 pm

This is more of a bug report, but I don't know where to post it, so I'll just put it here. Besides, I don't know whether this is a platform specific issue or not, but I think it may be and I didn't find any other suitable forum to post it in. If there is some mailing list I should send this to instead I could do so.

Okay, to the problem. I'm running Windows 7 and I'm using wxWidgets 2.8.11. If I call ShowFullScreen(true, wxFULLSCREEN_ALL) on my wxFrame before I have called Show(), the program starts to behave really weirdly if I later call ShowFullScreen(false, wxFULLSCREEN_ALL). I lose contact with the window; I can't interact with it in any other way than via the keyboard (Enter works and currently quits my program, since I couldn't connect escape to any menu item, and F1 will successfully bring up a help dialog), I can't move it or close it with the mouse (I will click right through it selecting the desktop), and the wxGLCanvas I have on it doesn't work properly anymore (it goes black, but that could just be the corner of my old fullscreened canvas). Turning the frame back to fullscreen mode again doesn't work either. Anyway, if I only call Show() before I turn the frame into fullscreen, I don't experience the problem. According to the ShowFullScreen reference page it's supposed to Show() the wxTopLevelWindow it's called on too if that hasn't already been done.

In need of some credit
In need of some credit
Posts: 1
Joined: Mon Feb 06, 2012 11:38 am

Re: ShowFullScreen problem on Windows 7

Post by MackanGyver » Fri Feb 28, 2014 11:44 am

I know this post is really really old. I have however the exact same problem on windows 7 64 bit. I searched the bug reports but could not find it, should I add a description of the issue there or has this been considered already? So to reiterate, starting and showing in full screen works fine, but if I use ShowFullScreen( false, wxFULLSCREEN_ALL ) it restores to a window which is not useable at all.

I tested this on 32 and 64 bit with wxWidgets 2.9.5 and 3.0 (since those are what I had installed on my system).

I also investigated into the source code and it seem to me like the problem is in src/msw/toplevel.cpp in the wxTopLevelWindowMSW::ShowFullScreen function line 1081 in wxWidgets 3.0.0. Just to be safe I post the line here:

Code: Select all

m_fsOldWindowStyle = GetWindowLong(GetHwnd(), GWL_STYLE);
The return value from GetWindowLong with GWL_STYLE differs depending on whether the window has been shown or not before call to ShowFullScreen. Could be so that the first call to the winapi call ShowWindow function is required for GWL_STYLE to be set to the desired style.

Possible "fixes":
1. Update documentation to talk about this issue on windows with ShowFullScreen.
2. Use SetWindowLong to set the style directly after window creation? Just to see if GetWindowLong will return the desired style then.
3. Use SetWindowLongPtr/GetWindowLongPtr or whatever the function is called on 64 bit windows. I did not investigate to see if this is already done for 64 bit builds. I doubt this will fix anything regarding this issue though.

User avatar
Posts: 14888
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: ShowFullScreen problem on Windows 7

Post by doublemax » Fri Feb 28, 2014 12:45 pm

I haven't checked the code in detail, but your explanation makes sense.

However, this is a user forum. Please open a bug report here:
Use the source, Luke!

Knows some wx things
Knows some wx things
Posts: 47
Joined: Tue Mar 23, 2010 1:31 pm
Location: Romania

Re: ShowFullScreen problem on Windows 7

Post by modoran » Mon Mar 03, 2014 5:49 pm

While waiting fow wxWidgets developers to fix this issue (if they ever will fix it) you can go with your own implementation based on winapi.

There is an StackOverflow question with an example how it is done in Chromium: ... ng-taskbar

Post Reply