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.
ShowFullScreen problem on Windows 7
-
- In need of some credit
- Posts: 1
- Joined: Mon Feb 06, 2012 11:38 am
Re: ShowFullScreen problem on Windows 7
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:
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.
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);
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.
Re: ShowFullScreen problem on Windows 7
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: http://trac.wxwidgets.org/
However, this is a user forum. Please open a bug report here: http://trac.wxwidgets.org/
Use the source, Luke!
Re: ShowFullScreen problem on Windows 7
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:
http://stackoverflow.com/questions/2382 ... ng-taskbar
There is an StackOverflow question with an example how it is done in Chromium:
http://stackoverflow.com/questions/2382 ... ng-taskbar