Abdelrazak Younes wrote:
Pavel Sanda wrote:
Sebastian Guttenberg wrote:
(and perhaps simple to implement?)

i don't know how to do it easily. also note that this fullscreen stuff
is more fragile part of code since every arch like win/linux/mac works
slightly different and every touch can work in other way in different
systems.
The Alt key handling is directly handled by Qt. The solution is to catch this key in the same way we catch the Tab key in GuiView::event() (see QEvent::ShortcutOverride). Then, if we are in fullscreen mode _and_ the menubar is hidden _and_ the pressed key is Alt, we should show the menubar.
This patch does exactly that. The problem is that the menubar is not hidden again afterwards. Is that acceptable? If not, are you interested in doing this last bit Pavel?

Abdel.

Index: GuiView.cpp
===================================================================
--- GuiView.cpp (revision 24780)
+++ GuiView.cpp (working copy)
@@ -641,12 +641,19 @@
        }
 
        case QEvent::ShortcutOverride: {
+               QKeyEvent * ke = static_cast<QKeyEvent*>(e);
+
+               if (ke->modifiers() & Qt::AltModifier && isFullScreen()
+                       && menuBar()->isHidden()) {
+                               menuBar()->show();
+                       // Continue with even.
+                       return QMainWindow::event(e);
+               }
+
                if (d.current_work_area_)
                        // Nothing special to do.
                        return QMainWindow::event(e);
 
-               QKeyEvent * ke = static_cast<QKeyEvent*>(e);
-
                // Let Qt handle menu access and the Tab keys to navigate keys 
to navigate
                // between controls.
                if (ke->modifiers() & Qt::AltModifier || ke->key() == 
Qt::Key_Tab 

Reply via email to