From dcbd920daf92d80302633f73dd8324437005a10e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Zaj=C4=85c?= <quintasan@kubuntu.org>
Date: Fri, 13 May 2011 10:39:34 +0200
Subject: Retain ABI and API compatibility when Qt is built with EGL.

Author: Felix Geyer <debfx-pkg@fobos.de>

Merge-request: 1230
Reviewed-by: ossi
---
 src/opengl/qgl.h          |  2 +-
 src/opengl/qgl_x11egl.cpp | 14 ++++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/src/opengl/qgl.h b/src/opengl/qgl.h
index c57995d..ab88d9c 100644
--- a/src/opengl/qgl.h
+++ b/src/opengl/qgl.h
@@ -401,7 +401,7 @@ protected:
 #if defined(Q_WS_WIN)
     virtual int choosePixelFormat(void* pfd, HDC pdc);
 #endif
-#if defined(Q_WS_X11) && defined(QT_NO_EGL)
+#if defined(Q_WS_X11)
     virtual void* tryVisual(const QGLFormat& f, int bufDepth = 1);
     virtual void* chooseVisual();
 #endif
diff --git a/src/opengl/qgl_x11egl.cpp b/src/opengl/qgl_x11egl.cpp
index 2ddfd35..34ca97d 100644
--- a/src/opengl/qgl_x11egl.cpp
+++ b/src/opengl/qgl_x11egl.cpp
@@ -257,6 +257,20 @@ bool QGLContext::chooseContext(const QGLContext* shareContext)
     return true;
 }
 
+void *QGLContext::chooseVisual()
+{
+    qFatal("QGLContext::chooseVisual - this method must not be called as Qt is built with EGL support");
+    return 0;
+}
+
+void *QGLContext::tryVisual(const QGLFormat& f, int bufDepth)
+{
+    Q_UNUSED(f);
+    Q_UNUSED(bufDepth);
+    qFatal("QGLContext::tryVisual - this method must not be called as Qt is built with EGL support");
+    return 0;
+}
+
 void QGLWidget::resizeEvent(QResizeEvent *)
 {
     Q_D(QGLWidget);
-- 
cgit v0.12


From a45398677309ab905b69c599177b4c2951292b04 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Zaj=C4=85c?= <quintasan@kubuntu.org>
Date: Fri, 13 May 2011 10:40:05 +0200
Subject: X11: Keep the menubar inside the widgetbox window in toplevel mode

For now the appmenu protocol does not make it possible to associate a
menubar with all application windows. This means in top level mode you
can only reach the menubar when the widgetbox window is active. Since
this is quite inconvenient, better not use the native menubar in this
configuration and keep the menubar in the widgetbox window.

Merge-request: 1229
Reviewed-by: denis
---
 tools/designer/src/designer/qdesigner_workbench.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tools/designer/src/designer/qdesigner_workbench.cpp b/tools/designer/src/designer/qdesigner_workbench.cpp
index ffc4b8c..df679eb 100644
--- a/tools/designer/src/designer/qdesigner_workbench.cpp
+++ b/tools/designer/src/designer/qdesigner_workbench.cpp
@@ -410,6 +410,9 @@ void QDesignerWorkbench::switchToDockedMode()
 
     switchToNeutralMode();
 
+#ifdef Q_WS_X11
+    QApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, false);
+#endif
 #ifndef Q_WS_MAC
     QDesignerToolWindow *widgetBoxWrapper = widgetBoxToolWindow();
     widgetBoxWrapper->action()->setVisible(true);
@@ -477,6 +480,14 @@ void QDesignerWorkbench::switchToTopLevelMode()
     // The widget box is special, it gets the menubar and gets to be the main widget.
 
     m_core->setTopLevel(widgetBoxWrapper);
+#ifdef Q_WS_X11
+    // For now the appmenu protocol does not make it possible to associate a
+    // menubar with all application windows. This means in top level mode you
+    // can only reach the menubar when the widgetbox window is active. Since
+    // this is quite inconvenient, better not use the native menubar in this
+    // configuration and keep the menubar in the widgetbox window.
+    QApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, true);
+#endif
 #ifndef Q_WS_MAC
     widgetBoxWrapper->setMenuBar(m_globalMenuBar);
     widgetBoxWrapper->action()->setVisible(false);
-- 
cgit v0.12