Merge lp:~aacid/qtmir/system_includes into lp:qtmir

Proposed by Albert Astals Cid
Status: Superseded
Proposed branch: lp:~aacid/qtmir/system_includes
Merge into: lp:qtmir
Prerequisite: lp:~ci-train-bot/qtmir/qtmir-ubuntu-yakkety-landing-025
Diff against target: 1102 lines (+197/-357)
32 files modified
CMakeLists.txt (+7/-6)
debian/changelog (+25/-0)
debian/control (+2/-2)
debian/gles-patches/convert-to-gles.patch (+1/-1)
demos/qml-demo-client/CMakeLists.txt (+3/-6)
demos/qml-demo-shell/CMakeLists.txt (+3/-6)
src/modules/Unity/Application/CMakeLists.txt (+6/-3)
src/modules/Unity/Application/mirsurface.cpp (+36/-0)
src/modules/Unity/Application/mirsurface.h (+8/-1)
src/modules/Unity/Application/mirsurfaceinterface.h (+2/-0)
src/modules/Unity/Application/mirsurfaceitem.cpp (+11/-49)
src/modules/Unity/Application/mirsurfaceitem.h (+1/-2)
src/modules/Unity/Application/plugin.cpp (+0/-10)
src/modules/Unity/Application/ubuntukeyboardinfo.cpp (+0/-173)
src/modules/Unity/Application/ubuntukeyboardinfo.h (+0/-87)
src/modules/Unity/Screens/CMakeLists.txt (+4/-0)
src/platforms/mirserver/CMakeLists.txt (+4/-0)
src/platforms/mirserver/mirwindowmanager.cpp (+9/-4)
src/platforms/mirserver/surfaceobserver.cpp (+20/-0)
src/platforms/mirserver/surfaceobserver.h (+3/-1)
tests/framework/CMakeLists.txt (+5/-1)
tests/framework/fake_mirsurface.h (+5/-2)
tests/mirserver/Clipboard/CMakeLists.txt (+4/-0)
tests/mirserver/QtEventFeeder/CMakeLists.txt (+4/-0)
tests/mirserver/Screen/CMakeLists.txt (+4/-0)
tests/mirserver/ScreensModel/CMakeLists.txt (+4/-0)
tests/mirserver/WindowManager/CMakeLists.txt (+4/-0)
tests/modules/Application/CMakeLists.txt (+4/-1)
tests/modules/ApplicationManager/CMakeLists.txt (+5/-1)
tests/modules/SessionManager/CMakeLists.txt (+5/-1)
tests/modules/SharedWakelock/CMakeLists.txt (+4/-0)
tests/modules/SurfaceManager/CMakeLists.txt (+4/-0)
To merge this branch: bzr merge lp:~aacid/qtmir/system_includes
Reviewer Review Type Date Requested Status
Unity8 CI Bot (community) continuous-integration Needs Fixing
Gerry Boland (community) Approve
Review via email: mp+296598@code.launchpad.net

This proposal supersedes a proposal from 2016-06-06.

This proposal has been superseded by a proposal from 2016-07-15.

Commit message

Mark system includes as such

Description of the change

 * Are there any related MPs required for this MP to build/function as expected?
Prereq

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

To post a comment you must log in.
lp:~aacid/qtmir/system_includes updated
519. By Albert Astals Cid

spacing++

Revision history for this message
Gerry Boland (gerboland) wrote :

Cool, thanks!!

review: Approve
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:518
https://unity8-jenkins.ubuntu.com/job/lp-qtmir-ci/262/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/1886/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1912
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1848
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1848
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1848
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1839/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1839/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1839/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1839/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1839/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1839/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1839/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1839/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1839/console

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-qtmir-ci/262/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:519
https://unity8-jenkins.ubuntu.com/job/lp-qtmir-ci/266/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/1893/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/1919
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/1855
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/1855
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-1-sourcepkg/release=yakkety/1855
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/1846/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/1846/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/1846/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/1846/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/1846/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/1846/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/1846/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/1846/console
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/1846/console

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-qtmir-ci/266/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

This should be good. CI unhappy only as this based on the contents of the latest silo, which has a newer unity-api

lp:~aacid/qtmir/system_includes updated
520. By Albert Astals Cid

Merge lp:~dandrader/qtmir/mirSurfaceInputBounds

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2016-07-01 16:15:54 +0000
+++ CMakeLists.txt 2016-07-15 15:13:44 +0000
@@ -83,22 +83,23 @@
83pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)83pkg_check_modules(GSETTINGS_QT REQUIRED gsettings-qt)
84pkg_check_modules(QTDBUSTEST libqtdbustest-1 REQUIRED)84pkg_check_modules(QTDBUSTEST libqtdbustest-1 REQUIRED)
85pkg_check_modules(QTDBUSMOCK libqtdbusmock-1 REQUIRED)85pkg_check_modules(QTDBUSMOCK libqtdbusmock-1 REQUIRED)
86pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=18)86pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=19)
87pkg_check_modules(CGMANAGER libcgmanager REQUIRED)87pkg_check_modules(CGMANAGER libcgmanager REQUIRED)
8888
89include_directories(SYSTEM ${APPLICATION_API_INCLUDE_DIRS})
90
91
89add_definitions(-DMIR_REQUIRE_DEPRECATED_EVENT_OPT_IN=1)92add_definitions(-DMIR_REQUIRE_DEPRECATED_EVENT_OPT_IN=1)
9093
91# Use the fast string builder94# Use the fast string builder
92add_definitions(-DQT_USE_QSTRINGBUILDER)95add_definitions(-DQT_USE_QSTRINGBUILDER)
9396
94include_directories( ${APPLICATION_API_INCLUDE_DIRS} )
95
96# We expect this to be set via debian/rules for GLES builds97# We expect this to be set via debian/rules for GLES builds
97if ("${USE_OPENGLES}" STREQUAL 1)98if ("${USE_OPENGLES}" STREQUAL 1)
98 message(STATUS "Qt5 determined to be compiled with GLES support")99 message(STATUS "Qt5 determined to be compiled with GLES support")
99 pkg_check_modules(GLESv2 glesv2)100 pkg_check_modules(GLESv2 glesv2)
100 add_definitions(-DQT_USING_GLES)101 add_definitions(-DQT_USING_GLES)
101 include_directories (${GLESv2_INCLUDE_DIRS})102 include_directories (SYSTEM ${GLESv2_INCLUDE_DIRS})
102 set (GL_LIBRARIES "${GLESv2_LIBRARIES}")103 set (GL_LIBRARIES "${GLESv2_LIBRARIES}")
103# Because qt/gl and qt/gles are not parallel installable we have a difficulty104# Because qt/gl and qt/gles are not parallel installable we have a difficulty
104# building qtmir-desktop on armhf. We would like to link against opengl and bind the105# building qtmir-desktop on armhf. We would like to link against opengl and bind the
@@ -109,13 +110,13 @@
109 message(STATUS "Linking against OpenGL ES but binding OpenGL API")110 message(STATUS "Linking against OpenGL ES but binding OpenGL API")
110 pkg_check_modules(GLESv2 glesv2)111 pkg_check_modules(GLESv2 glesv2)
111 add_definitions(-DQT_USING_GL)112 add_definitions(-DQT_USING_GL)
112 include_directories (${GLESv2_INCLUDE_DIRS})113 include_directories (SYSTEM ${GLESv2_INCLUDE_DIRS})
113 set (GL_LIBRARIES "${GLESv2_LIBRARIES}")114 set (GL_LIBRARIES "${GLESv2_LIBRARIES}")
114else()115else()
115 message(STATUS "Qt5 determined to be compiled with OpenGL support")116 message(STATUS "Qt5 determined to be compiled with OpenGL support")
116 pkg_check_modules(GL gl)117 pkg_check_modules(GL gl)
117 add_definitions(-DQT_USING_OPENGL)118 add_definitions(-DQT_USING_OPENGL)
118 include_directories (${GL_INCLUDE_DIRS})119 include_directories (SYSTEM ${GL_INCLUDE_DIRS})
119endif()120endif()
120121
121# Standard install paths122# Standard install paths
122123
=== modified file 'debian/changelog'
--- debian/changelog 2016-07-12 13:39:51 +0000
+++ debian/changelog 2016-07-15 15:13:44 +0000
@@ -49,6 +49,31 @@
4949
50 -- Albert Astals Cid <albert.astals@canonical.com> Tue, 14 Jun 2016 08:38:00 +000050 -- Albert Astals Cid <albert.astals@canonical.com> Tue, 14 Jun 2016 08:38:00 +0000
5151
52qtmir (0.4.8+16.10.20160606.1-0ubuntu1) yakkety; urgency=medium
53
54 [ Albert Astals Cid ]
55 * Add support for compiler sanitizers via ECM
56 * Compile with -fsanitize=undefined
57 * Fix leak in ScreensModelTest (LP: #1585502)
58 * Fix leak in SessionManager test (LP: #1585498)
59 * Remove unused m_sessions member
60 * Add missing breaks
61 * Initialize m_lastX and m_lastY
62 * Initialize m_sessionId
63 * Give the locker a name
64 * Fix memory leak in QtEventFeederTest (LP: #1585503)
65 * Fix leaks in application_manager_test (LP: #1585501)
66
67 [ Daniel d'Andrada ]
68 * Improve Session debug logging
69 * MirSurfaceListModel: prepending a surface always causes
70 firstChanged() emission
71
72 [ Michael Zanetti ]
73 * Adding ApplicationInfo::surfaceCount property
74
75 -- MichaƂ Sawicz <michal.sawicz@canonical.com> Mon, 06 Jun 2016 15:45:57 +0000
76
52qtmir (0.4.8+16.10.20160602-0ubuntu1) yakkety; urgency=medium77qtmir (0.4.8+16.10.20160602-0ubuntu1) yakkety; urgency=medium
5378
54 * rebuild for mir 0.2379 * rebuild for mir 0.23
5580
=== modified file 'debian/control'
--- debian/control 2016-07-12 13:26:59 +0000
+++ debian/control 2016-07-15 15:13:44 +0000
@@ -23,7 +23,7 @@
23 libubuntu-app-launch2-dev (>= 0.9),23 libubuntu-app-launch2-dev (>= 0.9),
24 libubuntu-application-api-dev (>= 2.1.0),24 libubuntu-application-api-dev (>= 2.1.0),
25 libudev-dev,25 libudev-dev,
26 libunity-api-dev (>= 7.114),26 libunity-api-dev (>= 7.116),
27 liburl-dispatcher1-dev,27 liburl-dispatcher1-dev,
28 libxkbcommon-dev,28 libxkbcommon-dev,
29 libxrender-dev,29 libxrender-dev,
@@ -94,7 +94,7 @@
94Conflicts: libqtmir,94Conflicts: libqtmir,
95 libunity-mir1,95 libunity-mir1,
96Provides: unity-application-impl,96Provides: unity-application-impl,
97 unity-application-impl-17,97 unity-application-impl-19,
98Description: Qt plugin for Unity specific Mir APIs98Description: Qt plugin for Unity specific Mir APIs
99 QtMir provides Qt/QML bindings for Mir features that are exposed through the99 QtMir provides Qt/QML bindings for Mir features that are exposed through the
100 qtmir-desktop or qtmir-android QPA plugin such as Application management100 qtmir-desktop or qtmir-android QPA plugin such as Application management
101101
=== modified file 'debian/gles-patches/convert-to-gles.patch'
--- debian/gles-patches/convert-to-gles.patch 2016-07-12 13:38:40 +0000
+++ debian/gles-patches/convert-to-gles.patch 2016-07-15 15:13:44 +0000
@@ -84,7 +84,7 @@
84-Conflicts: libqtmir,84-Conflicts: libqtmir,
85- libunity-mir1,85- libunity-mir1,
86-Provides: unity-application-impl,86-Provides: unity-application-impl,
87- unity-application-impl-17,87- unity-application-impl-19,
88-Description: Qt plugin for Unity specific Mir APIs88-Description: Qt plugin for Unity specific Mir APIs
89- QtMir provides Qt/QML bindings for Mir features that are exposed through the89- QtMir provides Qt/QML bindings for Mir features that are exposed through the
90- qtmir-desktop or qtmir-android QPA plugin such as Application management90- qtmir-desktop or qtmir-android QPA plugin such as Application management
9191
=== modified file 'demos/qml-demo-client/CMakeLists.txt'
--- demos/qml-demo-client/CMakeLists.txt 2015-09-01 16:16:47 +0000
+++ demos/qml-demo-client/CMakeLists.txt 2016-07-15 15:13:44 +0000
@@ -2,19 +2,16 @@
2configure_file(${DEMO_CLIENT}.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/${DEMO_CLIENT}.desktop @ONLY)2configure_file(${DEMO_CLIENT}.desktop.in ${CMAKE_CURRENT_BINARY_DIR}/${DEMO_CLIENT}.desktop @ONLY)
33
4include_directories(4include_directories(
5 SYSTEM
5 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}6 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
7 ${Qt5Qml_PRIVATE_INCLUDE_DIRS}
8 ${Qt5Quick_PRIVATE_INCLUDE_DIRS}
6)9)
710
8add_executable(${DEMO_CLIENT}11add_executable(${DEMO_CLIENT}
9 main.cpp12 main.cpp
10)13)
1114
12include_directories(
13 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
14 ${Qt5Qml_PRIVATE_INCLUDE_DIRS}
15 ${Qt5Quick_PRIVATE_INCLUDE_DIRS}
16)
17
18target_link_libraries(15target_link_libraries(
19 ${DEMO_CLIENT}16 ${DEMO_CLIENT}
20 Qt5::Core17 Qt5::Core
2118
=== modified file 'demos/qml-demo-shell/CMakeLists.txt'
--- demos/qml-demo-shell/CMakeLists.txt 2015-09-01 16:16:47 +0000
+++ demos/qml-demo-shell/CMakeLists.txt 2016-07-15 15:13:44 +0000
@@ -1,19 +1,16 @@
1set(DEMO_SHELL qtmir-demo-shell)1set(DEMO_SHELL qtmir-demo-shell)
22
3include_directories(3include_directories(
4 SYSTEM
4 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}5 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
6 ${Qt5Qml_PRIVATE_INCLUDE_DIRS}
7 ${Qt5Quick_PRIVATE_INCLUDE_DIRS}
5)8)
69
7add_executable(${DEMO_SHELL}10add_executable(${DEMO_SHELL}
8 main.cpp11 main.cpp
9)12)
1013
11include_directories(
12 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
13 ${Qt5Qml_PRIVATE_INCLUDE_DIRS}
14 ${Qt5Quick_PRIVATE_INCLUDE_DIRS}
15)
16
17target_link_libraries(14target_link_libraries(
18 ${DEMO_SHELL}15 ${DEMO_SHELL}
19 Qt5::Core16 Qt5::Core
2017
=== modified file 'src/modules/Unity/Application/CMakeLists.txt'
--- src/modules/Unity/Application/CMakeLists.txt 2016-07-01 16:15:54 +0000
+++ src/modules/Unity/Application/CMakeLists.txt 2016-07-15 15:13:44 +0000
@@ -1,4 +1,10 @@
1include_directories(1include_directories(
2 ${CMAKE_SOURCE_DIR}/src/platforms/mirserver
3 ${CMAKE_SOURCE_DIR}/src/common
4)
5
6include_directories(
7 SYSTEM
2 ${GLIB_INCLUDE_DIRS}8 ${GLIB_INCLUDE_DIRS}
3 ${GIO_INCLUDE_DIRS}9 ${GIO_INCLUDE_DIRS}
4 ${GIO_UNIX_INCLUDE_DIRS}10 ${GIO_UNIX_INCLUDE_DIRS}
@@ -7,8 +13,6 @@
7 ${PROCESS_CPP_INCLUDE_DIRS}13 ${PROCESS_CPP_INCLUDE_DIRS}
8 ${UBUNTU_PLATFORM_API_INCLUDE_DIRS}14 ${UBUNTU_PLATFORM_API_INCLUDE_DIRS}
9 ${UBUNTU_APP_LAUNCH_INCLUDE_DIRS}15 ${UBUNTU_APP_LAUNCH_INCLUDE_DIRS}
10 ${CMAKE_SOURCE_DIR}/src/platforms/mirserver
11 ${CMAKE_SOURCE_DIR}/src/common
12 ${GSETTINGS_QT_INCLUDE_DIRS}16 ${GSETTINGS_QT_INCLUDE_DIRS}
13 ${CGMANAGER_INCLUDE_DIRS}17 ${CGMANAGER_INCLUDE_DIRS}
1418
@@ -33,7 +37,6 @@
33 plugin.cpp37 plugin.cpp
34 dbuswindowstack.cpp38 dbuswindowstack.cpp
35 mirsurfacemanager.cpp39 mirsurfacemanager.cpp
36 ubuntukeyboardinfo.cpp
37 mirfocuscontroller.cpp40 mirfocuscontroller.cpp
38 mirsurface.cpp41 mirsurface.cpp
39 mirsurfaceinterface.h42 mirsurfaceinterface.h
4043
=== modified file 'src/modules/Unity/Application/mirsurface.cpp'
--- src/modules/Unity/Application/mirsurface.cpp 2016-06-23 19:58:48 +0000
+++ src/modules/Unity/Application/mirsurface.cpp 2016-07-15 15:13:44 +0000
@@ -219,6 +219,7 @@
219 connect(observer.get(), &SurfaceObserver::shellChromeChanged, this, [&](MirShellChrome shell_chrome) {219 connect(observer.get(), &SurfaceObserver::shellChromeChanged, this, [&](MirShellChrome shell_chrome) {
220 setShellChrome(static_cast<Mir::ShellChrome>(shell_chrome));220 setShellChrome(static_cast<Mir::ShellChrome>(shell_chrome));
221 });221 });
222 connect(observer.get(), &SurfaceObserver::inputBoundsChanged, this, &MirSurface::setInputBounds);
222 observer->setListener(this);223 observer->setListener(this);
223 }224 }
224225
@@ -277,12 +278,15 @@
277{278{
278 switch (attribute) {279 switch (attribute) {
279 case mir_surface_attrib_type:280 case mir_surface_attrib_type:
281 DEBUG_MSG << " type = " << mirSurfaceTypeToStr(state());
280 Q_EMIT typeChanged(type());282 Q_EMIT typeChanged(type());
281 break;283 break;
282 case mir_surface_attrib_state:284 case mir_surface_attrib_state:
285 DEBUG_MSG << " state = " << mirSurfaceStateToStr(state());
283 Q_EMIT stateChanged(state());286 Q_EMIT stateChanged(state());
284 break;287 break;
285 case mir_surface_attrib_visibility:288 case mir_surface_attrib_visibility:
289 DEBUG_MSG << " visible = " << visible();
286 Q_EMIT visibleChanged(visible());290 Q_EMIT visibleChanged(visible());
287 break;291 break;
288 default:292 default:
@@ -885,6 +889,24 @@
885 m_surface->move_to(Point{ X{targetScreenTopLeftPx.x()}, Y{targetScreenTopLeftPx.y()} });889 m_surface->move_to(Point{ X{targetScreenTopLeftPx.x()}, Y{targetScreenTopLeftPx.y()} });
886}890}
887891
892bool MirSurface::inputAreaContains(const QPoint &point) const
893{
894 bool result;
895
896
897 // Can't use it due to https://bugs.launchpad.net/mir/+bug/1598936
898 // FIXME: Use the line below instead of m_inputBounds once this bug gets fixed.
899 //result = m_surface->input_area_contains(mir::geometry::Point(point.x(), point.y()));
900
901 if (m_inputBounds.isNull()) {
902 result = true;
903 } else {
904 result = m_inputBounds.contains(point);
905 }
906
907 return result;
908}
909
888void MirSurface::setCursor(const QCursor &cursor)910void MirSurface::setCursor(const QCursor &cursor)
889{911{
890 DEBUG_MSG << "(" << qtCursorShapeToStr(cursor.shape()) << ")";912 DEBUG_MSG << "(" << qtCursorShapeToStr(cursor.shape()) << ")";
@@ -976,6 +998,11 @@
976 return m_focused;998 return m_focused;
977}999}
9781000
1001QRect MirSurface::inputBounds() const
1002{
1003 return m_inputBounds;
1004}
1005
979void MirSurface::requestFocus()1006void MirSurface::requestFocus()
980{1007{
981 DEBUG_MSG << "()";1008 DEBUG_MSG << "()";
@@ -1017,3 +1044,12 @@
1017 m_closeTimer->start();1044 m_closeTimer->start();
1018 }1045 }
1019}1046}
1047
1048void MirSurface::setInputBounds(const QRect &rect)
1049{
1050 if (m_inputBounds != rect) {
1051 DEBUG_MSG << "(" << rect << ")";
1052 m_inputBounds = rect;
1053 Q_EMIT inputBoundsChanged(m_inputBounds);
1054 }
1055}
10201056
=== modified file 'src/modules/Unity/Application/mirsurface.h'
--- src/modules/Unity/Application/mirsurface.h 2016-06-23 19:58:48 +0000
+++ src/modules/Unity/Application/mirsurface.h 2016-07-15 15:13:44 +0000
@@ -24,6 +24,7 @@
24#include <QCursor>24#include <QCursor>
25#include <QMutex>25#include <QMutex>
26#include <QPointer>26#include <QPointer>
27#include <QRect>
27#include <QSharedPointer>28#include <QSharedPointer>
28#include <QWeakPointer>29#include <QWeakPointer>
29#include <QSet>30#include <QSet>
@@ -89,6 +90,7 @@
89 int heightIncrement() const override;90 int heightIncrement() const override;
9091
91 bool focused() const override;92 bool focused() const override;
93 QRect inputBounds() const override;
9294
93 Q_INVOKABLE void requestFocus() override;95 Q_INVOKABLE void requestFocus() override;
94 Q_INVOKABLE void close() override;96 Q_INVOKABLE void close() override;
@@ -148,9 +150,11 @@
148150
149 Mir::ShellChrome shellChrome() const override;151 Mir::ShellChrome shellChrome() const override;
150152
153 void setScreen(QScreen *screen) override;
154
151 SessionInterface* session() override { return m_session.data(); }155 SessionInterface* session() override { return m_session.data(); }
152156
153 void setScreen(QScreen *screen) override;157 bool inputAreaContains(const QPoint &) const override;
154158
155 ////159 ////
156 // Own API160 // Own API
@@ -177,6 +181,7 @@
177 void emitSizeChanged();181 void emitSizeChanged();
178 void setCursor(const QCursor &cursor);182 void setCursor(const QCursor &cursor);
179 void onCloseTimedOut();183 void onCloseTimedOut();
184 void setInputBounds(const QRect &rect);
180185
181private:186private:
182 void syncSurfaceSizeWithItemSize();187 void syncSurfaceSizeWithItemSize();
@@ -226,6 +231,8 @@
226 int m_widthIncrement{0};231 int m_widthIncrement{0};
227 int m_heightIncrement{0};232 int m_heightIncrement{0};
228233
234 QRect m_inputBounds;
235
229 bool m_focused{false};236 bool m_focused{false};
230237
231 enum ClosingState {238 enum ClosingState {
232239
=== modified file 'src/modules/Unity/Application/mirsurfaceinterface.h'
--- src/modules/Unity/Application/mirsurfaceinterface.h 2016-06-23 19:58:48 +0000
+++ src/modules/Unity/Application/mirsurfaceinterface.h 2016-07-15 15:13:44 +0000
@@ -106,6 +106,8 @@
106106
107 virtual SessionInterface* session() = 0;107 virtual SessionInterface* session() = 0;
108108
109 virtual bool inputAreaContains(const QPoint &) const = 0;
110
109public Q_SLOTS:111public Q_SLOTS:
110 virtual void onCompositorSwappedBuffers() = 0;112 virtual void onCompositorSwappedBuffers() = 0;
111113
112114
=== modified file 'src/modules/Unity/Application/mirsurfaceitem.cpp'
--- src/modules/Unity/Application/mirsurfaceitem.cpp 2016-05-24 20:13:10 +0000
+++ src/modules/Unity/Application/mirsurfaceitem.cpp 2016-07-15 15:13:44 +0000
@@ -20,7 +20,6 @@
20#include "mirsurfaceitem.h"20#include "mirsurfaceitem.h"
21#include "mirfocuscontroller.h"21#include "mirfocuscontroller.h"
22#include "logging.h"22#include "logging.h"
23#include "ubuntukeyboardinfo.h"
24#include "tracepoints.h" // generated from tracepoints.tp23#include "tracepoints.h" // generated from tracepoints.tp
25#include "timestamp.h"24#include "timestamp.h"
2625
@@ -100,10 +99,6 @@
100 setSmooth(true);99 setSmooth(true);
101 setFlag(QQuickItem::ItemHasContents, true); //so scene graph will render this item100 setFlag(QQuickItem::ItemHasContents, true); //so scene graph will render this item
102101
103 if (!UbuntuKeyboardInfo::instance()) {
104 new UbuntuKeyboardInfo;
105 }
106
107 m_updateMirSurfaceSizeTimer.setSingleShot(true);102 m_updateMirSurfaceSizeTimer.setSingleShot(true);
108 m_updateMirSurfaceSizeTimer.setInterval(1);103 m_updateMirSurfaceSizeTimer.setInterval(1);
109 connect(&m_updateMirSurfaceSizeTimer, &QTimer::timeout, this, &MirSurfaceItem::updateMirSurfaceSize);104 connect(&m_updateMirSurfaceSizeTimer, &QTimer::timeout, this, &MirSurfaceItem::updateMirSurfaceSize);
@@ -295,17 +290,9 @@
295290
296void MirSurfaceItem::mousePressEvent(QMouseEvent *event)291void MirSurfaceItem::mousePressEvent(QMouseEvent *event)
297{292{
298 if (m_consumesInput && m_surface && m_surface->live()) {293 auto mousePos = event->localPos().toPoint();
299 if (type() == Mir::InputMethodType) {294 if (m_consumesInput && m_surface && m_surface->live() && m_surface->inputAreaContains(mousePos)) {
300 // FIXME: Hack to get the VKB use case working while we don't have the proper solution in place.295 m_surface->mousePressEvent(event);
301 if (isMouseInsideUbuntuKeyboard(event)) {
302 m_surface->mousePressEvent(event);
303 } else {
304 event->ignore();
305 }
306 } else {
307 m_surface->mousePressEvent(event);
308 }
309 } else {296 } else {
310 event->ignore();297 event->ignore();
311 }298 }
@@ -476,51 +463,26 @@
476 return false;463 return false;
477 }464 }
478465
479 bool accepted = true;466 if (eventType == QEvent::TouchBegin && !hasTouchInsideInputRegion(touchPoints)) {
480 if (type() == Mir::InputMethodType && eventType == QEvent::TouchBegin) {467 return false;
481 // FIXME: Hack to get the VKB use case working while we don't have the proper solution in place.
482 if (hasTouchInsideUbuntuKeyboard(touchPoints)) {
483 validateAndDeliverTouchEvent(eventType, timestamp, mods, touchPoints, touchPointStates);
484 } else {
485 accepted = false;
486 }
487
488 } else {
489 // NB: If we are getting QEvent::TouchUpdate or QEvent::TouchEnd it's because we've
490 // previously accepted the corresponding QEvent::TouchBegin
491 validateAndDeliverTouchEvent(eventType, timestamp, mods, touchPoints, touchPointStates);
492 }468 }
493 return accepted;469
470 validateAndDeliverTouchEvent(eventType, timestamp, mods, touchPoints, touchPointStates);
471
472 return true;
494}473}
495474
496bool MirSurfaceItem::hasTouchInsideUbuntuKeyboard(const QList<QTouchEvent::TouchPoint> &touchPoints)475bool MirSurfaceItem::hasTouchInsideInputRegion(const QList<QTouchEvent::TouchPoint> &touchPoints)
497{476{
498 UbuntuKeyboardInfo *ubuntuKeyboardInfo = UbuntuKeyboardInfo::instance();
499
500 for (int i = 0; i < touchPoints.count(); ++i) {477 for (int i = 0; i < touchPoints.count(); ++i) {
501 QPoint pos = touchPoints.at(i).pos().toPoint();478 QPoint pos = touchPoints.at(i).pos().toPoint();
502 if (pos.x() >= ubuntuKeyboardInfo->x()479 if (m_surface->inputAreaContains(pos)) {
503 && pos.x() <= (ubuntuKeyboardInfo->x() + ubuntuKeyboardInfo->width())
504 && pos.y() >= ubuntuKeyboardInfo->y()
505 && pos.y() <= (ubuntuKeyboardInfo->y() + ubuntuKeyboardInfo->height())) {
506 return true;480 return true;
507 }481 }
508 }482 }
509 return false;483 return false;
510}484}
511485
512bool MirSurfaceItem::isMouseInsideUbuntuKeyboard(const QMouseEvent *event)
513{
514 UbuntuKeyboardInfo *ubuntuKeyboardInfo = UbuntuKeyboardInfo::instance();
515
516 const QPointF &pos = event->localPos();
517
518 return pos.x() >= ubuntuKeyboardInfo->x()
519 && pos.x() <= (ubuntuKeyboardInfo->x() + ubuntuKeyboardInfo->width())
520 && pos.y() >= ubuntuKeyboardInfo->y()
521 && pos.y() <= (ubuntuKeyboardInfo->y() + ubuntuKeyboardInfo->height());
522}
523
524Mir::State MirSurfaceItem::surfaceState() const486Mir::State MirSurfaceItem::surfaceState() const
525{487{
526 if (m_surface) {488 if (m_surface) {
527489
=== modified file 'src/modules/Unity/Application/mirsurfaceitem.h'
--- src/modules/Unity/Application/mirsurfaceitem.h 2016-05-24 20:13:10 +0000
+++ src/modules/Unity/Application/mirsurfaceitem.h 2016-07-15 15:13:44 +0000
@@ -128,8 +128,7 @@
128private:128private:
129 void ensureTextureProvider();129 void ensureTextureProvider();
130130
131 bool hasTouchInsideUbuntuKeyboard(const QList<QTouchEvent::TouchPoint> &touchPoints);131 bool hasTouchInsideInputRegion(const QList<QTouchEvent::TouchPoint> &touchPoints);
132 bool isMouseInsideUbuntuKeyboard(const QMouseEvent *event);
133132
134 QString appId() const;133 QString appId() const;
135 void endCurrentTouchSequence(ulong timestamp);134 void endCurrentTouchSequence(ulong timestamp);
136135
=== modified file 'src/modules/Unity/Application/plugin.cpp'
--- src/modules/Unity/Application/plugin.cpp 2016-03-28 18:02:26 +0000
+++ src/modules/Unity/Application/plugin.cpp 2016-07-15 15:13:44 +0000
@@ -25,7 +25,6 @@
25#include "mirsurfaceinterface.h"25#include "mirsurfaceinterface.h"
26#include "mirsurfaceitem.h"26#include "mirsurfaceitem.h"
27#include "mirsurfacelistmodel.h"27#include "mirsurfacelistmodel.h"
28#include "ubuntukeyboardinfo.h"
2928
30// platforms/mirserver29// platforms/mirserver
31#include <mirsingleton.h>30#include <mirsingleton.h>
@@ -55,13 +54,6 @@
55 return qtmir::MirSurfaceManager::singleton();54 return qtmir::MirSurfaceManager::singleton();
56}55}
5756
58QObject* ubuntuKeyboardInfoSingleton(QQmlEngine* /*engine*/, QJSEngine* /*scriptEngine*/) {
59 if (!UbuntuKeyboardInfo::instance()) {
60 new UbuntuKeyboardInfo;
61 }
62 return UbuntuKeyboardInfo::instance();
63}
64
65QObject* mirSingleton(QQmlEngine* /*engine*/, QJSEngine* /*scriptEngine*/) {57QObject* mirSingleton(QQmlEngine* /*engine*/, QJSEngine* /*scriptEngine*/) {
66 return qtmir::Mir::instance();58 return qtmir::Mir::instance();
67}59}
@@ -101,8 +93,6 @@
101 qmlRegisterUncreatableType<unity::shell::application::MirSurfaceInterface>(93 qmlRegisterUncreatableType<unity::shell::application::MirSurfaceInterface>(
102 uri, 0, 1, "MirSurface", "MirSurface can't be instantiated from QML");94 uri, 0, 1, "MirSurface", "MirSurface can't be instantiated from QML");
103 qmlRegisterType<qtmir::MirSurfaceItem>(uri, 0, 1, "MirSurfaceItem");95 qmlRegisterType<qtmir::MirSurfaceItem>(uri, 0, 1, "MirSurfaceItem");
104 qmlRegisterSingletonType<qtmir::UbuntuKeyboardInfo>(
105 uri, 0, 1, "UbuntuKeyboardInfo", ubuntuKeyboardInfoSingleton);
106 qmlRegisterSingletonType<qtmir::Mir>(uri, 0, 1, "Mir", mirSingleton);96 qmlRegisterSingletonType<qtmir::Mir>(uri, 0, 1, "Mir", mirSingleton);
107 }97 }
10898
10999
=== removed file 'src/modules/Unity/Application/ubuntukeyboardinfo.cpp'
--- src/modules/Unity/Application/ubuntukeyboardinfo.cpp 2016-05-27 07:45:26 +0000
+++ src/modules/Unity/Application/ubuntukeyboardinfo.cpp 1970-01-01 00:00:00 +0000
@@ -1,173 +0,0 @@
1/*
2 * Copyright (C) 2013-2015 Canonical, Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License version 3, as published by
6 * the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10 * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "ubuntukeyboardinfo.h"
18
19#include <QDir>
20
21namespace qtmir {
22
23namespace {
24 const int gConnectionAttemptIntervalMs = 5000;
25 const int gMaxConsecutiveAttempts = 10;
26 const char gServerName[] = "ubuntu-keyboard-info";
27}
28
29UbuntuKeyboardInfo* UbuntuKeyboardInfo::m_instance = nullptr;
30
31UbuntuKeyboardInfo* UbuntuKeyboardInfo::instance()
32{
33 return m_instance;
34}
35
36UbuntuKeyboardInfo::UbuntuKeyboardInfo(QObject *parent)
37 : QObject(parent),
38 m_consecutiveAttempts(0),
39 m_lastX(0),
40 m_lastY(0),
41 m_lastWidth(0),
42 m_lastHeight(0)
43{
44 if (m_instance) {
45 qFatal("Cannot have more than one instance of UbuntuKeyboardInfo simultaneously.");
46 }
47 m_instance = this;
48
49 connect(&m_socket, &QLocalSocket::stateChanged, this, &UbuntuKeyboardInfo::onSocketStateChanged);
50 connect(&m_socket, &QIODevice::readyRead,
51 this, &UbuntuKeyboardInfo::readAllBytesFromSocket);
52
53 buildSocketFilePath();
54
55 typedef void (QLocalSocket::*MemberFunctionType)(QLocalSocket::LocalSocketError);
56 MemberFunctionType funcPointer = &QLocalSocket::error;
57 connect(&m_socket, funcPointer,
58 this, &UbuntuKeyboardInfo::onSocketError);
59
60 m_connectionRetryTimer.setInterval(gConnectionAttemptIntervalMs);
61 m_connectionRetryTimer.setSingleShot(true);
62 connect(&m_connectionRetryTimer, &QTimer::timeout,
63 this, &UbuntuKeyboardInfo::tryConnectingToServer);
64 tryConnectingToServer();
65}
66
67UbuntuKeyboardInfo::~UbuntuKeyboardInfo()
68{
69 // Make sure we don't get onSocketStateChanged() called during
70 // destruction.
71 m_socket.disconnect(this);
72
73 Q_ASSERT(m_instance);
74 m_instance = nullptr;
75}
76
77void UbuntuKeyboardInfo::tryConnectingToServer()
78{
79 ++m_consecutiveAttempts;
80 Q_ASSERT(!m_socketFilePath.isEmpty());
81 m_socket.connectToServer(m_socketFilePath, QIODevice::ReadOnly);
82}
83
84void UbuntuKeyboardInfo::onSocketStateChanged(QLocalSocket::LocalSocketState socketState)
85{
86 switch (socketState) {
87 case QLocalSocket::UnconnectedState:
88 retryConnection();
89 break;
90 case QLocalSocket::ConnectedState:
91 m_consecutiveAttempts = 0;
92 break;
93 default:
94 break;
95 }
96}
97
98void UbuntuKeyboardInfo::onSocketError(QLocalSocket::LocalSocketError socketError)
99{
100 Q_UNUSED(socketError);
101 qWarning() << "UbuntuKeyboardInfo - socket error:" << m_socket.errorString();
102}
103
104void UbuntuKeyboardInfo::retryConnection()
105{
106 // Polling every gConnectionAttemptIntervalMs. Not the best approach but could be worse.
107 if (m_consecutiveAttempts < gMaxConsecutiveAttempts) {
108 if (!m_connectionRetryTimer.isActive()) {
109 m_connectionRetryTimer.start();
110 }
111 } else {
112 qCritical() << "Failed to connect to" << m_socketFilePath << "after"
113 << m_consecutiveAttempts << "failed attempts";
114
115 // it shouldn't be running, but just to be sure.
116 m_connectionRetryTimer.stop();
117 }
118}
119
120void UbuntuKeyboardInfo::readAllBytesFromSocket()
121{
122 while (m_socket.bytesAvailable() > 0) {
123 readInfoFromSocket();
124 }
125}
126
127void UbuntuKeyboardInfo::readInfoFromSocket()
128{
129 const size_t sharedInfoSize = sizeof(struct SharedInfo);
130 QByteArray bytes = m_socket.read(sharedInfoSize);
131 if (bytes.size() != sharedInfoSize) {
132 qWarning() << "UbuntuKeyboardInfo: expected to receive" << sharedInfoSize
133 << "but got" << bytes.size();
134 return;
135 }
136
137 {
138 struct SharedInfo *sharedInfo = reinterpret_cast<struct SharedInfo*>(bytes.data());
139
140 if (m_lastX != sharedInfo->keyboardX) {
141 m_lastX = sharedInfo->keyboardX;
142 Q_EMIT xChanged(m_lastX);
143 }
144
145 if (m_lastY != sharedInfo->keyboardY) {
146 m_lastY = sharedInfo->keyboardY;
147 Q_EMIT yChanged(m_lastY);
148 }
149
150 if (m_lastWidth != sharedInfo->keyboardWidth) {
151 m_lastWidth = sharedInfo->keyboardWidth;
152 Q_EMIT widthChanged(m_lastWidth);
153 }
154
155 if (m_lastHeight != sharedInfo->keyboardHeight) {
156 m_lastHeight = sharedInfo->keyboardHeight;
157 Q_EMIT heightChanged(m_lastHeight);
158 }
159 }
160}
161
162void UbuntuKeyboardInfo::buildSocketFilePath()
163{
164 char *xdgRuntimeDir = getenv("XDG_RUNTIME_DIR");
165
166 if (xdgRuntimeDir) {
167 m_socketFilePath = QDir(xdgRuntimeDir).filePath(gServerName);
168 } else {
169 m_socketFilePath = QDir("/tmp").filePath(gServerName);
170 }
171}
172
173} // namespace qtmir
1740
=== removed file 'src/modules/Unity/Application/ubuntukeyboardinfo.h'
--- src/modules/Unity/Application/ubuntukeyboardinfo.h 2015-08-11 12:08:32 +0000
+++ src/modules/Unity/Application/ubuntukeyboardinfo.h 1970-01-01 00:00:00 +0000
@@ -1,87 +0,0 @@
1/*
2 * Copyright (C) 2013-2015 Canonical, Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License version 3, as published by
6 * the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10 * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef UBUNTU_KEYBOARD_INFO_H
18#define UBUNTU_KEYBOARD_INFO_H
19
20#include <QLocalSocket>
21#include <QTimer>
22
23namespace qtmir {
24
25// Temporary solution to get information about the onscreen keyboard
26// This shouldn't be needed once the OSK is a properly sized surface
27// instead of a fullscreen one.
28class UbuntuKeyboardInfo : public QObject {
29 Q_OBJECT
30 Q_PROPERTY(qreal x READ x NOTIFY xChanged)
31 Q_PROPERTY(qreal y READ y NOTIFY yChanged)
32 Q_PROPERTY(qreal width READ width NOTIFY widthChanged)
33 Q_PROPERTY(qreal height READ height NOTIFY heightChanged)
34public:
35 UbuntuKeyboardInfo(QObject *parent = 0);
36 virtual ~UbuntuKeyboardInfo();
37
38 static UbuntuKeyboardInfo* instance();
39
40 qreal x() const { return m_lastX; }
41 qreal y() const { return m_lastY; }
42 qreal width() const { return m_lastWidth; }
43 qreal height() const { return m_lastHeight; }
44
45Q_SIGNALS:
46 void xChanged(qreal x);
47 void yChanged(qreal y);
48 void widthChanged(qreal width);
49 void heightChanged(qreal height);
50
51private Q_SLOTS:
52 void tryConnectingToServer();
53 void onSocketStateChanged(QLocalSocket::LocalSocketState socketState);
54 void onSocketError(QLocalSocket::LocalSocketError socketError);
55 void readAllBytesFromSocket();
56
57private:
58 // NB! Must match the definition in ubuntu-keyboard. Not worth creating a shared header
59 // just for that.
60 struct SharedInfo {
61 qint32 keyboardX;
62 qint32 keyboardY;
63 qint32 keyboardWidth;
64 qint32 keyboardHeight;
65 };
66 void readInfoFromSocket();
67 void retryConnection();
68 void buildSocketFilePath();
69
70 int m_consecutiveAttempts;
71
72 QLocalSocket m_socket;
73 qint32 m_lastX;
74 qint32 m_lastY;
75 qint32 m_lastWidth;
76 qint32 m_lastHeight;
77 QTimer m_connectionRetryTimer;
78
79 // Path to the socket file created by ubuntu-keyboard
80 QString m_socketFilePath;
81
82 static UbuntuKeyboardInfo* m_instance;
83};
84
85} // namespace qtmir
86
87#endif // UBUNTU_KEYBOARD_INFO_H
880
=== modified file 'src/modules/Unity/Screens/CMakeLists.txt'
--- src/modules/Unity/Screens/CMakeLists.txt 2016-01-28 22:33:35 +0000
+++ src/modules/Unity/Screens/CMakeLists.txt 2016-07-15 15:13:44 +0000
@@ -1,5 +1,9 @@
1include_directories(1include_directories(
2 ${CMAKE_SOURCE_DIR}/src/platforms/mirserver2 ${CMAKE_SOURCE_DIR}/src/platforms/mirserver
3)
4
5include_directories(
6 SYSTEM
3 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}7 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
4 ${Qt5Quick_INCLUDE_DIRS}8 ${Qt5Quick_INCLUDE_DIRS}
5 ${MIRSERVER_INCLUDE_DIRS}9 ${MIRSERVER_INCLUDE_DIRS}
610
=== modified file 'src/platforms/mirserver/CMakeLists.txt'
--- src/platforms/mirserver/CMakeLists.txt 2016-06-14 08:33:55 +0000
+++ src/platforms/mirserver/CMakeLists.txt 2016-07-15 15:13:44 +0000
@@ -26,6 +26,10 @@
26include_directories(26include_directories(
27 ${CMAKE_SOURCE_DIR}/src/common27 ${CMAKE_SOURCE_DIR}/src/common
2828
29)
30
31include_directories(
32 SYSTEM
29 ${MIRCOMMON_INCLUDE_DIRS}33 ${MIRCOMMON_INCLUDE_DIRS}
30 ${MIRSERVER_INCLUDE_DIRS}34 ${MIRSERVER_INCLUDE_DIRS}
31 ${MIRRENDERERGLDEV_INCLUDE_DIRS}35 ${MIRRENDERERGLDEV_INCLUDE_DIRS}
3236
=== modified file 'src/platforms/mirserver/mirwindowmanager.cpp'
--- src/platforms/mirserver/mirwindowmanager.cpp 2016-05-27 08:34:18 +0000
+++ src/platforms/mirserver/mirwindowmanager.cpp 2016-07-15 15:13:44 +0000
@@ -197,14 +197,19 @@
197 const mir::shell::SurfaceSpecification& modifications)197 const mir::shell::SurfaceSpecification& modifications)
198{198{
199 QMutexLocker locker(&SurfaceObserver::mutex);199 QMutexLocker locker(&SurfaceObserver::mutex);
200
201 if (modifications.name.is_set()) {
202 surface->rename(modifications.name.value());
203 }
204
205 if (modifications.input_shape.is_set()) {
206 surface->set_input_region(modifications.input_shape.value());
207 }
208
200 SurfaceObserver *observer = SurfaceObserver::observerForSurface(surface.get());209 SurfaceObserver *observer = SurfaceObserver::observerForSurface(surface.get());
201 if (observer) {210 if (observer) {
202 observer->notifySurfaceModifications(modifications);211 observer->notifySurfaceModifications(modifications);
203 }212 }
204
205 if (modifications.name.is_set()) {
206 surface->rename(modifications.name.value());
207 }
208}213}
209214
210std::shared_ptr<MirWindowManager> MirWindowManager::create(215std::shared_ptr<MirWindowManager> MirWindowManager::create(
211216
=== modified file 'src/platforms/mirserver/surfaceobserver.cpp'
--- src/platforms/mirserver/surfaceobserver.cpp 2016-05-05 14:18:30 +0000
+++ src/platforms/mirserver/surfaceobserver.cpp 2016-07-15 15:13:44 +0000
@@ -28,6 +28,22 @@
28#include <mir/geometry/size.h>28#include <mir/geometry/size.h>
29#include <mir/shell/surface_specification.h>29#include <mir/shell/surface_specification.h>
3030
31namespace {
32
33QRect calculateBoundingRect(const std::vector<mir::geometry::Rectangle> &rectVector)
34{
35 QRect boundingRect;
36 for (auto mirRect : rectVector) {
37 boundingRect |= QRect(mirRect.top_left.x.as_int(),
38 mirRect.top_left.y.as_int(),
39 mirRect.size.width.as_int(),
40 mirRect.size.height.as_int());
41 }
42 return boundingRect;
43}
44
45} // anonymous namespace
46
31QMap<const mir::scene::Surface*, SurfaceObserver*> SurfaceObserver::m_surfaceToObserverMap;47QMap<const mir::scene::Surface*, SurfaceObserver*> SurfaceObserver::m_surfaceToObserverMap;
32QMutex SurfaceObserver::mutex;48QMutex SurfaceObserver::mutex;
3349
@@ -154,6 +170,10 @@
154 if (modifications.shell_chrome.is_set()) {170 if (modifications.shell_chrome.is_set()) {
155 Q_EMIT shellChromeChanged(modifications.shell_chrome.value());171 Q_EMIT shellChromeChanged(modifications.shell_chrome.value());
156 }172 }
173 if (modifications.input_shape.is_set()) {
174 QRect qRect = calculateBoundingRect(modifications.input_shape.value());
175 Q_EMIT inputBoundsChanged(qRect);
176 }
157}177}
158178
159SurfaceObserver *SurfaceObserver::observerForSurface(const mir::scene::Surface *surface)179SurfaceObserver *SurfaceObserver::observerForSurface(const mir::scene::Surface *surface)
160180
=== modified file 'src/platforms/mirserver/surfaceobserver.h'
--- src/platforms/mirserver/surfaceobserver.h 2016-05-05 14:17:14 +0000
+++ src/platforms/mirserver/surfaceobserver.h 2016-07-15 15:13:44 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright (C) 2014-2015 Canonical, Ltd.2 * Copyright (C) 2014-2016 Canonical, Ltd.
3 *3 *
4 * This program is free software: you can redistribute it and/or modify it under4 * This program is free software: you can redistribute it and/or modify it under
5 * the terms of the GNU Lesser General Public License version 3, as published by5 * the terms of the GNU Lesser General Public License version 3, as published by
@@ -22,6 +22,7 @@
22#include <QObject>22#include <QObject>
23#include <QMap>23#include <QMap>
24#include <QMutex>24#include <QMutex>
25#include <QRect>
25#include <QSize>26#include <QSize>
26#include <mir/scene/surface_observer.h>27#include <mir/scene/surface_observer.h>
2728
@@ -84,6 +85,7 @@
84 void widthIncrementChanged(int);85 void widthIncrementChanged(int);
85 void heightIncrementChanged(int);86 void heightIncrementChanged(int);
86 void shellChromeChanged(MirShellChrome);87 void shellChromeChanged(MirShellChrome);
88 void inputBoundsChanged(const QRect &rect);
8789
88private:90private:
89 QCursor createQCursorFromMirCursorImage(const mir::graphics::CursorImage &cursorImage);91 QCursor createQCursorFromMirCursorImage(const mir::graphics::CursorImage &cursorImage);
9092
=== modified file 'tests/framework/CMakeLists.txt'
--- tests/framework/CMakeLists.txt 2016-05-24 20:13:10 +0000
+++ tests/framework/CMakeLists.txt 2016-07-15 15:13:44 +0000
@@ -1,7 +1,11 @@
1include_directories(1include_directories(
2 ${APPLICATION_API_INCLUDE_DIRS}
3 ${CMAKE_SOURCE_DIR}/src/platforms/mirserver2 ${CMAKE_SOURCE_DIR}/src/platforms/mirserver
4 ${CMAKE_SOURCE_DIR}/src/modules3 ${CMAKE_SOURCE_DIR}/src/modules
4)
5
6include_directories(
7 SYSTEM
8 ${APPLICATION_API_INCLUDE_DIRS}
5 ${MIRSERVER_INCLUDE_DIRS}9 ${MIRSERVER_INCLUDE_DIRS}
6 ${MIRRENDERERGLDEV_INCLUDE_DIRS}10 ${MIRRENDERERGLDEV_INCLUDE_DIRS}
711
812
=== modified file 'tests/framework/fake_mirsurface.h'
--- tests/framework/fake_mirsurface.h 2016-06-23 19:58:48 +0000
+++ tests/framework/fake_mirsurface.h 2016-07-15 15:13:44 +0000
@@ -76,6 +76,7 @@
76 Mir::ShellChrome shellChrome() const override { return Mir::NormalChrome; }76 Mir::ShellChrome shellChrome() const override { return Mir::NormalChrome; }
7777
78 bool focused() const override { return false; }78 bool focused() const override { return false; }
79 QRect inputBounds() const override { return QRect(0,0,10,10); }
7980
80 void requestFocus() override {81 void requestFocus() override {
81 Q_EMIT focusRequested();82 Q_EMIT focusRequested();
@@ -85,8 +86,6 @@
85 Q_EMIT closeRequested();86 Q_EMIT closeRequested();
86 }87 }
8788
88 void setScreen(QScreen *) override {}
89
90 void raise() override {}89 void raise() override {}
9190
92 ////91 ////
@@ -133,8 +132,12 @@
133132
134 QCursor cursor() const override { return QCursor(); }133 QCursor cursor() const override { return QCursor(); }
135134
135 void setScreen(QScreen *) override {}
136
136 SessionInterface* session() override { return m_session; }137 SessionInterface* session() override { return m_session; }
137138
139 bool inputAreaContains(const QPoint &) const override { return true; }
140
138public Q_SLOTS:141public Q_SLOTS:
139 void onCompositorSwappedBuffers() override;142 void onCompositorSwappedBuffers() override;
140143
141144
=== modified file 'tests/mirserver/Clipboard/CMakeLists.txt'
--- tests/mirserver/Clipboard/CMakeLists.txt 2014-12-03 08:56:35 +0000
+++ tests/mirserver/Clipboard/CMakeLists.txt 2016-07-15 15:13:44 +0000
@@ -6,6 +6,10 @@
66
7include_directories(7include_directories(
8 ${CMAKE_SOURCE_DIR}/src/platforms/mirserver8 ${CMAKE_SOURCE_DIR}/src/platforms/mirserver
9)
10
11include_directories(
12 SYSTEM
9 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}13 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
10 ${MIRSERVER_INCLUDE_DIRS}14 ${MIRSERVER_INCLUDE_DIRS}
11)15)
1216
=== modified file 'tests/mirserver/QtEventFeeder/CMakeLists.txt'
--- tests/mirserver/QtEventFeeder/CMakeLists.txt 2014-12-03 08:56:35 +0000
+++ tests/mirserver/QtEventFeeder/CMakeLists.txt 2016-07-15 15:13:44 +0000
@@ -7,6 +7,10 @@
7include_directories(7include_directories(
8 ${CMAKE_SOURCE_DIR}/src/platforms/mirserver8 ${CMAKE_SOURCE_DIR}/src/platforms/mirserver
9 ${CMAKE_SOURCE_DIR}/src/common9 ${CMAKE_SOURCE_DIR}/src/common
10)
11
12include_directories(
13 SYSTEM
10 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}14 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
11 ${MIRSERVER_INCLUDE_DIRS}15 ${MIRSERVER_INCLUDE_DIRS}
12)16)
1317
=== modified file 'tests/mirserver/Screen/CMakeLists.txt'
--- tests/mirserver/Screen/CMakeLists.txt 2015-11-11 10:43:36 +0000
+++ tests/mirserver/Screen/CMakeLists.txt 2016-07-15 15:13:44 +0000
@@ -8,6 +8,10 @@
8 ${CMAKE_SOURCE_DIR}/tests/framework8 ${CMAKE_SOURCE_DIR}/tests/framework
9 ${CMAKE_SOURCE_DIR}/src/platforms/mirserver9 ${CMAKE_SOURCE_DIR}/src/platforms/mirserver
10 ${CMAKE_SOURCE_DIR}/src/common10 ${CMAKE_SOURCE_DIR}/src/common
11)
12
13include_directories(
14 SYSTEM
11 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}15 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
12 ${MIRSERVER_INCLUDE_DIRS}16 ${MIRSERVER_INCLUDE_DIRS}
13)17)
1418
=== modified file 'tests/mirserver/ScreensModel/CMakeLists.txt'
--- tests/mirserver/ScreensModel/CMakeLists.txt 2016-02-16 11:48:35 +0000
+++ tests/mirserver/ScreensModel/CMakeLists.txt 2016-07-15 15:13:44 +0000
@@ -11,6 +11,10 @@
11 ${CMAKE_SOURCE_DIR}/tests/framework11 ${CMAKE_SOURCE_DIR}/tests/framework
12 ${CMAKE_SOURCE_DIR}/src/platforms/mirserver12 ${CMAKE_SOURCE_DIR}/src/platforms/mirserver
13 ${CMAKE_SOURCE_DIR}/src/common13 ${CMAKE_SOURCE_DIR}/src/common
14)
15
16include_directories(
17 SYSTEM
14 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}18 ${Qt5Gui_PRIVATE_INCLUDE_DIRS}
15 ${MIRSERVER_INCLUDE_DIRS}19 ${MIRSERVER_INCLUDE_DIRS}
16 ${MIRRENDERERGLDEV_INCLUDE_DIRS}20 ${MIRRENDERERGLDEV_INCLUDE_DIRS}
1721
=== modified file 'tests/mirserver/WindowManager/CMakeLists.txt'
--- tests/mirserver/WindowManager/CMakeLists.txt 2016-03-10 11:55:28 +0000
+++ tests/mirserver/WindowManager/CMakeLists.txt 2016-07-15 15:13:44 +0000
@@ -1,5 +1,9 @@
1include_directories(1include_directories(
2 ${CMAKE_SOURCE_DIR}/src/platforms/mirserver2 ${CMAKE_SOURCE_DIR}/src/platforms/mirserver
3)
4
5include_directories(
6 SYSTEM
3 ${MIRSERVER_INCLUDE_DIRS}7 ${MIRSERVER_INCLUDE_DIRS}
4)8)
59
610
=== modified file 'tests/modules/Application/CMakeLists.txt'
--- tests/modules/Application/CMakeLists.txt 2015-12-15 10:03:32 +0000
+++ tests/modules/Application/CMakeLists.txt 2016-07-15 15:13:44 +0000
@@ -7,8 +7,11 @@
7 ${CMAKE_SOURCE_DIR}/src/platforms/mirserver7 ${CMAKE_SOURCE_DIR}/src/platforms/mirserver
8 ${CMAKE_SOURCE_DIR}/src/modules8 ${CMAKE_SOURCE_DIR}/src/modules
9 ${CMAKE_SOURCE_DIR}/tests/framework9 ${CMAKE_SOURCE_DIR}/tests/framework
10)
11
12include_directories(
13 SYSTEM
10 ${MIRSERVER_INCLUDE_DIRS}14 ${MIRSERVER_INCLUDE_DIRS}
11
12 ${Qt5Core_INCLUDE_DIRS}15 ${Qt5Core_INCLUDE_DIRS}
13 ${Qt5GUI_INCLUDE_DIRS}16 ${Qt5GUI_INCLUDE_DIRS}
14 ${Qt5Quick_INCLUDE_DIRS}17 ${Qt5Quick_INCLUDE_DIRS}
1518
=== modified file 'tests/modules/ApplicationManager/CMakeLists.txt'
--- tests/modules/ApplicationManager/CMakeLists.txt 2015-09-30 15:45:17 +0000
+++ tests/modules/ApplicationManager/CMakeLists.txt 2016-07-15 15:13:44 +0000
@@ -5,10 +5,14 @@
5)5)
66
7include_directories(7include_directories(
8 ${APPLICATION_API_INCLUDE_DIRS}
9 ${CMAKE_SOURCE_DIR}/src/platforms/mirserver8 ${CMAKE_SOURCE_DIR}/src/platforms/mirserver
10 ${CMAKE_SOURCE_DIR}/src/modules9 ${CMAKE_SOURCE_DIR}/src/modules
11 ${CMAKE_SOURCE_DIR}/tests/framework10 ${CMAKE_SOURCE_DIR}/tests/framework
11)
12
13include_directories(
14 SYSTEM
15 ${APPLICATION_API_INCLUDE_DIRS}
12 ${MIRSERVER_INCLUDE_DIRS}16 ${MIRSERVER_INCLUDE_DIRS}
13)17)
1418
1519
=== modified file 'tests/modules/SessionManager/CMakeLists.txt'
--- tests/modules/SessionManager/CMakeLists.txt 2015-09-30 15:45:17 +0000
+++ tests/modules/SessionManager/CMakeLists.txt 2016-07-15 15:13:44 +0000
@@ -6,10 +6,14 @@
6)6)
77
8include_directories(8include_directories(
9 ${APPLICATION_API_INCLUDE_DIRS}
10 ${CMAKE_SOURCE_DIR}/src/platforms/mirserver9 ${CMAKE_SOURCE_DIR}/src/platforms/mirserver
11 ${CMAKE_SOURCE_DIR}/src/modules10 ${CMAKE_SOURCE_DIR}/src/modules
12 ${CMAKE_SOURCE_DIR}/tests/framework11 ${CMAKE_SOURCE_DIR}/tests/framework
12)
13
14include_directories(
15 SYSTEM
16 ${APPLICATION_API_INCLUDE_DIRS}
13 ${MIRSERVER_INCLUDE_DIRS}17 ${MIRSERVER_INCLUDE_DIRS}
14)18)
1519
1620
=== modified file 'tests/modules/SharedWakelock/CMakeLists.txt'
--- tests/modules/SharedWakelock/CMakeLists.txt 2015-09-30 15:45:17 +0000
+++ tests/modules/SharedWakelock/CMakeLists.txt 2016-07-15 15:13:44 +0000
@@ -5,6 +5,10 @@
55
6include_directories(6include_directories(
7 ${CMAKE_SOURCE_DIR}/src/modules7 ${CMAKE_SOURCE_DIR}/src/modules
8)
9
10include_directories(
11 SYSTEM
8 ${QTDBUSTEST_INCLUDE_DIRS}12 ${QTDBUSTEST_INCLUDE_DIRS}
9 ${QTDBUSMOCK_INCLUDE_DIRS}13 ${QTDBUSMOCK_INCLUDE_DIRS}
10)14)
1115
=== modified file 'tests/modules/SurfaceManager/CMakeLists.txt'
--- tests/modules/SurfaceManager/CMakeLists.txt 2016-05-24 20:13:10 +0000
+++ tests/modules/SurfaceManager/CMakeLists.txt 2016-07-15 15:13:44 +0000
@@ -9,6 +9,10 @@
9 ${CMAKE_SOURCE_DIR}/src/modules9 ${CMAKE_SOURCE_DIR}/src/modules
10 ${CMAKE_SOURCE_DIR}/src/platforms/mirserver10 ${CMAKE_SOURCE_DIR}/src/platforms/mirserver
11 ${CMAKE_SOURCE_DIR}/tests/framework11 ${CMAKE_SOURCE_DIR}/tests/framework
12)
13
14include_directories(
15 SYSTEM
12 ${MIRSERVER_INCLUDE_DIRS}16 ${MIRSERVER_INCLUDE_DIRS}
13 ${Qt5Quick_PRIVATE_INCLUDE_DIRS}17 ${Qt5Quick_PRIVATE_INCLUDE_DIRS}
14)18)

Subscribers

People subscribed via source and target branches