realXtend / tundra

realXtend Tundra SDK, a 3D virtual world application platform.
www.realxtend.org
Apache License 2.0
84 stars 70 forks source link

Hide the menu bar when in full screen mode #739

Open Stinkfist0 opened 10 years ago

Stinkfist0 commented 10 years ago

Proposing that the menu bar would be hidden when the main application window is in the full screen mode. Menu bar would be shown when Alt (key probably configurable via key bindings) is pressed, or alternatively/additionally when mouse is hovered on the top area. Preferred place for the functionality would be in the MenuBar.js jsplugin.

antont commented 10 years ago

+1 - clean fullscreen is an essential basic, I didn't realize we didn't have it now -- I think because for presentations etc. I've used Ubuntu where the menu bar is in the desktop top bar thing, mac style, and when presenting that is on the laptop screen only whereas Tundra is clear fullscreen in the projector.

jonnenauha commented 10 years ago

Afaik if you use --fullscreen the menu is hidden, because this fullscreen is set to Ogre which makes the rendering windows go full screen. If you use Ctrl+F it will toggle the QMainWindow full screen mode, which is a different thing.

I remember doing these fixes to --fullscreen as the Qt QMenuBar was not hidden, it did not show on the rendering but it shifted the Ogre rendering ~25px down and resulted in rendering errors. This is when we made the Meshmoon CAVE stuff.

So essentially --fullscreen already does what you are asking. Toggling the full screen mode of the Qt main window does not, but making the menubar hide/show on this is trivial. You might need to let Ogre know that the menu is hidden, because at the moment the Ogre windowId is given to our QGraphicsView not to the QMainWindow, this is done so that Ogre does not render below the QMenuBar or anything else we decide to put in there. I assume actually that the QGraphicsView resize events will make Ogre adjust its "rendering window" size already, if not it needs to be forced by our main window when the bar is hidden.

Stinkfist0 commented 10 years ago

--fullscreen does not seem to hide the menu bar, and don't think it ever has. Also, IIRC, --fullscreen does not do anything "real" (hardware fullscreen) on the Ogre-side. This would be BTW nice to test, but probably it doesn't work work properly in Ogre+Qt environment if it has not been enabled to begin with. And yes, the changes required to hide the menu bar are pretty trivial and the only real question is whether the core team agrees with my idea.

jonnenauha commented 10 years ago

I remembered wrong. Hiding the menu and the render bugs if menu was shown was in --ogrecapturetopwindow and i fixed it there https://github.com/Adminotech/tundra/blob/admino_tundra/src/Core/OgreRenderingModule/Renderer.cpp?source=cc#L502

This is used when you want proper fullscreen CAVE rendering,

Also if you look further I believe fullscreen does affect the ogre window creation parameters and it makes the Ogre renderin fullscreen.

Our cave executable has --fullscreen --ogrecapturetopwindow and it was the latter that hides the menubar. It also makes us give the main windows window handle instead of the graphics views which is again needed for proper CAVE stuff. Make sure that you never show the menubar even if you move mouse to the top if --ogrecapturetopwindow is defined. It will "break" the rendering afaik aka shift the image so it looks crappy and clicking on UI buttons on the overlay has the same offset, so you click past stuff in Qt even if you hit on the texture.