591ef71c5db2fd51393a8c94401d89b641d83d63
[AGL/meta-agl-demo.git] / recipes-qt / qt / qtwayland / 0002-qwaylandwindow-add-support-for-IVI-Surface-ID-proper.patch
1 From 31c60aedf415fd06b5c1aa16fdcef1504b67b96d Mon Sep 17 00:00:00 2001
2 From: Holger Behrens <holger.behrens@windriver.com>
3 Date: Tue, 3 Feb 2015 09:53:43 +0100
4 Subject: [meta-ivi-demo][PATCH 2/2] qwaylandwindow: add support for
5  IVI-Surface-ID property
6
7 Signed-off-by: Holger Behrens <holger.behrens@windriver.com>
8 ---
9  src/client/qwaylandwindow.cpp | 9 ++++++++-
10  1 file changed, 8 insertions(+), 1 deletion(-)
11
12 diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
13 index 45a58f2..781081a 100644
14 --- a/src/client/qwaylandwindow.cpp
15 +++ b/src/client/qwaylandwindow.cpp
16 @@ -100,7 +100,14 @@ QWaylandWindow::QWaylandWindow(QWindow *window)
17  
18      if (!(window->flags() & Qt::BypassWindowManagerHint)) {
19          if (mDisplay->shellIvi()) {
20 -                mShellSurface = new QWaylandIviSurface(mDisplay->shellIvi()->surface_create(IVI_SURFACE_ID + getpid(), object()), this);
21 +                unsigned int id = 0;
22 +                QVariant value = window->property("IVI-Surface-ID");
23 +                if (value.isValid()) {
24 +                    id = value.toUInt();
25 +                } else {
26 +                    id = IVI_SURFACE_ID + getpid();
27 +                }
28 +                mShellSurface = new QWaylandIviSurface(mDisplay->shellIvi()->surface_create(id, object()), this);
29          } else if (mDisplay->shellXdg()) {
30             if (window->type() & Qt::Window) {
31                  mShellSurface = new QWaylandXdgSurface(mDisplay->shellXdg()->get_xdg_surface(object()), this);
32 -- 
33 2.2.1
34