Merge lp:~aacid/unity-2d/unity-2d-shell_visible_changed_in_unity2ddeclarativeview into lp:~unity-2d-team/unity-2d/unity-2d-shell

Proposed by Albert Astals Cid
Status: Merged
Approved by: Michał Sawicz
Approved revision: 948
Merged at revision: 951
Proposed branch: lp:~aacid/unity-2d/unity-2d-shell_visible_changed_in_unity2ddeclarativeview
Merge into: lp:~unity-2d-team/unity-2d/unity-2d-shell
Diff against target: 97 lines (+12/-18)
5 files modified
libunity-2d-private/src/inputshapemanager.cpp (+1/-1)
libunity-2d-private/src/unity2ddeclarativeview.cpp (+8/-2)
libunity-2d-private/src/unity2ddeclarativeview.h (+3/-1)
spread/app/spreadview.cpp (+0/-12)
spread/app/spreadview.h (+0/-2)
To merge this branch: bzr merge lp:~aacid/unity-2d/unity-2d-shell_visible_changed_in_unity2ddeclarativeview
Reviewer Review Type Date Requested Status
Michał Sawicz Approve
Review via email: mp+91100@code.launchpad.net

Commit message

Define new 'visible' property on Unity2dDeclarativeView.

Clean up descendant classes handling of hideEvent and showEvent.

Description of the change

Merge rev 859 of lp:~fboucault/unity-2d/nautilus_window_instead_of_wallpaper as suggested by Florian

To post a comment you must log in.
Revision history for this message
Albert Astals Cid (aacid) wrote :
Revision history for this message
Michał Sawicz (saviq) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libunity-2d-private/src/inputshapemanager.cpp'
2--- libunity-2d-private/src/inputshapemanager.cpp 2012-01-12 18:47:24 +0000
3+++ libunity-2d-private/src/inputshapemanager.cpp 2012-02-01 15:01:22 +0000
4@@ -60,7 +60,7 @@
5 if (m_target != NULL) {
6 // due to the way xshape works we need to re-apply the shaping every time the target window
7 // is mapped again.
8- connect(m_target, SIGNAL(shown()), SLOT(updateManagedShape()));
9+ connect(m_target, SIGNAL(visibleChanged(bool)), SLOT(updateManagedShape()));
10 connect(m_target, SIGNAL(sceneResized(QSize)), SLOT(updateManagedShape()));
11 }
12 Q_EMIT targetChanged();
13
14=== modified file 'libunity-2d-private/src/unity2ddeclarativeview.cpp'
15--- libunity-2d-private/src/unity2ddeclarativeview.cpp 2012-01-24 04:05:56 +0000
16+++ libunity-2d-private/src/unity2ddeclarativeview.cpp 2012-02-01 15:01:22 +0000
17@@ -159,11 +159,17 @@
18 Q_EMIT globalPositionChanged(globalPosition());
19 }
20
21-void Unity2DDeclarativeView::showEvent(QShowEvent *event)
22+void Unity2DDeclarativeView::showEvent(QShowEvent* event)
23 {
24- Q_EMIT shown();
25+ QDeclarativeView::showEvent(event);
26+ Q_EMIT visibleChanged(true);
27 }
28
29+void Unity2DDeclarativeView::hideEvent(QHideEvent* event)
30+{
31+ QDeclarativeView::hideEvent(event);
32+ Q_EMIT visibleChanged(false);
33+}
34
35 /* Obtaining & Discarding Keyboard Focus for Window on Demand
36 *
37
38=== modified file 'libunity-2d-private/src/unity2ddeclarativeview.h'
39--- libunity-2d-private/src/unity2ddeclarativeview.h 2012-01-24 16:20:13 +0000
40+++ libunity-2d-private/src/unity2ddeclarativeview.h 2012-02-01 15:01:22 +0000
41@@ -26,6 +26,7 @@
42 Q_PROPERTY(bool useOpenGL READ useOpenGL WRITE setUseOpenGL NOTIFY useOpenGLChanged)
43 Q_PROPERTY(bool transparentBackground READ transparentBackground WRITE setTransparentBackground NOTIFY transparentBackgroundChanged)
44 Q_PROPERTY(QPoint globalPosition READ globalPosition NOTIFY globalPositionChanged)
45+ Q_PROPERTY(bool visible READ isVisible NOTIFY visibleChanged)
46
47 public:
48 Unity2DDeclarativeView(QWidget *parent = 0);
49@@ -44,13 +45,14 @@
50 void useOpenGLChanged(bool);
51 void transparentBackgroundChanged(bool);
52 void globalPositionChanged(QPoint);
53- void shown();
54+ void visibleChanged(bool);
55 void activeWorkspaceChanged();
56
57 protected:
58 void setupViewport();
59 virtual void moveEvent(QMoveEvent* event);
60 virtual void showEvent(QShowEvent *event);
61+ virtual void hideEvent(QHideEvent* event);
62
63 protected Q_SLOTS:
64 void forceActivateWindow();
65
66=== modified file 'spread/app/spreadview.cpp'
67--- spread/app/spreadview.cpp 2011-12-08 18:39:18 +0000
68+++ spread/app/spreadview.cpp 2012-02-01 15:01:22 +0000
69@@ -97,15 +97,3 @@
70
71 return false;
72 }
73-
74-void SpreadView::showEvent(QShowEvent *event)
75-{
76- Q_UNUSED(event);
77- Q_EMIT visibleChanged(true);
78-}
79-
80-void SpreadView::hideEvent(QHideEvent *event)
81-{
82- Q_UNUSED(event);
83- Q_EMIT visibleChanged(false);
84-}
85
86=== modified file 'spread/app/spreadview.h'
87--- spread/app/spreadview.h 2011-12-08 18:39:18 +0000
88+++ spread/app/spreadview.h 2012-02-01 15:01:22 +0000
89@@ -39,8 +39,6 @@
90 protected:
91 virtual void focusInEvent( QFocusEvent * event );
92 virtual void focusOutEvent( QFocusEvent * event );
93- virtual void showEvent(QShowEvent *event);
94- virtual void hideEvent(QHideEvent *event);
95 bool eventFilter(QObject *obj, QEvent *event);
96
97 Q_SIGNALS:

Subscribers

People subscribed via source and target branches