Merge lp:~dandrader/qtubuntu/enhancePanelHack into lp:qtubuntu

Proposed by Daniel d'Andrada
Status: Merged
Approved by: Gerry Boland
Approved revision: 294
Merged at revision: 300
Proposed branch: lp:~dandrader/qtubuntu/enhancePanelHack
Merge into: lp:qtubuntu
Diff against target: 56 lines (+27/-1)
2 files modified
src/ubuntumirclient/window.cpp (+26/-1)
src/ubuntumirclient/window.h (+1/-0)
To merge this branch: bzr merge lp:~dandrader/qtubuntu/enhancePanelHack
Reviewer Review Type Date Requested Status
Florian Boucault (community) Approve
Gerry Boland (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+278799@code.launchpad.net

Commit message

Update panel height hack when window enters or leaves fullscreen

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

LGTM!

review: Approve
Revision history for this message
Florian Boucault (fboucault) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/ubuntumirclient/window.cpp'
2--- src/ubuntumirclient/window.cpp 2015-11-17 13:42:24 +0000
3+++ src/ubuntumirclient/window.cpp 2015-11-27 12:52:29 +0000
4@@ -261,7 +261,11 @@
5 auto geom = mWindow->geometry();
6 geom.setWidth(parameters.width);
7 geom.setHeight(parameters.height);
8- geom.setY(panelHeight());
9+ if (mWindowState == Qt::WindowFullScreen) {
10+ geom.setY(0);
11+ } else {
12+ geom.setY(panelHeight());
13+ }
14
15 // Assume that the buffer size matches the surface size at creation time
16 mBufferSize = geom.size();
17@@ -542,6 +546,27 @@
18 QMutexLocker lock(&mMutex);
19 DLOG("[ubuntumirclient QPA] setWindowState(window=%p, %s)", this, qtWindowStateToStr(state));
20 mSurface->setState(state);
21+
22+ updatePanelHeightHack(state);
23+}
24+
25+/*
26+ FIXME: Mir does not let clients know the position of their windows in the virtual
27+ desktop space. So we have this ugly hack that assumes a phone situation where the
28+ window is always on the top-left corner, right below the indicators panel if not
29+ in fullscreen.
30+ */
31+void UbuntuWindow::updatePanelHeightHack(Qt::WindowState state)
32+{
33+ if (state == Qt::WindowFullScreen && geometry().y() != 0) {
34+ QRect newGeometry = geometry();
35+ newGeometry.setY(0);
36+ QWindowSystemInterface::handleGeometryChange(window(), newGeometry);
37+ } else if (geometry().y() == 0) {
38+ QRect newGeometry = geometry();
39+ newGeometry.setY(panelHeight());
40+ QWindowSystemInterface::handleGeometryChange(window(), newGeometry);
41+ }
42 }
43
44 void UbuntuWindow::setGeometry(const QRect& rect)
45
46=== modified file 'src/ubuntumirclient/window.h'
47--- src/ubuntumirclient/window.h 2015-11-17 13:42:24 +0000
48+++ src/ubuntumirclient/window.h 2015-11-27 12:52:29 +0000
49@@ -54,6 +54,7 @@
50 void onSwapBuffersDone();
51
52 private:
53+ void updatePanelHeightHack(Qt::WindowState);
54 mutable QMutex mMutex;
55 const WId mId;
56 const QSharedPointer<UbuntuClipboard> mClipboard;

Subscribers

People subscribed via source and target branches