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

Proposed by Albert Astals Cid
Status: Merged
Approved by: Michał Sawicz
Approved revision: 882
Merged at revision: 892
Proposed branch: lp:~aacid/unity-2d/unity-2d_backport_shell_unity2ddeclarativeview
Merge into: lp:unity-2d
Diff against target: 106 lines (+17/-16)
5 files modified
libunity-2d-private/src/unity2ddeclarativeview.cpp (+12/-0)
libunity-2d-private/src/unity2ddeclarativeview.h (+4/-0)
places/app/dashdeclarativeview.cpp (+1/-1)
spread/app/spreadview.cpp (+0/-12)
spread/app/spreadview.h (+0/-3)
To merge this branch: bzr merge lp:~aacid/unity-2d/unity-2d_backport_shell_unity2ddeclarativeview
Reviewer Review Type Date Requested Status
Michał Sawicz Abstain
Albert Astals Cid (community) Disapprove
Review via email: mp+91036@code.launchpad.net

Description of the change

Add visibleChanged() signal to unity2ddeclarativeview

To post a comment you must log in.
Revision history for this message
Albert Astals Cid (aacid) wrote :
Revision history for this message
Florian Boucault (fboucault) wrote :

Instead of a shown signal I'm thinking it might be better to have the 'visible' property defined as done in rev 859 of lp:~fboucault/unity-2d/nautilus_window_instead_of_wallpaper

http://bazaar.launchpad.net/~fboucault/unity-2d/nautilus_window_instead_of_wallpaper/revision/859

Revision history for this message
Albert Astals Cid (aacid) wrote :

Well, the idea of these MR is to reduce the diff size between unity-2d-shell and unity-2d, I'm not saying your approach is better or worse but if we add that we increase the diff size instead of reducing it :D

Revision history for this message
Florian Boucault (fboucault) wrote :

Decide if it is better or worse, settle on one solution, get it merged into lp:unity-2d and in unity-2d-shell. Then we will have good code and no diff.

Revision history for this message
Albert Astals Cid (aacid) wrote :
review: Disapprove
Revision history for this message
Albert Astals Cid (aacid) wrote :

Err? Ignore my disapprove, don't know how it got there

Revision history for this message
Michał Sawicz (saviq) wrote :

Code looks good, tests pass.

review: Approve
Revision history for this message
Michał Sawicz (saviq) wrote :

Let's wait a bit for this.

review: Abstain
Revision history for this message
Michał Sawicz (saviq) :
review: Approve
Revision history for this message
Michał Sawicz (saviq) wrote :

MR Approval awaiting lift of code freeze.

review: Abstain

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libunity-2d-private/src/unity2ddeclarativeview.cpp'
2--- libunity-2d-private/src/unity2ddeclarativeview.cpp 2011-12-08 19:41:38 +0000
3+++ libunity-2d-private/src/unity2ddeclarativeview.cpp 2012-02-03 12:13:24 +0000
4@@ -21,6 +21,7 @@
5 #include <QVariant>
6 #include <QX11Info>
7 #include <QFileInfo>
8+#include <QShowEvent>
9
10 #include <X11/Xlib.h>
11 #include <X11/Xatom.h>
12@@ -158,6 +159,17 @@
13 Q_EMIT globalPositionChanged(globalPosition());
14 }
15
16+void Unity2DDeclarativeView::showEvent(QShowEvent* event)
17+{
18+ QDeclarativeView::showEvent(event);
19+ Q_EMIT visibleChanged(true);
20+}
21+
22+void Unity2DDeclarativeView::hideEvent(QHideEvent* event)
23+{
24+ QDeclarativeView::hideEvent(event);
25+ Q_EMIT visibleChanged(false);
26+}
27
28 /* Obtaining & Discarding Keyboard Focus for Window on Demand
29 *
30
31=== modified file 'libunity-2d-private/src/unity2ddeclarativeview.h'
32--- libunity-2d-private/src/unity2ddeclarativeview.h 2011-12-08 19:41:38 +0000
33+++ libunity-2d-private/src/unity2ddeclarativeview.h 2012-02-03 12:13:24 +0000
34@@ -26,6 +26,7 @@
35 Q_PROPERTY(bool useOpenGL READ useOpenGL WRITE setUseOpenGL NOTIFY useOpenGLChanged)
36 Q_PROPERTY(bool transparentBackground READ transparentBackground WRITE setTransparentBackground NOTIFY transparentBackgroundChanged)
37 Q_PROPERTY(QPoint globalPosition READ globalPosition NOTIFY globalPositionChanged)
38+ Q_PROPERTY(bool visible READ isVisible NOTIFY visibleChanged)
39
40 public:
41 Unity2DDeclarativeView(QWidget *parent = 0);
42@@ -44,10 +45,13 @@
43 void useOpenGLChanged(bool);
44 void transparentBackgroundChanged(bool);
45 void globalPositionChanged(QPoint);
46+ void visibleChanged(bool);
47
48 protected:
49 void setupViewport();
50 virtual void moveEvent(QMoveEvent* event);
51+ virtual void showEvent(QShowEvent *event);
52+ virtual void hideEvent(QHideEvent* event);
53
54 protected Q_SLOTS:
55 void forceActivateWindow();
56
57=== modified file 'places/app/dashdeclarativeview.cpp'
58--- places/app/dashdeclarativeview.cpp 2012-01-26 13:12:12 +0000
59+++ places/app/dashdeclarativeview.cpp 2012-02-03 12:13:24 +0000
60@@ -134,7 +134,7 @@
61 void
62 DashDeclarativeView::showEvent(QShowEvent *event)
63 {
64- QDeclarativeView::showEvent(event);
65+ Unity2DDeclarativeView::showEvent(event);
66 /* Note that this has to be called everytime the window is shown, as the WM
67 will remove the flags when the window is hidden */
68 setWMFlags();
69
70=== modified file 'spread/app/spreadview.cpp'
71--- spread/app/spreadview.cpp 2011-12-08 18:39:18 +0000
72+++ spread/app/spreadview.cpp 2012-02-03 12:13:24 +0000
73@@ -97,15 +97,3 @@
74
75 return false;
76 }
77-
78-void SpreadView::showEvent(QShowEvent *event)
79-{
80- Q_UNUSED(event);
81- Q_EMIT visibleChanged(true);
82-}
83-
84-void SpreadView::hideEvent(QHideEvent *event)
85-{
86- Q_UNUSED(event);
87- Q_EMIT visibleChanged(false);
88-}
89
90=== modified file 'spread/app/spreadview.h'
91--- spread/app/spreadview.h 2011-12-08 18:39:18 +0000
92+++ spread/app/spreadview.h 2012-02-03 12:13:24 +0000
93@@ -39,13 +39,10 @@
94 protected:
95 virtual void focusInEvent( QFocusEvent * event );
96 virtual void focusOutEvent( QFocusEvent * event );
97- virtual void showEvent(QShowEvent *event);
98- virtual void hideEvent(QHideEvent *event);
99 bool eventFilter(QObject *obj, QEvent *event);
100
101 Q_SIGNALS:
102 void outsideClick();
103- void visibleChanged(bool visible);
104 };
105
106 #endif // SPREADVIEW_H

Subscribers

People subscribed via source and target branches