···135 if [ -x $out/bin/glib-compile-schemas -a -w $out/share/glib-2.0/schemas ]; then
136 $out/bin/glib-compile-schemas $out/share/glib-2.0/schemas
137 fi
0000138 '';
139 };
140
···135 if [ -x $out/bin/glib-compile-schemas -a -w $out/share/glib-2.0/schemas ]; then
136 $out/bin/glib-compile-schemas $out/share/glib-2.0/schemas
137 fi
138+139+ if [ -x $out/bin/update-desktop-database -a -w $out/share/applications ]; then
140+ $out/bin/update-desktop-database $out/share/applications
141+ fi
142 '';
143 };
144
···1+commit 831bd07b0d6b7055fea8317f2cdf8fd4a408c36d
2+Author: Jasper St. Pierre <jstpierre@mecheye.net>
3+Date: Thu Nov 7 17:14:47 2013 -0500
4+5+ layout: Fix several issues with the background management code
6+7+ If monitor-changed fires at startup, it will destroy all of the
8+ backgrounds, but since this._isStartup is true, won't recreate any
9+ of them. Additionally, since _bgManagers is indexed by monitor index,
10+ if the primary index is not 0, it could become a sparse array (e.g.
11+ [undefined, undefined, primaryBackground]), and our for loop will
12+ crash trying to access properties of undefined.
13+14+ Fix both of these issues by always creating background managers for
15+ every monitor, hiding them on startup but only showing them after
16+ the startup animation is complete.
17+18+ One thing we need to watch out for is that while LayoutManager is
19+ constructing, Main.uiGroup / Main.layoutManager will be undefined,
20+ so addBackgroundMenu will fail. Fix this by passing down the uiGroup
21+ to the background menu code.
22+23+ https://bugzilla.gnome.org/show_bug.cgi?id=709313
24+25+diff --git a/js/ui/backgroundMenu.js b/js/ui/backgroundMenu.js
26+index 06e698c..dcbbb39 100644
27+--- a/js/ui/backgroundMenu.js
28++++ b/js/ui/backgroundMenu.js
29+@@ -13,7 +13,7 @@ const BackgroundMenu = new Lang.Class({
30+ Name: 'BackgroundMenu',
31+ Extends: PopupMenu.PopupMenu,
32+33+- _init: function(source) {
34++ _init: function(source, layoutManager) {
35+ this.parent(source, 0, St.Side.TOP);
36+37+ this.addSettingsAction(_("Settings"), 'gnome-control-center.desktop');
38+@@ -22,17 +22,17 @@ const BackgroundMenu = new Lang.Class({
39+40+ this.actor.add_style_class_name('background-menu');
41+42+- Main.uiGroup.add_actor(this.actor);
43++ layoutManager.uiGroup.add_actor(this.actor);
44+ this.actor.hide();
45+ }
46+ });
47+48+-function addBackgroundMenu(actor) {
49++function addBackgroundMenu(actor, layoutManager) {
50+ let cursor = new St.Bin({ opacity: 0 });
51+- Main.uiGroup.add_actor(cursor);
52++ layoutManager.uiGroup.add_actor(cursor);
53+54+ actor.reactive = true;
55+- actor._backgroundMenu = new BackgroundMenu(cursor);
56++ actor._backgroundMenu = new BackgroundMenu(cursor, layoutManager);
57+ actor._backgroundManager = new PopupMenu.PopupMenuManager({ actor: actor });
58+ actor._backgroundManager.addMenu(actor._backgroundMenu);
59+60+diff --git a/js/ui/layout.js b/js/ui/layout.js
61+index 17073a6..80bae9d 100644
62+--- a/js/ui/layout.js
63++++ b/js/ui/layout.js
64+@@ -352,26 +352,26 @@ const LayoutManager = new Lang.Class({
65+ this.emit('hot-corners-changed');
66+ },
67+68+- _createBackground: function(monitorIndex) {
69++ _addBackgroundMenu: function(bgManager) {
70++ BackgroundMenu.addBackgroundMenu(bgManager.background.actor, this);
71++ },
72++
73++ _createBackgroundManager: function(monitorIndex) {
74+ let bgManager = new Background.BackgroundManager({ container: this._backgroundGroup,
75+ layoutManager: this,
76+ monitorIndex: monitorIndex });
77+- BackgroundMenu.addBackgroundMenu(bgManager.background.actor);
78+-
79+- bgManager.connect('changed', Lang.bind(this, function() {
80+- BackgroundMenu.addBackgroundMenu(bgManager.background.actor);
81+- }));
82+83+- this._bgManagers[monitorIndex] = bgManager;
84++ bgManager.connect('changed', Lang.bind(this, this._addBackgroundMenu));
85++ this._addBackgroundMenu(bgManager);
86+87+- return bgManager.background;
88++ return bgManager;
89+ },
90+91+- _createSecondaryBackgrounds: function() {
92++ _showSecondaryBackgrounds: function() {
93+ for (let i = 0; i < this.monitors.length; i++) {
94+ if (i != this.primaryIndex) {
95+- let background = this._createBackground(i);
96+-
97++ let background = this._bgManagers[i].background;
98++ background.actor.show();
99+ background.actor.opacity = 0;
100+ Tweener.addTween(background.actor,
101+ { opacity: 255,
102+@@ -381,10 +381,6 @@ const LayoutManager = new Lang.Class({
103+ }
104+ },
105+106+- _createPrimaryBackground: function() {
107+- this._createBackground(this.primaryIndex);
108+- },
109+-
110+ _updateBackgrounds: function() {
111+ let i;
112+ for (i = 0; i < this._bgManagers.length; i++)
113+@@ -395,11 +391,12 @@ const LayoutManager = new Lang.Class({
114+ if (Main.sessionMode.isGreeter)
115+ return;
116+117+- if (this._startingUp)
118+- return;
119+-
120+ for (let i = 0; i < this.monitors.length; i++) {
121+- this._createBackground(i);
122++ let bgManager = this._createBackgroundManager(i);
123++ this._bgManagers.push(bgManager);
124++
125++ if (i != this.primaryIndex && this._startingUp)
126++ bgManager.background.actor.hide();
127+ }
128+ },
129+130+@@ -595,7 +592,7 @@ const LayoutManager = new Lang.Class({
131+ if (Main.sessionMode.isGreeter) {
132+ this.panelBox.translation_y = -this.panelBox.height;
133+ } else {
134+- this._createPrimaryBackground();
135++ this._updateBackgrounds();
136+137+ // We need to force an update of the regions now before we scale
138+ // the UI group to get the coorect allocation for the struts.
139+@@ -673,7 +670,7 @@ const LayoutManager = new Lang.Class({
140+ this.keyboardBox.show();
141+142+ if (!Main.sessionMode.isGreeter) {
143+- this._createSecondaryBackgrounds();
144++ this._showSecondaryBackgrounds();
145+ global.window_group.remove_clip();
146+ }
147+