Merge lp:~unity-2d-team/unity-2d/real-transparency into lp:unity-2d/3.0

Proposed by Ugo Riboni
Status: Merged
Merged at revision: 586
Proposed branch: lp:~unity-2d-team/unity-2d/real-transparency
Merge into: lp:unity-2d/3.0
Diff against target: 647 lines (+174/-240)
17 files modified
debian/libunity-2d-private0.install (+1/-0)
launcher/Launcher.qml (+18/-2)
launcher/app/launcher.cpp (+1/-4)
launcher/app/launcherview.cpp (+8/-0)
libunity-2d-private/Unity2d/CMakeLists.txt (+3/-1)
libunity-2d-private/Unity2d/GnomeBackground.qml (+113/-0)
libunity-2d-private/Unity2d/qmldir (+2/-0)
libunity-2d-private/Unity2d/screeninfo.cpp (+5/-0)
libunity-2d-private/Unity2d/screeninfo.h (+4/-0)
libunity-2d-private/src/unity2dpanel.cpp (+8/-2)
libunity-2d-private/src/unity2dpanel.h (+1/-1)
places/GnomeBackground.qml (+0/-107)
places/app/dashdeclarativeview.cpp (+0/-6)
places/app/dashdeclarativeview.h (+0/-3)
places/dash.qml (+6/-5)
spread/GnomeBackground.qml (+0/-109)
spread/Workspace.qml (+4/-0)
To merge this branch: bzr merge lp:~unity-2d-team/unity-2d/real-transparency
Reviewer Review Type Date Requested Status
Florian Boucault (community) Approve
Review via email: mp+62096@code.launchpad.net

Commit message

[dash][launcher] Implement real transparency when there's a compositor running.

Description of the change

This branch implements real transparency in the launcher and dash when a compositing manager is active.

The opacity of the transparency may be off and need to be double checked.

Please also note that I put in some fixes in the GnomeBackground QML class, which now is not tied anymore to a specific view (it is still copied in two places, but it's easier to merge into a plugin when we decide to do that).

There's also a fix for performance, so that the fake background is only loaded when the compositor is not running.

Finally, please note that the bug regarding slideshow backgrounds (703574) is fixed by this patch only when compositing mode is running. The fake transparency code still has the issue.
I suppose it can be fixed in the fake transparency case by taking the screenshot of the Nautilus desktop window, but then it would need to look for damage events on that window and update, and I didn't have time to implement that solution yet.

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

The panel exhibits visual artifacts. See http://people.canonical.com/~kaleo/transparency_bugs.png

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

The background of the launcher used to have a one pixel line on its right. It is important to the visual design.

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

The spread used to have a few pixels of separation between each workspace.

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

The spread performance is highly hampered with that patch. Going in and out of the spread is sluggish (quite more than before).

review: Needs Fixing
Revision history for this message
Ugo Riboni (uriboni) wrote :

The revisions I just pushed should have put back the space between the workspaces in the spread, and fixed the performance regression.

I also put back the border in the launcher. I'm not sure if the way I did it was the most efficient. I also thought of using a 1px wide Rectangle, but went for the tiled pixel for now. Should be easy to change if you think it's better the other way around.

Finally I could not reproduce the corruption in the panel. I am unsure what may cause it since as you can see I don't touch anything in the panel.

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

Everything is good to go now :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/libunity-2d-private0.install'
--- debian/libunity-2d-private0.install 2011-02-02 16:57:00 +0000
+++ debian/libunity-2d-private0.install 2011-06-06 17:26:28 +0000
@@ -1,3 +1,4 @@
1usr/lib/libunity-2d-private.so.*1usr/lib/libunity-2d-private.so.*
2usr/lib/qt4/imports/Unity2d/libunity-2d-private-qml.so2usr/lib/qt4/imports/Unity2d/libunity-2d-private-qml.so
3usr/lib/qt4/imports/Unity2d/qmldir3usr/lib/qt4/imports/Unity2d/qmldir
4usr/lib/qt4/imports/Unity2d/*.qml
45
=== modified file 'launcher/Launcher.qml'
--- launcher/Launcher.qml 2011-05-11 10:29:54 +0000
+++ launcher/Launcher.qml 2011-06-06 17:26:28 +0000
@@ -23,10 +23,26 @@
23DropItem {23DropItem {
24 id: launcher24 id: launcher
2525
26 GnomeBackground {
27 anchors.fill: parent
28 overlay_color: "black"
29 overlay_alpha: 0.66
30 visible: !screen.isCompositingManagerRunning
31 }
32
33 Rectangle {
34 anchors.fill: parent
35 color: "black"
36 opacity: 0.66
37 visible: screen.isCompositingManagerRunning
38 }
39
26 Image {40 Image {
27 id: background41 id: border
2842
29 anchors.fill: parent43 width: 1
44 height: parent.height
45 anchors.right: parent.right
30 fillMode: Image.TileVertically46 fillMode: Image.TileVertically
31 source: "artwork/background.png"47 source: "artwork/background.png"
32 }48 }
3349
=== modified file 'launcher/app/launcher.cpp'
--- launcher/app/launcher.cpp 2011-06-06 09:23:48 +0000
+++ launcher/app/launcher.cpp 2011-06-06 17:26:28 +0000
@@ -106,7 +106,7 @@
106 Unity2dTr::init("unity-2d", INSTALL_PREFIX "/share/locale");106 Unity2dTr::init("unity-2d", INSTALL_PREFIX "/share/locale");
107107
108 /* Panel containing the QML declarative view */108 /* Panel containing the QML declarative view */
109 Unity2dPanel panel;109 Unity2dPanel panel(true);
110 panel.setEdge(Unity2dPanel::LeftEdge);110 panel.setEdge(Unity2dPanel::LeftEdge);
111 panel.setFixedWidth(LauncherClient::MaximumWidth);111 panel.setFixedWidth(LauncherClient::MaximumWidth);
112112
@@ -116,9 +116,6 @@
116 LauncherView *launcherView = new LauncherView(&panel);116 LauncherView *launcherView = new LauncherView(&panel);
117 launcherView->setUseOpenGL(arguments.contains("-opengl"));117 launcherView->setUseOpenGL(arguments.contains("-opengl"));
118118
119 /* FIXME: possible optimisations */
120// launcherView->setAttribute(Qt::WA_OpaquePaintEvent);
121// launcherView->setAttribute(Qt::WA_NoSystemBackground);
122 launcherView->setResizeMode(QDeclarativeView::SizeRootObjectToView);119 launcherView->setResizeMode(QDeclarativeView::SizeRootObjectToView);
123 launcherView->setFocus();120 launcherView->setFocus();
124121
125122
=== modified file 'launcher/app/launcherview.cpp'
--- launcher/app/launcherview.cpp 2011-05-30 18:46:16 +0000
+++ launcher/app/launcherview.cpp 2011-06-06 17:26:28 +0000
@@ -61,6 +61,14 @@
61 Unity2DDeclarativeView(parent),61 Unity2DDeclarativeView(parent),
62 m_superKeyPressed(false), m_superKeyHeld(false)62 m_superKeyPressed(false), m_superKeyHeld(false)
63{63{
64 if (QX11Info::isCompositingManagerRunning()) {
65 setAttribute(Qt::WA_TranslucentBackground);
66 viewport()->setAttribute(Qt::WA_TranslucentBackground);
67 } else {
68 setAttribute(Qt::WA_OpaquePaintEvent);
69 setAttribute(Qt::WA_NoSystemBackground);
70 }
71
64 m_superKeyHoldTimer.setSingleShot(true);72 m_superKeyHoldTimer.setSingleShot(true);
65 m_superKeyHoldTimer.setInterval(KEY_HOLD_THRESHOLD);73 m_superKeyHoldTimer.setInterval(KEY_HOLD_THRESHOLD);
66 connect(&m_superKeyHoldTimer, SIGNAL(timeout()), SLOT(updateSuperKeyHoldState()));74 connect(&m_superKeyHoldTimer, SIGNAL(timeout()), SLOT(updateSuperKeyHoldState()));
6775
=== modified file 'launcher/artwork/background.png'
68Binary files launcher/artwork/background.png 2011-02-09 19:32:23 +0000 and launcher/artwork/background.png 2011-06-06 17:26:28 +0000 differ76Binary files launcher/artwork/background.png 2011-02-09 19:32:23 +0000 and launcher/artwork/background.png 2011-06-06 17:26:28 +0000 differ
=== modified file 'libunity-2d-private/Unity2d/CMakeLists.txt'
--- libunity-2d-private/Unity2d/CMakeLists.txt 2011-05-18 15:47:16 +0000
+++ libunity-2d-private/Unity2d/CMakeLists.txt 2011-06-06 17:26:28 +0000
@@ -34,6 +34,8 @@
34 dropitem.h34 dropitem.h
35 )35 )
3636
37file(GLOB unity-2d-private-qml_QML *.qml)
38
37qt4_wrap_cpp(unity-2d-private-qml_MOC_SRCS ${unity-2d-private-qml_MOC_HDRS})39qt4_wrap_cpp(unity-2d-private-qml_MOC_SRCS ${unity-2d-private-qml_MOC_HDRS})
3840
39# Build41# Build
@@ -65,7 +67,7 @@
65 LIBRARY DESTINATION ${IMPORT_INSTALL_DIR}67 LIBRARY DESTINATION ${IMPORT_INSTALL_DIR}
66 )68 )
6769
68install(FILES qmldir70install(FILES qmldir ${unity-2d-private-qml_QML}
69 DESTINATION ${IMPORT_INSTALL_DIR}71 DESTINATION ${IMPORT_INSTALL_DIR}
70 )72 )
7173
7274
=== added file 'libunity-2d-private/Unity2d/GnomeBackground.qml'
--- libunity-2d-private/Unity2d/GnomeBackground.qml 1970-01-01 00:00:00 +0000
+++ libunity-2d-private/Unity2d/GnomeBackground.qml 2011-06-06 17:26:28 +0000
@@ -0,0 +1,113 @@
1/*
2 * This file is part of unity-2d
3 *
4 * Copyright 2010-2011 Canonical Ltd.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 3.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19import Qt 4.7
20import gconf 1.0
21/* Necessary to access the blended image provider and CacheEffect */
22import Unity2d 1.0
23
24Item {
25 property string overlay_color
26 property real overlay_alpha
27
28 /* Avoid redraw at rendering */
29 CacheEffect {
30 id: cacheEffect
31 }
32 property bool cached: true
33 effect: (cached) ? cacheEffect : null
34
35 GConfItem {
36 id: primary_color
37 key: "/desktop/gnome/background/primary_color"
38 }
39
40 GConfItem {
41 id: picture_filename
42 key: "/desktop/gnome/background/picture_filename"
43 }
44
45 GConfItem {
46 id: picture_options
47 key: "/desktop/gnome/background/picture_options"
48 }
49
50 Rectangle {
51 Rectangle {
52 anchors.fill: parent
53 opacity: overlay_alpha
54 color: overlay_color
55 }
56
57 anchors.fill: parent
58 color: primary_color.value
59 }
60
61 Image {
62 id: picture
63
64 visible: picture_filename.value
65 source: {
66 if (!visible) return ""
67
68 /* FIXME: Because /usr/share/backgrounds/warty-final-ubuntu.png is
69 actually a jpeg and Qt relies by default on the extension
70 that particular background fails to load. We workaround
71 it by having our own symlink with a 'jpg' extension.
72
73 References:
74 https://bugs.launchpad.net/ubuntu/+source/ubuntu-wallpapers/+bug/296538
75 http://bugreports.qt.nokia.com/browse/QTBUG-7276
76 */
77 var filename = picture_filename.value
78 if(filename == "/usr/share/backgrounds/warty-final-ubuntu.png")
79 filename = engineBaseUrl + "artwork/warty-final-ubuntu.jpg"
80
81 if(overlay_alpha > 0.0)
82 return "image://blended/%1color=%2alpha=%3".arg(filename).arg(overlay_color).arg(overlay_alpha)
83 else
84 return filename
85 }
86 width: screen.geometry.width
87 height: screen.geometry.height
88
89 smooth: true
90 x: screen.availableGeometry.x
91 y: -screen.availableGeometry.y
92
93 /* Possible modes are:
94 - "wallpaper"
95 - "centered" (NOT IMPLEMENTED)
96 - "scaled"
97 - "stretched"
98 - "zoom"
99 - "spanned" (NOT IMPLEMENTED)
100 */
101 fillMode: {
102 if(picture_options.value == "wallpaper")
103 return Image.Tile
104 else if(picture_options.value == "scaled")
105 return Image.PreserveAspectFit
106 else if(picture_options.value == "stretched")
107 return Image.Stretch
108 else if(picture_options.value == "zoom")
109 return Image.PreserveAspectCrop
110 else return Image.PreserveAspectFit
111 }
112 }
113}
0114
=== modified file 'libunity-2d-private/Unity2d/qmldir'
--- libunity-2d-private/Unity2d/qmldir 2011-02-02 16:57:00 +0000
+++ libunity-2d-private/Unity2d/qmldir 2011-06-06 17:26:28 +0000
@@ -1,1 +1,3 @@
1plugin unity-2d-private-qml1plugin unity-2d-private-qml
2
3GnomeBackground 1.0 GnomeBackground.qml
24
=== modified file 'libunity-2d-private/Unity2d/screeninfo.cpp'
--- libunity-2d-private/Unity2d/screeninfo.cpp 2011-02-08 12:34:50 +0000
+++ libunity-2d-private/Unity2d/screeninfo.cpp 2011-06-06 17:26:28 +0000
@@ -93,3 +93,8 @@
93 Q_EMIT availableGeometryChanged(availableGeometry());93 Q_EMIT availableGeometryChanged(availableGeometry());
94 }94 }
95}95}
96
97bool ScreenInfo::isCompositingManagerRunning() const
98{
99 return QX11Info::isCompositingManagerRunning();
100}
96101
=== modified file 'libunity-2d-private/Unity2d/screeninfo.h'
--- libunity-2d-private/Unity2d/screeninfo.h 2011-02-08 12:34:50 +0000
+++ libunity-2d-private/Unity2d/screeninfo.h 2011-06-06 17:26:28 +0000
@@ -21,6 +21,8 @@
21 Q_PROPERTY(unsigned int activeWindow READ activeWindow NOTIFY activeWindowChanged)21 Q_PROPERTY(unsigned int activeWindow READ activeWindow NOTIFY activeWindowChanged)
22 Q_PROPERTY(QRect geometry READ geometry NOTIFY geometryChanged)22 Q_PROPERTY(QRect geometry READ geometry NOTIFY geometryChanged)
23 Q_PROPERTY(QRect availableGeometry READ availableGeometry NOTIFY availableGeometryChanged)23 Q_PROPERTY(QRect availableGeometry READ availableGeometry NOTIFY availableGeometryChanged)
24 Q_PROPERTY(bool isCompositingManagerRunning READ isCompositingManagerRunning
25 NOTIFY isCompositingManagerRunningChanged)
2426
25public:27public:
26 static ScreenInfo* instance();28 static ScreenInfo* instance();
@@ -35,12 +37,14 @@
35 unsigned int activeWindow() const { return m_activeWindow; }37 unsigned int activeWindow() const { return m_activeWindow; }
36 QRect availableGeometry() const;38 QRect availableGeometry() const;
37 QRect geometry() const;39 QRect geometry() const;
40 bool isCompositingManagerRunning() const;
3841
39Q_SIGNALS:42Q_SIGNALS:
40 void activeWindowChanged(unsigned int activeWindow);43 void activeWindowChanged(unsigned int activeWindow);
41 void geometryChanged(QRect geometry);44 void geometryChanged(QRect geometry);
42 void availableGeometryChanged(QRect availableGeometry);45 void availableGeometryChanged(QRect availableGeometry);
43 void workspacesChanged(WorkspacesInfo *workspaces);46 void workspacesChanged(WorkspacesInfo *workspaces);
47 void isCompositingManagerRunningChanged(bool);
4448
45private:49private:
46 explicit ScreenInfo(QObject *parent = 0);50 explicit ScreenInfo(QObject *parent = 0);
4751
=== modified file 'libunity-2d-private/src/unity2dpanel.cpp'
--- libunity-2d-private/src/unity2dpanel.cpp 2011-05-25 10:18:52 +0000
+++ libunity-2d-private/src/unity2dpanel.cpp 2011-06-06 17:26:28 +0000
@@ -131,7 +131,7 @@
131 }131 }
132};132};
133133
134Unity2dPanel::Unity2dPanel(QWidget* parent)134Unity2dPanel::Unity2dPanel(bool requiresTransparency, QWidget* parent)
135: QWidget(parent)135: QWidget(parent)
136, d(new Unity2dPanelPrivate)136, d(new Unity2dPanelPrivate)
137{137{
@@ -158,7 +158,13 @@
158158
159 setAttribute(Qt::WA_X11NetWmWindowTypeDock);159 setAttribute(Qt::WA_X11NetWmWindowTypeDock);
160 setAttribute(Qt::WA_Hover);160 setAttribute(Qt::WA_Hover);
161 setAutoFillBackground(true);161
162 if (QX11Info::isCompositingManagerRunning() && requiresTransparency) {
163 setAttribute(Qt::WA_TranslucentBackground);
164 } else {
165 setAutoFillBackground(true);
166 }
167
162 connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), SLOT(slotWorkAreaResized(int)));168 connect(QApplication::desktop(), SIGNAL(workAreaResized(int)), SLOT(slotWorkAreaResized(int)));
163}169}
164170
165171
=== modified file 'libunity-2d-private/src/unity2dpanel.h'
--- libunity-2d-private/src/unity2dpanel.h 2011-02-20 23:58:30 +0000
+++ libunity-2d-private/src/unity2dpanel.h 2011-06-06 17:26:28 +0000
@@ -50,7 +50,7 @@
50 TopEdge50 TopEdge
51 };51 };
5252
53 Unity2dPanel(QWidget* parent = 0);53 Unity2dPanel(bool requiresTransparency = false, QWidget* parent = 0);
54 ~Unity2dPanel();54 ~Unity2dPanel();
5555
56 void setEdge(Edge);56 void setEdge(Edge);
5757
=== removed file 'places/GnomeBackground.qml'
--- places/GnomeBackground.qml 2011-03-22 06:15:19 +0000
+++ places/GnomeBackground.qml 1970-01-01 00:00:00 +0000
@@ -1,107 +0,0 @@
1/*
2 * This file is part of unity-2d
3 *
4 * Copyright 2010-2011 Canonical Ltd.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 3.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19import Qt 4.7
20import gconf 1.0
21/* Necessary to access the blended image provider and CacheEffect */
22import Unity2d 1.0
23
24Item {
25 property string overlay_color
26 property real overlay_alpha
27
28 /* Avoid redraw at rendering */
29 effect: CacheEffect {}
30
31 GConfItem {
32 id: primary_color
33 key: "/desktop/gnome/background/primary_color"
34 }
35
36 GConfItem {
37 id: picture_filename
38 key: "/desktop/gnome/background/picture_filename"
39 }
40
41 GConfItem {
42 id: picture_options
43 key: "/desktop/gnome/background/picture_options"
44 }
45
46 Rectangle {
47 Rectangle {
48 anchors.fill: parent
49 opacity: overlay_alpha
50 color: overlay_color
51 }
52
53 anchors.fill: parent
54 color: primary_color.value
55 }
56
57 Image {
58 id: picture
59
60 visible: picture_filename.value
61 source: {
62 /* FIXME: Because /usr/share/backgrounds/warty-final-ubuntu.png is
63 actually a jpeg and Qt relies by default on the extension
64 that particular background fails to load. We workaround
65 it by having our own symlink with a 'jpg' extension.
66
67 References:
68 https://bugs.launchpad.net/ubuntu/+source/ubuntu-wallpapers/+bug/296538
69 http://bugreports.qt.nokia.com/browse/QTBUG-7276
70 */
71 var filename = picture_filename.value
72 if(filename == "/usr/share/backgrounds/warty-final-ubuntu.png")
73 filename = engineBaseUrl + "artwork/warty-final-ubuntu.jpg"
74
75 if(overlay_alpha > 0.0)
76 return "image://blended/%1color=%2alpha=%3".arg(filename).arg(overlay_color).arg(overlay_alpha)
77 else
78 return filename
79 }
80 width: dashView.screenGeometry.width
81 height: dashView.screenGeometry.height
82
83 smooth: true
84 x: -dashView.availableGeometry.x
85 y: -dashView.availableGeometry.y
86
87 /* Possible modes are:
88 - "wallpaper"
89 - "centered" (NOT IMPLEMENTED)
90 - "scaled"
91 - "stretched"
92 - "zoom"
93 - "spanned" (NOT IMPLEMENTED)
94 */
95 fillMode: {
96 if(picture_options.value == "wallpaper")
97 return Image.Tile
98 else if(picture_options.value == "scaled")
99 return Image.PreserveAspectFit
100 else if(picture_options.value == "stretched")
101 return Image.Stretch
102 else if(picture_options.value == "zoom")
103 return Image.PreserveAspectCrop
104 else return Image.PreserveAspectFit
105 }
106 }
107}
1080
=== modified file 'places/app/dashdeclarativeview.cpp'
--- places/app/dashdeclarativeview.cpp 2011-04-29 16:26:25 +0000
+++ places/app/dashdeclarativeview.cpp 2011-06-06 17:26:28 +0000
@@ -369,12 +369,6 @@
369}369}
370370
371bool371bool
372DashDeclarativeView::isCompositingManagerRunning() const
373{
374 return QX11Info::isCompositingManagerRunning();
375}
376
377bool
378DashDeclarativeView::connectToBus()372DashDeclarativeView::connectToBus()
379{373{
380 bool ok = QDBusConnection::sessionBus().registerService(DASH_DBUS_SERVICE);374 bool ok = QDBusConnection::sessionBus().registerService(DASH_DBUS_SERVICE);
381375
=== modified file 'places/app/dashdeclarativeview.h'
--- places/app/dashdeclarativeview.h 2011-04-29 16:26:25 +0000
+++ places/app/dashdeclarativeview.h 2011-06-06 17:26:28 +0000
@@ -33,7 +33,6 @@
33 Q_PROPERTY(QString activePlaceEntry READ activePlaceEntry WRITE setActivePlaceEntry NOTIFY activePlaceEntryChanged)33 Q_PROPERTY(QString activePlaceEntry READ activePlaceEntry WRITE setActivePlaceEntry NOTIFY activePlaceEntryChanged)
34 Q_PROPERTY(QRect screenGeometry READ screenGeometry NOTIFY screenGeometryChanged)34 Q_PROPERTY(QRect screenGeometry READ screenGeometry NOTIFY screenGeometryChanged)
35 Q_PROPERTY(QRect availableGeometry READ availableGeometry NOTIFY availableGeometryChanged)35 Q_PROPERTY(QRect availableGeometry READ availableGeometry NOTIFY availableGeometryChanged)
36 Q_PROPERTY(bool isCompositingManagerRunning READ isCompositingManagerRunning NOTIFY isCompositingManagerRunningChanged)
3736
38public:37public:
39 enum DashMode {38 enum DashMode {
@@ -50,7 +49,6 @@
50 const QRect screenGeometry() const;49 const QRect screenGeometry() const;
51 QRect availableGeometry() const;50 QRect availableGeometry() const;
52 bool expanded() const;51 bool expanded() const;
53 bool isCompositingManagerRunning() const;
5452
55 /* setters */53 /* setters */
56 Q_SLOT void setActive(bool active);54 Q_SLOT void setActive(bool active);
@@ -71,7 +69,6 @@
7169
72 void screenGeometryChanged();70 void screenGeometryChanged();
73 void availableGeometryChanged();71 void availableGeometryChanged();
74 void isCompositingManagerRunningChanged(bool);
7572
76protected:73protected:
77 void resizeEvent(QResizeEvent*);74 void resizeEvent(QResizeEvent*);
7875
=== modified file 'places/dash.qml'
--- places/dash.qml 2011-05-11 12:57:59 +0000
+++ places/dash.qml 2011-06-06 17:26:28 +0000
@@ -19,6 +19,7 @@
19import Qt 4.719import Qt 4.7
20import UnityApplications 1.0 /* Necessary for LauncherPlacesList */20import UnityApplications 1.0 /* Necessary for LauncherPlacesList */
21import Places 1.0 /* Necessary for DashDeclarativeView.*Dash */21import Places 1.0 /* Necessary for DashDeclarativeView.*Dash */
22import Unity2d 1.0 /* Necessary for GnomeBackground */
2223
23Item {24Item {
24 id: dash25 id: dash
@@ -86,21 +87,21 @@
86 GnomeBackground {87 GnomeBackground {
87 anchors.fill: parent88 anchors.fill: parent
88 overlay_color: "black"89 overlay_color: "black"
89 overlay_alpha: 0.7190 overlay_alpha: 0.89
90 visible: dashView.dashMode == DashDeclarativeView.FullScreenMode && !dashView.isCompositingManagerRunning91 visible: dashView.dashMode == DashDeclarativeView.FullScreenMode && !screen.isCompositingManagerRunning
91 }92 }
9293
93 Rectangle {94 Rectangle {
94 anchors.fill: parent95 anchors.fill: parent
95 color: "black"96 color: "black"
96 opacity: 0.6997 opacity: 0.89
97 visible: dashView.dashMode == DashDeclarativeView.FullScreenMode && dashView.isCompositingManagerRunning98 visible: dashView.dashMode == DashDeclarativeView.FullScreenMode && screen.isCompositingManagerRunning
98 }99 }
99100
100 BorderImage {101 BorderImage {
101 anchors.fill: parent102 anchors.fill: parent
102 visible: dashView.dashMode == DashDeclarativeView.DesktopMode103 visible: dashView.dashMode == DashDeclarativeView.DesktopMode
103 source: dashView.isCompositingManagerRunning ? "artwork/desktop_dash_background.sci" : "artwork/desktop_dash_background_no_transparency.sci"104 source: screen.isCompositingManagerRunning ? "artwork/desktop_dash_background.sci" : "artwork/desktop_dash_background_no_transparency.sci"
104 }105 }
105 /* /Backgrounds */106 /* /Backgrounds */
106107
107108
=== removed file 'spread/GnomeBackground.qml'
--- spread/GnomeBackground.qml 2011-04-19 14:11:36 +0000
+++ spread/GnomeBackground.qml 1970-01-01 00:00:00 +0000
@@ -1,109 +0,0 @@
1/*
2 * This file is part of unity-2d
3 *
4 * Copyright 2010-2011 Canonical Ltd.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 3.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19import Qt 4.7
20import gconf 1.0
21/* Necessary to access the blended image provider and CacheEffect */
22import Unity2d 1.0
23
24Item {
25 property string overlay_color
26 property real overlay_alpha
27 clip: true
28
29// FIXME: disabled since it doesn't work properly with a size animation
30// /* Avoid redraw at rendering */
31// effect: CacheEffect {}
32
33 GConfItem {
34 id: primary_color
35 key: "/desktop/gnome/background/primary_color"
36 }
37
38 GConfItem {
39 id: picture_filename
40 key: "/desktop/gnome/background/picture_filename"
41 }
42
43 GConfItem {
44 id: picture_options
45 key: "/desktop/gnome/background/picture_options"
46 }
47
48 Rectangle {
49 Rectangle {
50 anchors.fill: parent
51 opacity: overlay_alpha
52 color: overlay_color
53 }
54
55 anchors.fill: parent
56 color: primary_color.value
57 }
58
59 Image {
60 id: picture
61
62 visible: picture_filename.value
63 source: {
64 /* FIXME: Because /usr/share/backgrounds/warty-final-ubuntu.png is
65 actually a jpeg and Qt relies by default on the extension
66 that particular background fails to load. We workaround
67 it by having our own symlink with a 'jpg' extension.
68
69 References:
70 https://bugs.launchpad.net/ubuntu/+source/ubuntu-wallpapers/+bug/296538
71 http://bugreports.qt.nokia.com/browse/QTBUG-7276
72 */
73 var filename = picture_filename.value
74 if(filename == "/usr/share/backgrounds/warty-final-ubuntu.png")
75 filename = engineBaseUrl + "artwork/warty-final-ubuntu.jpg"
76
77 if(overlay_alpha > 0.0)
78 return "image://blended/%1color=%2alpha=%3".arg(filename).arg(overlay_color).arg(overlay_alpha)
79 else
80 return filename
81 }
82 width: screen.geometry.width
83 height: screen.geometry.height
84
85 smooth: true
86 x: - launcherMaximumWidth
87 y: - screen.availableGeometry.y
88
89 /* Possible modes are:
90 - "wallpaper"
91 - "centered" (NOT IMPLEMENTED)
92 - "scaled"
93 - "stretched"
94 - "zoom"
95 - "spanned" (NOT IMPLEMENTED)
96 */
97 fillMode: {
98 if(picture_options.value == "wallpaper")
99 return Image.Tile
100 else if(picture_options.value == "scaled")
101 return Image.PreserveAspectFit
102 else if(picture_options.value == "stretched")
103 return Image.Stretch
104 else if(picture_options.value == "zoom")
105 return Image.PreserveAspectCrop
106 else return Image.PreserveAspectFit
107 }
108 }
109}
1100
=== modified file 'spread/Workspace.qml'
--- spread/Workspace.qml 2011-03-22 06:04:20 +0000
+++ spread/Workspace.qml 2011-06-06 17:26:28 +0000
@@ -18,6 +18,7 @@
1818
19import Qt 4.719import Qt 4.7
20import "utils.js" as Utils20import "utils.js" as Utils
21import Unity2d 1.0 /* Necessary for GnomeBackground */
2122
22FocusScope {23FocusScope {
23 id: workspace24 id: workspace
@@ -37,6 +38,9 @@
37 anchors.fill: parent38 anchors.fill: parent
38 overlay_color: "black"39 overlay_color: "black"
39 overlay_alpha: 040 overlay_alpha: 0
41
42 clip: true
43 cached: false
40 }44 }
4145
42 Windows {46 Windows {

Subscribers

People subscribed via source and target branches

to all changes: