Merge lp:~aacid/unity-2d/barrier_creation_can_fail into lp:unity-2d

Proposed by Albert Astals Cid
Status: Merged
Approved by: Gerry Boland
Approved revision: 1087
Merged at revision: 1085
Proposed branch: lp:~aacid/unity-2d/barrier_creation_can_fail
Merge into: lp:unity-2d
Diff against target: 37 lines (+11/-1)
2 files modified
libunity-2d-private/src/pointerbarrier.cpp (+6/-1)
tests/manual-tests/other.txt (+5/-0)
To merge this branch: bzr merge lp:~aacid/unity-2d/barrier_creation_can_fail
Reviewer Review Type Date Requested Status
Gerry Boland Pending
Review via email: mp+103639@code.launchpad.net

Commit message

Pointer barrier creation can fail, don't crash if that happens

Description of the change

Pointer barrier creation can fail, don't crash if that happens
UNBLOCK

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libunity-2d-private/src/pointerbarrier.cpp'
2--- libunity-2d-private/src/pointerbarrier.cpp 2012-04-03 08:33:04 +0000
3+++ libunity-2d-private/src/pointerbarrier.cpp 2012-04-26 09:58:19 +0000
4@@ -21,6 +21,8 @@
5
6 // libunity-2d
7 #include "pointerbarriermanager.h"
8+#include "config.h"
9+#include "debug_p.h"
10
11 // Self
12 #include "pointerbarrier.h"
13@@ -185,7 +187,10 @@
14 m_threshold,
15 0,
16 NULL);
17- Q_ASSERT(m_barrier != 0);
18+ if (m_barrier == 0) {
19+ UQ_WARNING << "Pointer barrier creation failed. This can happen when using a non standard X server, autohiding launcher and sticky edges won't be available.";
20+ launcher2dConfiguration().setProperty("hideMode", 0);
21+ }
22 }
23
24 void PointerBarrierWrapper::destroyBarrier()
25
26=== modified file 'tests/manual-tests/other.txt'
27--- tests/manual-tests/other.txt 2012-04-03 09:58:39 +0000
28+++ tests/manual-tests/other.txt 2012-04-26 09:58:19 +0000
29@@ -14,3 +14,8 @@
30 * Disable sticky edges
31
32 -> Verify that there is no mouse barrier between the two screens
33+----
34+ * Log in into a machine that uses NX (or any X server that does not support PointerBarriers)
35+ * Set the launcher to autohide
36+
37+-> Verify that there is no crash and the launcher is set back always shown

Subscribers

People subscribed via source and target branches