Added MultipleWindows platform capability.
authorSamuel Rødal <samuel.rodal@digia.com>
Wed, 31 Oct 2012 11:32:31 +0000 (12:32 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 2 Nov 2012 11:17:27 +0000 (12:17 +0100)
Several platform plugins, like eglfs, kms, etc don't support multiple
windows as there's no system compositor, they're rendering directly to
a single back buffer. By adding a platform capability we'll be able to
provide better error reporting when an application tries to create
multiple QWindows on a single-window platform. Also, QML apps can use
this capability to figure out whether they should create a QWindow for
dialogs / popups / menus, or whether to just create items in the same
scene, that are shown on top of the rest of the content.

Change-Id: I15b8d21ee2bc4568e9d705dbf32f872c2c25742b
Reviewed-by: Andy Nichols <andy.nichols@digia.com>
src/gui/kernel/qplatformintegration.cpp
src/gui/kernel/qplatformintegration.h
src/plugins/platforms/cocoa/qcocoaintegration.mm
src/plugins/platforms/minimal/qminimalintegration.cpp
src/plugins/platforms/windows/qwindowsintegration.cpp
src/plugins/platforms/xcb/qxcbintegration.cpp

index cf55c59..5259ed9 100644 (file)
@@ -195,6 +195,10 @@ QPlatformServices *QPlatformIntegration::services() const
     \value BufferQueueingOpenGL The OpenGL implementation on the platform will queue
     up buffers when swapBuffers() is called and block only when its buffer pipeline
     is full, rather than block immediately.
+
+    \value MultipleWindows The platform supports multiple QWindows, i.e. does some kind
+    of compositing either client or server side. Some platforms might only support a
+    single fullscreen window.
  */
 
 
index 7e88884..b4c8ebf 100644 (file)
@@ -83,11 +83,12 @@ class Q_GUI_EXPORT QPlatformIntegration
 public:
     enum Capability {
         ThreadedPixmaps = 1,
-        OpenGL = 2,
-        ThreadedOpenGL = 3,
-        SharedGraphicsCache = 4,
-        BufferQueueingOpenGL = 5,
-        WindowMasks = 6
+        OpenGL,
+        ThreadedOpenGL,
+        SharedGraphicsCache,
+        BufferQueueingOpenGL,
+        WindowMasks,
+        MultipleWindows
     };
 
     virtual ~QPlatformIntegration() { }
index 2fdb367..481055a 100644 (file)
@@ -309,6 +309,7 @@ bool QCocoaIntegration::hasCapability(QPlatformIntegration::Capability cap) cons
     case ThreadedOpenGL:
     case BufferQueueingOpenGL:
     case WindowMasks:
+    case MultipleWindows:
         return true;
     default:
         return QPlatformIntegration::hasCapability(cap);
index 6a2db91..e9fab6d 100644 (file)
@@ -74,6 +74,7 @@ bool QMinimalIntegration::hasCapability(QPlatformIntegration::Capability cap) co
 {
     switch (cap) {
     case ThreadedPixmaps: return true;
+    case MultipleWindows: return true;
     default: return QPlatformIntegration::hasCapability(cap);
     }
 }
index 3f030ff..a02f0cd 100644 (file)
@@ -338,6 +338,8 @@ bool QWindowsIntegration::hasCapability(QPlatformIntegration::Capability cap) co
 #endif // !QT_NO_OPENGL
     case WindowMasks:
         return true;
+    case MultipleWindows:
+        return true;
     default:
         return QPlatformIntegration::hasCapability(cap);
     }
index a46d511..2ffe53c 100644 (file)
@@ -216,6 +216,7 @@ bool QXcbIntegration::hasCapability(QPlatformIntegration::Capability cap) const
 #endif
     case ThreadedOpenGL: return false;
     case WindowMasks: return true;
+    case MultipleWindows: return true;
     default: return QPlatformIntegration::hasCapability(cap);
     }
 }