I am having some trouble implementing a tri-state fullscreen mode in GTK.
The idea is to cycle between not-fullscreen, fullscreen with menu & statusbar, and fullscreen without menu and statusbar.
So I have code like this:
Code: Select all
void MainWindowFrame::OnViewFullscreen(wxCommandEvent &event)
{
unsigned int flags;
switch(fullscreenState)
{
case 0:
{
flags= wxFULLSCREEN_NOTOOLBAR | wxFULLSCREEN_NOTOOLBAR | wxFULLSCREEN_NOTOOLBAR;
ShowFullScreen(true,flags);
break;
}
case 1:
{
//ShowFullScreen(false);
//SendSizeEvent(); // PRocess the sizeing of the window
ShowFullScreen(true);
break;
}
case 2:
ShowFullScreen(false);
break;
default:
ASSERT(false);
}
fullscreenState++;
fullscreenState%=3;
}
On the other GTK box (Debian testing/experimental) it doesn't work at all in either case.
I have not tested this under any other systems.
I tried using delay timers to alter the behaviour (no apparent effect, good or bad), and I tried putting in the SendSizeEvent() call in the middle. I have also tried reversing case 0 and case 1 (adding the status/menu bar, rather than hiding it).
Any other ideas? I can use either fullscreen mode independently, I just can't switch between them. Perhaps someone has some good thoughts?
Thanks