From ac470b44ef1457480c93079f8148a160a4ea4869 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Wed, 20 Oct 2010 21:24:15 +0200 Subject: [PATCH 01/27] Fix control center panel for audio. It is "sound", not "volume". --- js/ui/status/volume.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/ui/status/volume.js b/js/ui/status/volume.js index 92f17def1..48cb6a399 100644 --- a/js/ui/status/volume.js +++ b/js/ui/status/volume.js @@ -60,7 +60,7 @@ Indicator.prototype = { this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); this.menu.addAction(_("Sound Preferences"), function() { - let p = new Shell.Process({ args: ['gnome-control-center', 'volume'] }); + let p = new Shell.Process({ args: ['gnome-control-center', 'sound'] }); p.run(); }); From fe1a9c2b4b4fee9ccb7e523db1cd2cecca148e86 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Wed, 20 Oct 2010 21:15:24 +0200 Subject: [PATCH 02/27] Fix showing input volume Fix two typos in code that decided whether to show input volume and mute switch. --- js/ui/status/volume.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/ui/status/volume.js b/js/ui/status/volume.js index 48cb6a399..8753c718b 100644 --- a/js/ui/status/volume.js +++ b/js/ui/status/volume.js @@ -117,9 +117,9 @@ Indicator.prototype = { // only show input widgets if any application is recording audio let showInput = false; let recordingApps = this._control.get_source_outputs(); - if (this._source && recordingApps) { - for (let i = 0; i < recordingApp.length; i++) { - let outputStream = recordingApp[i]; + if (this._input && recordingApps) { + for (let i = 0; i < recordingApps.length; i++) { + let outputStream = recordingApps[i]; let id = outputStream.get_application_id(); // but skip gnome-volume-control and pavucontrol // (that appear as recording because they show the input level) From 10e59c08407ab417f43c88484332ef3c728c4418 Mon Sep 17 00:00:00 2001 From: Adel Gadllah Date: Wed, 20 Oct 2010 21:53:23 +0200 Subject: [PATCH 03/27] volumeIndicator: Add mousewheel support Allow changing the volume by moving the mousewheel over the volume indicato to restore the old gnome-volume-control-applet behaviour. https://bugzilla.gnome.org/show_bug.cgi?id=632733 --- js/ui/status/volume.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/js/ui/status/volume.js b/js/ui/status/volume.js index 8753c718b..15cc1f178 100644 --- a/js/ui/status/volume.js +++ b/js/ui/status/volume.js @@ -1,5 +1,6 @@ /* -*- mode: js2; js2-basic-offset: 4; indent-tabs-mode: nil -*- */ +const Clutter = imports.gi.Clutter; const DBus = imports.dbus; const Lang = imports.lang; const Mainloop = imports.mainloop; @@ -15,6 +16,7 @@ const Gettext = imports.gettext.domain('gnome-shell'); const _ = Gettext.gettext; const VOLUME_MAX = 65536.0; /* PA_VOLUME_NORM */ +const VOLUME_ADJUSTMENT_STEP = 0.05; /* Volume adjustment step in % */ function Indicator() { this._init.apply(this, arguments); @@ -64,9 +66,24 @@ Indicator.prototype = { p.run(); }); + this.actor.connect('scroll-event', Lang.bind(this, this._onScrollEvent)); this._control.open(); }, + _onScrollEvent: function(actor, event) { + let direction = event.get_scroll_direction(); + let currentVolume = this._output.volume; + + if (direction == Clutter.ScrollDirection.DOWN) { + this._output.volume = Math.max(0, currentVolume - VOLUME_MAX * VOLUME_ADJUSTMENT_STEP); + this._output.push_volume(); + } + else if (direction == Clutter.ScrollDirection.UP) { + this._output.volume = Math.min(VOLUME_MAX, currentVolume + VOLUME_MAX * VOLUME_ADJUSTMENT_STEP); + this._output.push_volume(); + } + }, + _onControlReady: function() { this._readOutput(); this._readInput(); From be7b9729a20cd48e7feeb00ccd4ff8a3ea489329 Mon Sep 17 00:00:00 2001 From: Yaron Shahrabani Date: Wed, 20 Oct 2010 23:50:59 +0200 Subject: [PATCH 04/27] Updated Hebrew translation. --- po/he.po | 100 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 72 insertions(+), 28 deletions(-) diff --git a/po/he.po b/po/he.po index cc500fd26..f034f9145 100644 --- a/po/he.po +++ b/po/he.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: gnome-shell master\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-10-06 02:19+0200\n" -"PO-Revision-Date: 2010-10-06 02:28+0200\n" +"POT-Creation-Date: 2010-10-20 23:49+0200\n" +"PO-Revision-Date: 2010-10-20 23:50+0200\n" "Last-Translator: Yaron Shahrabani \n" "Language-Team: Hebrew \n" "MIME-Version: 1.0\n" @@ -494,58 +494,58 @@ msgid "Undo" msgstr "ביטול" #. TODO - _quit() doesn't really work on apps in state STARTING yet -#: ../js/ui/panel.js:461 +#: ../js/ui/panel.js:469 #, c-format msgid "Quit %s" msgstr "יציאה מ־%s" -#: ../js/ui/panel.js:486 +#: ../js/ui/panel.js:494 msgid "Preferences" msgstr "העדפות" #. Translators: This is the time format with date used #. in 24-hour mode. -#: ../js/ui/panel.js:572 +#: ../js/ui/panel.js:580 msgid "%a %b %e, %R:%S" msgstr "%a %b %e, %R:%S" -#: ../js/ui/panel.js:573 +#: ../js/ui/panel.js:581 msgid "%a %b %e, %R" msgstr "%a %b %e, %R" #. Translators: This is the time format without date used #. in 24-hour mode. -#: ../js/ui/panel.js:577 +#: ../js/ui/panel.js:585 msgid "%a %R:%S" msgstr "%a %R:%S" -#: ../js/ui/panel.js:578 +#: ../js/ui/panel.js:586 msgid "%a %R" msgstr "%a %R" #. Translators: This is a time format with date used #. for AM/PM. -#: ../js/ui/panel.js:585 +#: ../js/ui/panel.js:593 msgid "%a %b %e, %l:%M:%S %p" msgstr "%a %b %e, %l:%M:%S %p" -#: ../js/ui/panel.js:586 +#: ../js/ui/panel.js:594 msgid "%a %b %e, %l:%M %p" msgstr "%a %b %e, %l:%M %p" #. Translators: This is a time format without date used #. for AM/PM. -#: ../js/ui/panel.js:590 +#: ../js/ui/panel.js:598 msgid "%a %l:%M:%S %p" msgstr "%a %l:%M:%S %p" -#: ../js/ui/panel.js:591 +#: ../js/ui/panel.js:599 msgid "%a %l:%M %p" msgstr "%a %l:%M %p" #. Button on the left side of the panel. #. Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview". -#: ../js/ui/panel.js:736 +#: ../js/ui/panel.js:744 msgid "Activities" msgstr "פעילויות" @@ -567,7 +567,7 @@ msgstr "התחברות אל..." #. "ON" and "OFF") or "toggle-switch-intl" (for toggle #. switches containing "◯" and "|"). Other values will #. simply result in invisible toggle switches. -#: ../js/ui/popupMenu.js:33 +#: ../js/ui/popupMenu.js:31 msgid "toggle-switch-us" msgstr "toggle-switch-intl" @@ -580,42 +580,86 @@ msgstr "נא להזין פקודה:" msgid "Execution of '%s' failed:" msgstr "ההרצה של '%s' נכשלה:" -#: ../js/ui/statusMenu.js:91 +#: ../js/ui/statusMenu.js:97 msgid "Available" msgstr "זמין" -#: ../js/ui/statusMenu.js:95 +#: ../js/ui/statusMenu.js:101 msgid "Busy" msgstr "עסוק" -#: ../js/ui/statusMenu.js:99 +#: ../js/ui/statusMenu.js:105 msgid "Invisible" msgstr "בלתי נראה" -#: ../js/ui/statusMenu.js:106 +#: ../js/ui/statusMenu.js:112 msgid "Account Information..." msgstr "פרטי המשתמש..." -#: ../js/ui/statusMenu.js:110 +#: ../js/ui/statusMenu.js:116 msgid "System Settings..." msgstr "הגדרות מערכת..." -#: ../js/ui/statusMenu.js:117 +#: ../js/ui/statusMenu.js:123 msgid "Lock Screen" msgstr "נעילת המסך" -#: ../js/ui/statusMenu.js:121 +#: ../js/ui/statusMenu.js:127 msgid "Switch User" msgstr "החלפת משתמש" -#: ../js/ui/statusMenu.js:126 +#: ../js/ui/statusMenu.js:132 msgid "Log Out..." msgstr "ניתוק..." -#: ../js/ui/statusMenu.js:130 +#: ../js/ui/statusMenu.js:136 msgid "Shut Down..." msgstr "כיבוי..." +#: ../js/ui/status/accessibility.js:88 +msgid "Screen Reader" +msgstr "מקריא מסך" + +#: ../js/ui/status/accessibility.js:91 +msgid "Screen Keyboard" +msgstr "מקלדת מסך" + +#: ../js/ui/status/accessibility.js:94 +msgid "Visual Alerts" +msgstr "התראות חזותיות" + +#: ../js/ui/status/accessibility.js:97 +msgid "Sticky Keys" +msgstr "מקשים דביקים" + +#: ../js/ui/status/accessibility.js:100 +msgid "Slow Keys" +msgstr "מקשים אטיים" + +#: ../js/ui/status/accessibility.js:103 +msgid "Bounce Keys" +msgstr "מקשים קופצים" + +#: ../js/ui/status/accessibility.js:106 +msgid "Mouse Keys" +msgstr "מקשי עכבר" + +#: ../js/ui/status/accessibility.js:110 +msgid "Universal Access Settings" +msgstr "הגדרות גישה אוניברסלית" + +#: ../js/ui/status/accessibility.js:163 +msgid "High Contrast" +msgstr "ניגודיות גבוהה" + +#: ../js/ui/status/accessibility.js:202 +msgid "Large Text" +msgstr "טקסט גדול" + +#: ../js/ui/status/accessibility.js:223 +msgid "Zoom" +msgstr "תקריב" + #: ../js/ui/windowAttentionHandler.js:43 #, c-format msgid "%s has finished starting" @@ -635,11 +679,11 @@ msgstr "לא ניתן להוסיף מרחבי עבודה כיוון שהם ממ msgid "Can't remove the first workspace." msgstr "לא ניתן להסיר את מרחב העבודה הראשון." -#: ../src/shell-global.c:1196 +#: ../src/shell-global.c:1204 msgid "Less than a minute ago" msgstr "לפני פחות מדקה" -#: ../src/shell-global.c:1200 +#: ../src/shell-global.c:1208 #, c-format msgid "%d minute ago" msgid_plural "%d minutes ago" @@ -647,7 +691,7 @@ msgstr[0] "לפני דקה" msgstr[1] "לפני %d דקות" msgstr[2] "לפני 2 דקות" -#: ../src/shell-global.c:1205 +#: ../src/shell-global.c:1213 #, c-format msgid "%d hour ago" msgid_plural "%d hours ago" @@ -655,7 +699,7 @@ msgstr[0] "לפני שעה" msgstr[1] "לפני %d שעות" msgstr[2] "לפני שעתיים" -#: ../src/shell-global.c:1210 +#: ../src/shell-global.c:1218 #, c-format msgid "%d day ago" msgid_plural "%d days ago" @@ -663,7 +707,7 @@ msgstr[0] "לפני יום" msgstr[1] "לפני %d ימים" msgstr[2] "לפני יומיים" -#: ../src/shell-global.c:1215 +#: ../src/shell-global.c:1223 #, c-format msgid "%d week ago" msgid_plural "%d weeks ago" From 33e955770c7194eb603c40b44d242225dcd2d302 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 19 Oct 2010 13:59:49 -0400 Subject: [PATCH 05/27] st_theme_node_get_color: fix inheritance This wasn't actually recursing if you passed the "inherit" flag https://bugzilla.gnome.org/show_bug.cgi?id=632590 --- src/st/st-theme-node.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/st/st-theme-node.c b/src/st/st-theme-node.c index b70912031..5561162e1 100644 --- a/src/st/st-theme-node.c +++ b/src/st/st-theme-node.c @@ -542,6 +542,9 @@ st_theme_node_get_color (StThemeNode *node, } } + if (inherit && node->parent_node) + return st_theme_node_get_color (node->parent_node, property_name, inherit, color); + return FALSE; } From 85d3336245e96e2071af1805a69065467e634389 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 21 Oct 2010 10:50:30 -0400 Subject: [PATCH 06/27] Use gjs-internals.pc Gjs changed to separate the "basic" API from "embedder" API. Unfortunately due to our use of the importer API and a few other bits, we need to use the "module" one. In the future I plan to extend the core API to support this use case. --- configure.ac | 2 +- src/shell-global.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index a9533aa4d..fe98add60 100644 --- a/configure.ac +++ b/configure.ac @@ -69,7 +69,7 @@ PKG_CHECK_MODULES(MUTTER_PLUGIN, gio-2.0 >= $GIO_MIN_VERSION gio-unix-2.0 dbus-glib-1 gtk+-3.0 >= $GTK_MIN_VERSION mutter-plugins >= $MUTTER_MIN_VERSION - gjs-gi-1.0 >= $GJS_MIN_VERSION + gjs-internals-1.0 >= $GJS_MIN_VERSION libgnome-menu $recorder_modules gconf-2.0 gdk-x11-3.0 clutter-x11-1.0 >= $CLUTTER_MIN_VERSION diff --git a/src/shell-global.c b/src/shell-global.c index 1e42fc9f0..accd411df 100644 --- a/src/shell-global.c +++ b/src/shell-global.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #ifdef HAVE_SYS_RESOURCE_H #include From 8886b7433c3f5454569a7c005ffc20c990d01277 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Sun, 26 Sep 2010 17:38:36 -0400 Subject: [PATCH 07/27] StThemeNode: simplify use of get_color/get_double/get_length Although within St itself there are situations where the semantics of these functions (return TRUE or FALSE and return the actual value in an out parameter) is useful, it's mostly just annoying at the application level, where you generally know that the CSS property is going to specified, and there is no especially sane fallback if it's not. So rename the current methods to lookup_color, lookup_double, and lookup_length, and add new get_color, get_double, and get_length methods that don't take an "inherit" parameter, and return their values directly. (Well, except for get_color, due to the lack of (out caller-allocates) in gjs.) And update the code to use either the old or new methods as appropriate. https://bugzilla.gnome.org/show_bug.cgi?id=632590 --- js/ui/altTab.js | 11 +-- js/ui/boxpointer.js | 31 +++----- js/ui/iconGrid.js | 18 ++--- js/ui/messageTray.js | 3 +- js/ui/popupMenu.js | 25 +++--- js/ui/workspace.js | 12 +-- js/ui/workspaceSwitcherPopup.js | 3 +- js/ui/workspacesView.js | 5 +- src/st/st-box-layout.c | 4 +- src/st/st-button.c | 2 +- src/st/st-entry.c | 6 +- src/st/st-overflow-box.c | 4 +- src/st/st-scroll-bar.c | 4 +- src/st/st-table.c | 6 +- src/st/st-theme-node.c | 136 +++++++++++++++++++++++++++----- src/st/st-theme-node.h | 33 +++++--- 16 files changed, 185 insertions(+), 118 deletions(-) diff --git a/js/ui/altTab.js b/js/ui/altTab.js index a72396a02..b3f074d07 100644 --- a/js/ui/altTab.js +++ b/js/ui/altTab.js @@ -102,9 +102,7 @@ AltTabPopup.prototype = { childBox.x1 = Math.max(primary.x + leftPadding, childBox.x1 - offset - hPadding); } - let [found, spacing] = this.actor.get_theme_node().get_length('spacing', false); - if (!found) - spacing = 0; + let spacing = this.actor.get_theme_node().get_length('spacing'); childBox.x2 = childBox.x1 + childNaturalWidth; if (childBox.x2 > primary.x + primary.width - rightPadding) @@ -501,8 +499,7 @@ SwitcherList.prototype = { this._list = new Shell.GenericContainer({ style_class: 'switcher-list-item-container' }); this._list.spacing = 0; this._list.connect('style-changed', Lang.bind(this, function() { - let [found, spacing] = this._list.get_theme_node().get_length('spacing', false); - this._list.spacing = (found) ? spacing : 0; + this._list.spacing = this._list.get_theme_node().get_length('spacing'); })); this._list.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth)); @@ -1035,9 +1032,7 @@ ThumbnailList.prototype = { let totalPadding = this._items[0].get_theme_node().get_horizontal_padding() + this._items[0].get_theme_node().get_vertical_padding(); totalPadding += this.actor.get_theme_node().get_horizontal_padding() + this.actor.get_theme_node().get_vertical_padding(); let [labelMinHeight, labelNaturalHeight] = this._labels[0].get_preferred_height(-1); - let [found, spacing] = this._items[0].child.get_theme_node().get_length('spacing', false); - if (!found) - spacing = 0; + let spacing = this._items[0].child.get_theme_node().get_length('spacing'); availHeight = Math.min(availHeight - labelNaturalHeight - totalPadding - spacing, THUMBNAIL_DEFAULT_SIZE); let binHeight = availHeight + this._items[0].get_theme_node().get_vertical_padding() + this.actor.get_theme_node().get_vertical_padding() - spacing; diff --git a/js/ui/boxpointer.js b/js/ui/boxpointer.js index 916005a9f..ff8775946 100644 --- a/js/ui/boxpointer.js +++ b/js/ui/boxpointer.js @@ -46,9 +46,7 @@ BoxPointer.prototype = { let x = this.actor.x; let y = this.actor.y; let themeNode = this.actor.get_theme_node(); - let [found, rise] = themeNode.get_length('-arrow-rise', false); - if (!found) - rise = 0; + let rise = themeNode.get_length('-arrow-rise'); this.actor.opacity = 0; this.actor.show(); @@ -82,9 +80,7 @@ BoxPointer.prototype = { let originalX = this.actor.x; let originalY = this.actor.y; let themeNode = this.actor.get_theme_node(); - let [found, rise] = themeNode.get_length('-arrow-rise', false); - if (!found) - rise = 0; + let rise = themeNode.get_length('-arrow-rise'); switch (this._arrowSide) { case St.Side.TOP: @@ -118,13 +114,12 @@ BoxPointer.prototype = { _adjustAllocationForArrow: function(isWidth, alloc) { let themeNode = this.actor.get_theme_node(); - let found, borderWidth, base, rise; - [found, borderWidth] = themeNode.get_length('-arrow-border-width', false); + let borderWidth = themeNode.get_length('-arrow-border-width'); alloc.min_size += borderWidth * 2; alloc.natural_size += borderWidth * 2; if ((!isWidth && (this._arrowSide == St.Side.TOP || this._arrowSide == St.Side.BOTTOM)) || (isWidth && (this._arrowSide == St.Side.LEFT || this._arrowSide == St.Side.RIGHT))) { - let [found, rise] = themeNode.get_length('-arrow-rise', false); + let rise = themeNode.get_length('-arrow-rise'); alloc.min_size += rise; alloc.natural_size += rise; } @@ -146,9 +141,8 @@ BoxPointer.prototype = { _allocate: function(actor, box, flags) { let themeNode = this.actor.get_theme_node(); - let found, borderWidth, borderRadius, rise, base; - [found, borderWidth] = themeNode.get_length('-arrow-border-width', false); - [found, rise] = themeNode.get_length('-arrow-rise', false); + let borderWidth = themeNode.get_length('-arrow-border-width'); + let rise = themeNode.get_length('-arrow-rise'); let childBox = new Clutter.ActorBox(); let availWidth = box.x2 - box.x1; let availHeight = box.y2 - box.y1; @@ -183,19 +177,18 @@ BoxPointer.prototype = { _drawBorder: function(area) { let themeNode = this.actor.get_theme_node(); - let found, borderWidth, borderRadius, rise, base; - [found, borderWidth] = themeNode.get_length('-arrow-border-width', false); - [found, base] = themeNode.get_length('-arrow-base', false); - [found, rise] = themeNode.get_length('-arrow-rise', false); - [found, borderRadius] = themeNode.get_length('-arrow-border-radius', false); + let borderWidth = themeNode.get_length('-arrow-border-width'); + let base = themeNode.get_length('-arrow-base'); + let rise = themeNode.get_length('-arrow-rise'); + let borderRadius = themeNode.get_length('-arrow-border-radius'); let halfBorder = borderWidth / 2; let halfBase = Math.floor(base/2); let borderColor = new Clutter.Color(); - themeNode.get_color('-arrow-border-color', false, borderColor); + themeNode.get_color('-arrow-border-color', borderColor); let backgroundColor = new Clutter.Color(); - themeNode.get_color('-arrow-background-color', false, backgroundColor); + themeNode.get_color('-arrow-background-color', backgroundColor); let [width, height] = area.get_surface_size(); let [boxWidth, boxHeight] = [width, height]; diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js index 3625316e8..ff6a60b97 100644 --- a/js/ui/iconGrid.js +++ b/js/ui/iconGrid.js @@ -113,18 +113,14 @@ BaseIcon.prototype = { }, _onStyleChanged: function() { - let success, len; let node = this.actor.get_theme_node(); - - [success, len] = node.get_length('spacing', false); - if (success) - this._spacing = spacing; + this._spacing = node.get_length('spacing'); if (this._setSizeManually) return; - [success, len] = node.get_length('icon-size', false); - if (success) + let len = node.get_length('icon-size'); + if (len > 0) this._setIconSize(len); } }; @@ -269,12 +265,8 @@ IconGrid.prototype = { _onStyleChanged: function() { let themeNode = this.actor.get_theme_node(); - let [success, len] = themeNode.get_length('spacing', false); - if (success) - this._spacing = len; - [success, len] = themeNode.get_length('-shell-grid-item-size', false); - if (success) - this._item_size = len; + this._spacing = themeNode.get_length('spacing'); + this._item_size = themeNode.get_length('-shell-grid-item-size'); this._grid.queue_relayout(); }, diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 95183c6a1..e0561cb4c 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -360,8 +360,7 @@ Notification.prototype = { }, _styleChanged: function() { - let [hasSpacing, spacing] = this.actor.get_theme_node().get_length('spacing-columns', false); - this._spacing = hasSpacing ? spacing : 0; + this._spacing = this.actor.get_theme_node().get_length('spacing-columns'); }, _bannerBoxGetPreferredWidth: function(actor, forHeight, alloc) { diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index 8694a601c..6446c3237 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -143,13 +143,12 @@ PopupSeparatorMenuItem.prototype = { let cr = area.get_context(); let themeNode = area.get_theme_node(); let [width, height] = area.get_surface_size(); - let found, margin, gradientHeight; - [found, margin] = themeNode.get_length('-margin-horizontal', false); - [found, gradientHeight] = themeNode.get_length('-gradient-height', false); + let margin = themeNode.get_length('-margin-horizontal'); + let gradientHeight = themeNode.get_length('-gradient-height'); let startColor = new Clutter.Color(); - themeNode.get_color('-gradient-start', false, startColor); + themeNode.get_color('-gradient-start', startColor); let endColor = new Clutter.Color(); - themeNode.get_color('-gradient-end', false, endColor); + themeNode.get_color('-gradient-end', endColor); let gradientWidth = (width - margin * 2); let gradientOffset = (height - gradientHeight) / 2; @@ -200,20 +199,17 @@ PopupSliderMenuItem.prototype = { let themeNode = area.get_theme_node(); let [width, height] = area.get_surface_size(); - let found, handleRadius; - [found, handleRadius] = themeNode.get_length('-slider-handle-radius', false); + let handleRadius = themeNode.get_length('-slider-handle-radius'); let sliderWidth = width - 2 * handleRadius; - let sliderHeight; - [found, sliderHeight] = themeNode.get_length('-slider-height', false); + let sliderHeight = themeNode.get_length('-slider-height'); - let sliderBorderWidth; - [found, sliderBorderWidth] = themeNode.get_length('-slider-border-width', false); + let sliderBorderWidth = themeNode.get_length('-slider-border-width'); let sliderBorderColor = new Clutter.Color(); - themeNode.get_color('-slider-border-color', false, sliderBorderColor); + themeNode.get_color('-slider-border-color', sliderBorderColor); let sliderColor = new Clutter.Color(); - themeNode.get_color('-slider-background-color', false, sliderColor); + themeNode.get_color('-slider-background-color', sliderColor); cr.setSourceRGBA ( sliderColor.red / 255, @@ -288,8 +284,7 @@ PopupSliderMenuItem.prototype = { relY = absY - sliderY; let width = this._slider.width; - let found, handleRadius; - [found, handleRadius] = this._slider.get_theme_node().get_length('-slider-handle-radius', false); + let handleRadius = this._slider.get_theme_node().get_length('-slider-handle-radius'); let newvalue; if (relX < handleRadius) diff --git a/js/ui/workspace.js b/js/ui/workspace.js index b249ee165..20aec12a9 100644 --- a/js/ui/workspace.js +++ b/js/ui/workspace.js @@ -553,18 +553,10 @@ WindowOverlay.prototype = { _onStyleChanged: function() { let titleNode = this.title.get_theme_node(); - - let [success, len] = titleNode.get_length('-shell-caption-spacing', - false); - if (success) - this.title._spacing = len; + this.title._spacing = titleNode.get_length('-shell-caption-spacing'); let closeNode = this.closeButton.get_theme_node(); - - [success, len] = closeNode.get_length('-shell-close-overlap', - false); - if (success) - this.closeButton._overlap = len; + this.closeButton._overlap = closeNode.get_length('-shell-close-overlap'); this._parentActor.queue_relayout(); } diff --git a/js/ui/workspaceSwitcherPopup.js b/js/ui/workspaceSwitcherPopup.js index ac3954445..b474377c8 100644 --- a/js/ui/workspaceSwitcherPopup.js +++ b/js/ui/workspaceSwitcherPopup.js @@ -33,8 +33,7 @@ WorkspaceSwitcherPopup.prototype = { this._list = new Shell.GenericContainer({ style_class: 'workspace-switcher' }); this._itemSpacing = 0; this._list.connect('style-changed', Lang.bind(this, function() { - let [found, spacing] = this._list.get_theme_node().get_length('spacing', false); - this._itemSpacing = (found) ? spacing : 0; + this._itemSpacing = this._list.get_theme_node().get_length('spacing'); })); this._list.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth)); diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index d7deab0c1..e35eaba67 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -43,8 +43,7 @@ GenericWorkspacesView.prototype = { this.actor.connect('style-changed', Lang.bind(this, function() { let node = this.actor.get_theme_node(); - let [a, spacing] = node.get_length('spacing', false); - this._spacing = spacing; + this._spacing = node.get_length('spacing'); if (Main.overview.animationInProgress) this._computeWorkspacePositions(); else @@ -609,7 +608,7 @@ WorkspaceIndicator.prototype = { this._indicatorsPanel.add_actor(actor); - let [a, spacing] = actor.get_theme_node().get_length('border-spacing', false); + let spacing = actor.get_theme_node().get_length('border-spacing'); actor.x = spacing * i + actor.width * i; }, diff --git a/src/st/st-box-layout.c b/src/st/st-box-layout.c index 16c5b387d..98fe29100 100644 --- a/src/st/st-box-layout.c +++ b/src/st/st-box-layout.c @@ -1018,9 +1018,9 @@ st_box_layout_style_changed (StWidget *self) StBoxLayoutPrivate *priv = ST_BOX_LAYOUT (self)->priv; StThemeNode *theme_node = st_widget_get_theme_node (self); int old_spacing = priv->spacing; - double spacing = 0; + double spacing; - st_theme_node_get_length (theme_node, "spacing", FALSE, &spacing); + spacing = st_theme_node_get_length (theme_node, "spacing"); priv->spacing = (int)(spacing + 0.5); if (priv->spacing != old_spacing) clutter_actor_queue_relayout (CLUTTER_ACTOR (self)); diff --git a/src/st/st-button.c b/src/st/st-button.c index 09190f445..81d4e88a6 100644 --- a/src/st/st-button.c +++ b/src/st/st-button.c @@ -109,7 +109,7 @@ st_button_style_changed (StWidget *widget) ST_WIDGET_CLASS (st_button_parent_class)->style_changed (widget); spacing = 6; - st_theme_node_get_length (theme_node, "border-spacing", FALSE, &spacing); + st_theme_node_lookup_length (theme_node, "border-spacing", FALSE, &spacing); priv->spacing = (int)(0.5 + spacing); /* update the label styling */ diff --git a/src/st/st-entry.c b/src/st/st-entry.c index 7c4170cc9..ecb8ba783 100644 --- a/src/st/st-entry.c +++ b/src/st/st-entry.c @@ -202,13 +202,13 @@ st_entry_style_changed (StWidget *self) st_theme_node_get_foreground_color (theme_node, &color); clutter_text_set_color (CLUTTER_TEXT (priv->entry), &color); - if (st_theme_node_get_length (theme_node, "caret-size", FALSE, &size)) + if (st_theme_node_lookup_length (theme_node, "caret-size", FALSE, &size)) clutter_text_set_cursor_size (CLUTTER_TEXT (priv->entry), (int)(.5 + size)); - if (st_theme_node_get_color (theme_node, "caret-color", FALSE, &color)) + if (st_theme_node_lookup_color (theme_node, "caret-color", FALSE, &color)) clutter_text_set_cursor_color (CLUTTER_TEXT (priv->entry), &color); - if (st_theme_node_get_color (theme_node, "selection-background-color", FALSE, &color)) + if (st_theme_node_lookup_color (theme_node, "selection-background-color", FALSE, &color)) clutter_text_set_selection_color (CLUTTER_TEXT (priv->entry), &color); font = st_theme_node_get_font (theme_node); diff --git a/src/st/st-overflow-box.c b/src/st/st-overflow-box.c index 686b7473a..6d40049c3 100644 --- a/src/st/st-overflow-box.c +++ b/src/st/st-overflow-box.c @@ -369,9 +369,9 @@ st_overflow_box_style_changed (StWidget *self) StOverflowBoxPrivate *priv = ST_OVERFLOW_BOX (self)->priv; StThemeNode *theme_node = st_widget_get_theme_node (self); int old_spacing = priv->spacing; - double spacing = 0; + double spacing; - st_theme_node_get_length (theme_node, "spacing", FALSE, &spacing); + spacing = st_theme_node_get_length (theme_node, "spacing"); priv->spacing = (int)(spacing + 0.5); if (priv->spacing != old_spacing) clutter_actor_queue_relayout (CLUTTER_ACTOR (self)); diff --git a/src/st/st-scroll-bar.c b/src/st/st-scroll-bar.c index 84ad7e6d8..f6b798ee8 100644 --- a/src/st/st-scroll-bar.c +++ b/src/st/st-scroll-bar.c @@ -410,9 +410,9 @@ scroll_bar_allocate_children (StScrollBar *bar, increment = page_size / (upper - lower); min_size = 32.; - st_theme_node_get_length (theme_node, "min-size", FALSE, &min_size); + st_theme_node_lookup_length (theme_node, "min-size", FALSE, &min_size); max_size = G_MAXINT16; - st_theme_node_get_length (theme_node, "max-size", FALSE, &max_size); + st_theme_node_lookup_length (theme_node, "max-size", FALSE, &max_size); if (upper - lower - page_size <= 0) position = 0; diff --git a/src/st/st-table.c b/src/st/st-table.c index 2d832ab5b..f92c810cb 100644 --- a/src/st/st-table.c +++ b/src/st/st-table.c @@ -988,11 +988,11 @@ st_table_style_changed (StWidget *self) StThemeNode *theme_node = st_widget_get_theme_node (self); int old_row_spacing = priv->row_spacing; int old_col_spacing = priv->col_spacing; - double row_spacing = 0., col_spacing = 0.; + double row_spacing, col_spacing; - st_theme_node_get_length (theme_node, "spacing-rows", FALSE, &row_spacing); + row_spacing = st_theme_node_get_length (theme_node, "spacing-rows"); priv->row_spacing = (int)(row_spacing + 0.5); - st_theme_node_get_length (theme_node, "spacing-columns", FALSE, &col_spacing); + col_spacing = st_theme_node_get_length (theme_node, "spacing-columns"); priv->col_spacing = (int)(col_spacing + 0.5); if (priv->row_spacing != old_row_spacing || diff --git a/src/st/st-theme-node.c b/src/st/st-theme-node.c index 5561162e1..1a23399be 100644 --- a/src/st/st-theme-node.c +++ b/src/st/st-theme-node.c @@ -490,7 +490,7 @@ get_color_from_term (StThemeNode *node, } /** - * st_theme_node_get_color: + * st_theme_node_lookup_color: * @node: a #StThemeNode * @property_name: The name of the color property * @inherit: if %TRUE, if a value is not found for the property on the @@ -507,14 +507,16 @@ get_color_from_term (StThemeNode *node, * should be used instead. They are cached, so more efficient, and have * handling for shortcut properties and other details of CSS. * + * See also st_theme_node_get_color(), which provides a simpler API. + * * Return value: %TRUE if the property was found in the properties for this * theme node (or in the properties of parent nodes when inheriting.) */ gboolean -st_theme_node_get_color (StThemeNode *node, - const char *property_name, - gboolean inherit, - ClutterColor *color) +st_theme_node_lookup_color (StThemeNode *node, + const char *property_name, + gboolean inherit, + ClutterColor *color) { int i; @@ -535,7 +537,7 @@ st_theme_node_get_color (StThemeNode *node, else if (result == VALUE_INHERIT) { if (node->parent_node) - return st_theme_node_get_color (node->parent_node, property_name, inherit, color); + return st_theme_node_lookup_color (node->parent_node, property_name, inherit, color); else break; } @@ -543,13 +545,43 @@ st_theme_node_get_color (StThemeNode *node, } if (inherit && node->parent_node) - return st_theme_node_get_color (node->parent_node, property_name, inherit, color); + return st_theme_node_lookup_color (node->parent_node, property_name, inherit, color); return FALSE; } /** - * st_theme_node_get_double: + * st_theme_node_get_color: + * @node: a #StThemeNode + * @property_name: The name of the color property + * @color: location to store the color that was determined. + * + * Generically looks up a property containing a single color value. When + * specific getters (like st_theme_node_get_background_color()) exist, they + * should be used instead. They are cached, so more efficient, and have + * handling for shortcut properties and other details of CSS. + * + * If @property_name is not found, a warning will be logged and a + * default color returned. + * + * See also st_theme_node_lookup_color(), which provides more options, + * and lets you handle the case where the theme does not specify the + * indicated color. + */ +void +st_theme_node_get_color (StThemeNode *node, + const char *property_name, + ClutterColor *color) +{ + if (!st_theme_node_lookup_color (node, property_name, FALSE, color)) + { + g_warning ("Did not find color property '%s'", property_name); + memset (color, 0, sizeof (ClutterColor)); + } +} + +/** + * st_theme_node_lookup_double: * @node: a #StThemeNode * @property_name: The name of the numeric property * @inherit: if %TRUE, if a value is not found for the property on the @@ -564,14 +596,16 @@ st_theme_node_get_color (StThemeNode *node, * Generically looks up a property containing a single numeric value * without units. * + * See also st_theme_node_get_double(), which provides a simpler API. + * * Return value: %TRUE if the property was found in the properties for this * theme node (or in the properties of parent nodes when inheriting.) */ gboolean -st_theme_node_get_double (StThemeNode *node, - const char *property_name, - gboolean inherit, - double *value) +st_theme_node_lookup_double (StThemeNode *node, + const char *property_name, + gboolean inherit, + double *value) { gboolean result = FALSE; int i; @@ -596,11 +630,41 @@ st_theme_node_get_double (StThemeNode *node, } if (!result && inherit && node->parent_node) - result = st_theme_node_get_double (node->parent_node, property_name, inherit, value); + result = st_theme_node_lookup_double (node->parent_node, property_name, inherit, value); return result; } +/** + * st_theme_node_get_double: + * @node: a #StThemeNode + * @property_name: The name of the numeric property + * + * Generically looks up a property containing a single numeric value + * without units. + * + * See also st_theme_node_lookup_double(), which provides more options, + * and lets you handle the case where the theme does not specify the + * indicated value. + * + * Return value: the value found. If @property_name is not + * found, a warning will be logged and 0 will be returned. + */ +gdouble +st_theme_node_get_double (StThemeNode *node, + const char *property_name) +{ + gdouble value; + + if (st_theme_node_lookup_double (node, property_name, FALSE, &value)) + return value; + else + { + g_warning ("Did not find double property '%s'", property_name); + return 0.0; + } +} + static const PangoFontDescription * get_parent_font (StThemeNode *node) { @@ -802,7 +866,7 @@ get_length_internal (StThemeNode *node, } /** - * st_theme_node_get_length: + * st_theme_node_lookup_length: * @node: a #StThemeNode * @property_name: The name of the length property * @inherit: if %TRUE, if a value is not found for the property on the @@ -820,14 +884,16 @@ get_length_internal (StThemeNode *node, * should be used instead. They are cached, so more efficient, and have * handling for shortcut properties and other details of CSS. * + * See also st_theme_node_get_length(), which provides a simpler API. + * * Return value: %TRUE if the property was found in the properties for this * theme node (or in the properties of parent nodes when inheriting.) */ gboolean -st_theme_node_get_length (StThemeNode *node, - const char *property_name, - gboolean inherit, - gdouble *length) +st_theme_node_lookup_length (StThemeNode *node, + const char *property_name, + gboolean inherit, + gdouble *length) { GetFromTermResult result = get_length_internal (node, property_name, NULL, length); if (result == VALUE_FOUND) @@ -836,12 +902,42 @@ st_theme_node_get_length (StThemeNode *node, inherit = TRUE; if (inherit && node->parent_node && - st_theme_node_get_length (node->parent_node, property_name, inherit, length)) + st_theme_node_lookup_length (node->parent_node, property_name, inherit, length)) return TRUE; else return FALSE; } +/** + * st_theme_node_get_length: + * @node: a #StThemeNode + * @property_name: The name of the length property + * + * Generically looks up a property containing a single length value. When + * specific getters (like st_theme_node_get_border_width()) exist, they + * should be used instead. They are cached, so more efficient, and have + * handling for shortcut properties and other details of CSS. + * + * Unlike st_theme_node_get_color() and st_theme_node_get_double(), + * this does not print a warning if the property is not found; it just + * returns 0. + * + * See also st_theme_node_lookup_length(), which provides more options. + * + * Return value: the length, in pixels, or 0 if the property was not found. + */ +gdouble +st_theme_node_get_length (StThemeNode *node, + const char *property_name) +{ + gdouble length; + + if (st_theme_node_lookup_length (node, property_name, FALSE, &length)) + return length; + else + return 0.0; +} + static void do_border_radius_term (StThemeNode *node, CRTerm *term, @@ -1730,7 +1826,7 @@ st_theme_node_get_transition_duration (StThemeNode *node) if (node->transition_duration > -1) return st_slow_down_factor * node->transition_duration; - st_theme_node_get_double (node, "transition-duration", FALSE, &value); + st_theme_node_lookup_double (node, "transition-duration", FALSE, &value); node->transition_duration = (int)value; diff --git a/src/st/st-theme-node.h b/src/st/st-theme-node.h index 0b0a4fd5b..ec567c305 100644 --- a/src/st/st-theme-node.h +++ b/src/st/st-theme-node.h @@ -99,20 +99,27 @@ const char *st_theme_node_get_pseudo_class (StThemeNode *node); * details of the actual CSS rules, which can be complicated, especially * for fonts */ -gboolean st_theme_node_get_color (StThemeNode *node, - const char *property_name, - gboolean inherit, - ClutterColor *color); +gboolean st_theme_node_lookup_color (StThemeNode *node, + const char *property_name, + gboolean inherit, + ClutterColor *color); +gboolean st_theme_node_lookup_double (StThemeNode *node, + const char *property_name, + gboolean inherit, + double *value); +gboolean st_theme_node_lookup_length (StThemeNode *node, + const char *property_name, + gboolean inherit, + gdouble *length); -gboolean st_theme_node_get_double (StThemeNode *node, - const char *property_name, - gboolean inherit, - double *value); - -gboolean st_theme_node_get_length (StThemeNode *node, - const char *property_name, - gboolean inherit, - gdouble *length); +/* Easier-to-use variants of the above, for application-level use */ +void st_theme_node_get_color (StThemeNode *node, + const char *property_name, + ClutterColor *color); +gdouble st_theme_node_get_double (StThemeNode *node, + const char *property_name); +gdouble st_theme_node_get_length (StThemeNode *node, + const char *property_name); /* Specific getters for particular properties: cached */ From 3dbee0b833bd9c8de8d1c02ff842684d769457c1 Mon Sep 17 00:00:00 2001 From: Adel Gadllah Date: Wed, 20 Oct 2010 22:41:54 +0200 Subject: [PATCH 08/27] PopupSliderMenuItem: Implement mousewheel support Allow changing the slider's value using the mousewheel. https://bugzilla.gnome.org/show_bug.cgi?id=632743 --- js/ui/popupMenu.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index 6446c3237..cb17c021a 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -16,6 +16,8 @@ const Tweener = imports.ui.tweener; const Gettext = imports.gettext.domain('gnome-shell'); const _ = Gettext.gettext; +const SLIDER_SCROLL_STEP = 0.05; /* Slider scrolling step in % */ + function Switch() { this._init.apply(this, arguments); } @@ -181,6 +183,7 @@ PopupSliderMenuItem.prototype = { this.actor.set_child(this._slider); this._slider.connect('repaint', Lang.bind(this, this._sliderRepaint)); this._slider.connect('button-press-event', Lang.bind(this, this._startDragging)); + this._slider.connect('scroll-event', Lang.bind(this, this._onScrollEvent)); this._releaseId = this._motionId = 0; this._dragging = false; @@ -270,6 +273,20 @@ PopupSliderMenuItem.prototype = { return true; }, + _onScrollEvent: function (actor, event) { + let direction = event.get_scroll_direction(); + + if (direction == Clutter.ScrollDirection.DOWN) { + this._value = Math.max(0, this._value - SLIDER_SCROLL_STEP); + } + else if (direction == Clutter.ScrollDirection.UP) { + this._value = Math.min(1, this._value + SLIDER_SCROLL_STEP); + } + + this._slider.queue_repaint(); + this.emit('value-changed', this._value); + }, + _motionEvent: function(actor, event) { let absX, absY; [absX, absY] = event.get_coords(); From 6b47b78d4d220bd7fa44ab4a8fd1ab5671d9d7f1 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Fri, 22 Oct 2010 15:31:58 +0200 Subject: [PATCH 09/27] Fix audio volume icon _volumeChanged should not update the icon if the sink is muted. Fixes the case when shell is started with a muted sink (_mutedChanged is called before _volumeChanged). https://bugzilla.gnome.org/show_bug.cgi?id=632868 --- js/ui/status/volume.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/ui/status/volume.js b/js/ui/status/volume.js index 15cc1f178..be8abd635 100644 --- a/js/ui/status/volume.js +++ b/js/ui/status/volume.js @@ -102,7 +102,6 @@ Indicator.prototype = { this._outputVolumeId = this._output.connect('notify::volume', Lang.bind(this, this._volumeChanged, '_output')); this._mutedChanged (null, null, '_output'); this._volumeChanged (null, null, '_output'); - this.setIcon(this._volumeToIcon(this._output.volume)); } else { this._outputSwitch.label.text = _("Output: Muted"); this._outputSwitch.setToggleState(false); @@ -208,7 +207,7 @@ Indicator.prototype = { _volumeChanged: function(object, param_spec, property) { this[property+'Slider'].setValue(this[property].volume / VOLUME_MAX); this._updateLabel(property); - if (property == '_output') + if (property == '_output' && !this._output.is_muted) this.setIcon(this._volumeToIcon(this._output.volume)); }, From 2fa6f7ba7e9c6084b5d2fdaa7c1f1a8911e0ddfb Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Tue, 19 Oct 2010 14:55:43 -0400 Subject: [PATCH 10/27] Adapt to removal of Mutter namespace MutterWindow and MutterPlugin have been renamed to MetaWindowActor and MetaPlugin, mutter_plugin_list_windows() to meta_plugin_list_window_actors(). Adapt to those changes. https://bugzilla.gnome.org/show_bug.cgi?id=632500 --- js/ui/chrome.js | 2 +- js/ui/lookingGlass.js | 2 +- js/ui/main.js | 4 +- js/ui/windowManager.js | 2 +- js/ui/workspace.js | 2 +- js/ui/workspacesView.js | 2 +- src/gnome-shell-plugin.c | 135 +++++++++++++++++++------------------ src/shell-global-private.h | 2 +- src/shell-global.c | 58 ++++++++-------- src/shell-global.h | 4 +- src/shell-wm-private.h | 50 +++++++------- src/shell-wm.c | 102 ++++++++++++++-------------- src/shell-wm.h | 26 +++---- 13 files changed, 196 insertions(+), 195 deletions(-) diff --git a/js/ui/chrome.js b/js/ui/chrome.js index 524ae9e28..c90390fd4 100644 --- a/js/ui/chrome.js +++ b/js/ui/chrome.js @@ -233,7 +233,7 @@ Chrome.prototype = { }, _windowsRestacked: function() { - let windows = global.get_windows(); + let windows = global.get_window_actors(); let primary = global.get_primary_monitor(); // The chrome layer should be visible unless there is a window diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js index 173429987..e6bc65b33 100644 --- a/js/ui/lookingGlass.js +++ b/js/ui/lookingGlass.js @@ -220,7 +220,7 @@ WindowList.prototype = { _updateWindowList: function() { this.actor.get_children().forEach(function (actor) { actor.destroy(); }); - let windows = global.get_windows(); + let windows = global.get_window_actors(); let tracker = Shell.WindowTracker.get_default(); for (let i = 0; i < windows.length; i++) { let metaWindow = windows[i].metaWindow; diff --git a/js/ui/main.js b/js/ui/main.js index a0287c38e..cc017e32d 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -253,11 +253,11 @@ function _relayout() { // metacity-clutter currently uses the same prefs as plain metacity, // which probably means we'll be starting out with multiple workspaces; // remove any unused ones. (We do this from an idle handler, because -// global.get_windows() still returns NULL at the point when start() +// global.get_window_actors() still returns NULL at the point when start() // is called.) function _removeUnusedWorkspaces() { - let windows = global.get_windows(); + let windows = global.get_window_actors(); let maxWorkspace = 0; for (let i = 0; i < windows.length; i++) { let win = windows[i]; diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index bb8f9aaad..0418912db 100644 --- a/js/ui/windowManager.js +++ b/js/ui/windowManager.js @@ -415,7 +415,7 @@ WindowManager.prototype = { return; } - let windows = global.get_windows(); + let windows = global.get_window_actors(); /* @direction is the direction that the "camera" moves, so the * screen contents have to move one screen's worth in the diff --git a/js/ui/workspace.js b/js/ui/workspace.js index 20aec12a9..c4a225c1c 100644 --- a/js/ui/workspace.js +++ b/js/ui/workspace.js @@ -602,7 +602,7 @@ Workspace.prototype = { this.actor.height = global.screen_height; this.scale = 1.0; - let windows = global.get_windows().filter(this._isMyWindow, this); + let windows = global.get_window_actors().filter(this._isMyWindow, this); // Find the desktop window for (let i = 0; i < windows.length; i++) { diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index e35eaba67..91a15c9ca 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -190,7 +190,7 @@ GenericWorkspacesView.prototype = { }, _onRestacked: function() { - let stack = global.get_windows(); + let stack = global.get_window_actors(); let stackIndices = {}; for (let i = 0; i < stack.length; i++) { diff --git a/src/gnome-shell-plugin.c b/src/gnome-shell-plugin.c index f2f6137da..f67277840 100644 --- a/src/gnome-shell-plugin.c +++ b/src/gnome-shell-plugin.c @@ -25,8 +25,7 @@ #include "config.h" -#define MUTTER_BUILDING_PLUGIN 1 -#include +#include #include @@ -57,38 +56,40 @@ static void gnome_shell_plugin_dispose (GObject *object); static void gnome_shell_plugin_finalize (GObject *object); -static void gnome_shell_plugin_start (MutterPlugin *plugin); -static void gnome_shell_plugin_minimize (MutterPlugin *plugin, - MutterWindow *actor); -static void gnome_shell_plugin_maximize (MutterPlugin *plugin, - MutterWindow *actor, - gint x, - gint y, - gint width, - gint height); -static void gnome_shell_plugin_unmaximize (MutterPlugin *plugin, - MutterWindow *actor, - gint x, - gint y, - gint width, - gint height); -static void gnome_shell_plugin_map (MutterPlugin *plugin, - MutterWindow *actor); -static void gnome_shell_plugin_destroy (MutterPlugin *plugin, - MutterWindow *actor); +static void gnome_shell_plugin_start (MetaPlugin *plugin); +static void gnome_shell_plugin_minimize (MetaPlugin *plugin, + MetaWindowActor *actor); +static void gnome_shell_plugin_maximize (MetaPlugin *plugin, + MetaWindowActor *actor, + gint x, + gint y, + gint width, + gint height); +static void gnome_shell_plugin_unmaximize (MetaPlugin *plugin, + MetaWindowActor *actor, + gint x, + gint y, + gint width, + gint height); +static void gnome_shell_plugin_map (MetaPlugin *plugin, + MetaWindowActor *actor); +static void gnome_shell_plugin_destroy (MetaPlugin *plugin, + MetaWindowActor *actor); -static void gnome_shell_plugin_switch_workspace (MutterPlugin *plugin, - gint from, - gint to, - MetaMotionDirection direction); +static void gnome_shell_plugin_switch_workspace (MetaPlugin *plugin, + gint from, + gint to, + MetaMotionDirection direction); -static void gnome_shell_plugin_kill_window_effects (MutterPlugin *plugin, - MutterWindow *actor); -static void gnome_shell_plugin_kill_switch_workspace (MutterPlugin *plugin); +static void gnome_shell_plugin_kill_window_effects (MetaPlugin *plugin, + MetaWindowActor *actor); +static void gnome_shell_plugin_kill_switch_workspace (MetaPlugin *plugin); + + +static gboolean gnome_shell_plugin_xevent_filter (MetaPlugin *plugin, + XEvent *event); +static const MetaPluginInfo *gnome_shell_plugin_plugin_info (MetaPlugin *plugin); -static gboolean gnome_shell_plugin_xevent_filter (MutterPlugin *plugin, - XEvent *event); -static const MutterPluginInfo *gnome_shell_plugin_plugin_info (MutterPlugin *plugin); #define GNOME_TYPE_SHELL_PLUGIN (gnome_shell_plugin_get_type ()) #define GNOME_SHELL_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_TYPE_SHELL_PLUGIN, GnomeShellPlugin)) @@ -102,7 +103,7 @@ typedef struct _GnomeShellPluginClass GnomeShellPluginClass; struct _GnomeShellPlugin { - MutterPlugin parent; + MetaPlugin parent; GjsContext *gjs_context; Atom panel_action; @@ -116,20 +117,20 @@ struct _GnomeShellPlugin struct _GnomeShellPluginClass { - MutterPluginClass parent_class; + MetaPluginClass parent_class; }; /* * Create the plugin struct; function pointers initialized in * g_module_check_init(). */ -MUTTER_PLUGIN_DECLARE(GnomeShellPlugin, gnome_shell_plugin); +META_PLUGIN_DECLARE(GnomeShellPlugin, gnome_shell_plugin); static void gnome_shell_plugin_class_init (GnomeShellPluginClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - MutterPluginClass *plugin_class = MUTTER_PLUGIN_CLASS (klass); + MetaPluginClass *plugin_class = META_PLUGIN_CLASS (klass); gobject_class->dispose = gnome_shell_plugin_dispose; gobject_class->finalize = gnome_shell_plugin_finalize; @@ -306,7 +307,7 @@ gvc_muted_debug_log_handler (const char *log_domain, } static void -gnome_shell_plugin_start (MutterPlugin *plugin) +gnome_shell_plugin_start (MetaPlugin *plugin) { GnomeShellPlugin *shell_plugin = GNOME_SHELL_PLUGIN (plugin); MetaScreen *screen; @@ -336,7 +337,7 @@ gnome_shell_plugin_start (MutterPlugin *plugin) NULL); update_font_options (settings); - screen = mutter_plugin_get_screen (plugin); + screen = meta_plugin_get_screen (plugin); display = meta_screen_get_display (screen); xdisplay = meta_display_get_xdisplay (display); @@ -371,7 +372,7 @@ gnome_shell_plugin_start (MutterPlugin *plugin) /* Initialize the global object here. */ global = shell_global_get (); - _shell_global_set_plugin (global, MUTTER_PLUGIN(shell_plugin)); + _shell_global_set_plugin (global, META_PLUGIN(shell_plugin)); _shell_global_set_gjs_context (global, shell_plugin->gjs_context); add_statistics (shell_plugin); @@ -427,8 +428,8 @@ get_shell_wm (void) } static void -gnome_shell_plugin_minimize (MutterPlugin *plugin, - MutterWindow *actor) +gnome_shell_plugin_minimize (MetaPlugin *plugin, + MetaWindowActor *actor) { _shell_wm_minimize (get_shell_wm (), actor); @@ -436,70 +437,70 @@ gnome_shell_plugin_minimize (MutterPlugin *plugin, } static void -gnome_shell_plugin_maximize (MutterPlugin *plugin, - MutterWindow *actor, - gint x, - gint y, - gint width, - gint height) +gnome_shell_plugin_maximize (MetaPlugin *plugin, + MetaWindowActor *actor, + gint x, + gint y, + gint width, + gint height) { _shell_wm_maximize (get_shell_wm (), actor, x, y, width, height); } static void -gnome_shell_plugin_unmaximize (MutterPlugin *plugin, - MutterWindow *actor, - gint x, - gint y, - gint width, - gint height) +gnome_shell_plugin_unmaximize (MetaPlugin *plugin, + MetaWindowActor *actor, + gint x, + gint y, + gint width, + gint height) { _shell_wm_unmaximize (get_shell_wm (), actor, x, y, width, height); } static void -gnome_shell_plugin_map (MutterPlugin *plugin, - MutterWindow *actor) +gnome_shell_plugin_map (MetaPlugin *plugin, + MetaWindowActor *actor) { _shell_wm_map (get_shell_wm (), actor); } static void -gnome_shell_plugin_destroy (MutterPlugin *plugin, - MutterWindow *actor) +gnome_shell_plugin_destroy (MetaPlugin *plugin, + MetaWindowActor *actor) { _shell_wm_destroy (get_shell_wm (), actor); } static void -gnome_shell_plugin_switch_workspace (MutterPlugin *plugin, - gint from, - gint to, - MetaMotionDirection direction) +gnome_shell_plugin_switch_workspace (MetaPlugin *plugin, + gint from, + gint to, + MetaMotionDirection direction) { _shell_wm_switch_workspace (get_shell_wm(), from, to, direction); } static void -gnome_shell_plugin_kill_window_effects (MutterPlugin *plugin, - MutterWindow *actor) +gnome_shell_plugin_kill_window_effects (MetaPlugin *plugin, + MetaWindowActor *actor) { _shell_wm_kill_window_effects (get_shell_wm(), actor); } static void -gnome_shell_plugin_kill_switch_workspace (MutterPlugin *plugin) +gnome_shell_plugin_kill_switch_workspace (MetaPlugin *plugin) { _shell_wm_kill_switch_workspace (get_shell_wm()); } static gboolean -gnome_shell_plugin_xevent_filter (MutterPlugin *plugin, - XEvent *xev) +gnome_shell_plugin_xevent_filter (MetaPlugin *plugin, + XEvent *xev) { #ifdef GLX_INTEL_swap_event GnomeShellPlugin *shell_plugin = GNOME_SHELL_PLUGIN (plugin); @@ -539,9 +540,9 @@ gnome_shell_plugin_xevent_filter (MutterPlugin *plugin, } static const -MutterPluginInfo *gnome_shell_plugin_plugin_info (MutterPlugin *plugin) +MetaPluginInfo *gnome_shell_plugin_plugin_info (MetaPlugin *plugin) { - static const MutterPluginInfo info = { + static const MetaPluginInfo info = { .name = "GNOME Shell", .version = "0.1", .author = "Various", diff --git a/src/shell-global-private.h b/src/shell-global-private.h index 76147a688..201ace86d 100644 --- a/src/shell-global-private.h +++ b/src/shell-global-private.h @@ -7,7 +7,7 @@ #include void _shell_global_set_plugin (ShellGlobal *global, - MutterPlugin *plugin); + MetaPlugin *plugin); void _shell_global_set_gjs_context (ShellGlobal *global, GjsContext *context); diff --git a/src/shell-global.c b/src/shell-global.c index accd411df..a1518b44a 100644 --- a/src/shell-global.c +++ b/src/shell-global.c @@ -52,7 +52,7 @@ struct _ShellGlobal { XserverRegion input_region; GjsContext *js_context; - MutterPlugin *plugin; + MetaPlugin *plugin; ShellWM *wm; GSettings *settings; const char *datadir; @@ -124,7 +124,7 @@ shell_global_get_property(GObject *object, switch (prop_id) { case PROP_OVERLAY_GROUP: - g_value_set_object (value, mutter_plugin_get_overlay_group (global->plugin)); + g_value_set_object (value, meta_plugin_get_overlay_group (global->plugin)); break; case PROP_SCREEN: g_value_set_object (value, shell_global_get_screen (global)); @@ -136,7 +136,7 @@ shell_global_get_property(GObject *object, { int width, height; - mutter_plugin_query_screen_size (global->plugin, &width, &height); + meta_plugin_query_screen_size (global->plugin, &width, &height); g_value_set_int (value, width); } break; @@ -144,18 +144,18 @@ shell_global_get_property(GObject *object, { int width, height; - mutter_plugin_query_screen_size (global->plugin, &width, &height); + meta_plugin_query_screen_size (global->plugin, &width, &height); g_value_set_int (value, height); } break; case PROP_STAGE: - g_value_set_object (value, mutter_plugin_get_stage (global->plugin)); + g_value_set_object (value, meta_plugin_get_stage (global->plugin)); break; case PROP_STAGE_INPUT_MODE: g_value_set_enum (value, global->input_mode); break; case PROP_WINDOW_GROUP: - g_value_set_object (value, mutter_plugin_get_window_group (global->plugin)); + g_value_set_object (value, meta_plugin_get_window_group (global->plugin)); break; case PROP_WINDOW_MANAGER: g_value_set_object (value, global->wm); @@ -391,9 +391,9 @@ shell_global_focus_stage (ShellGlobal *global) ClutterActor *stage; Window xstage; - stage = mutter_plugin_get_stage (global->plugin); + stage = meta_plugin_get_stage (global->plugin); xstage = clutter_x11_get_stage_window (CLUTTER_STAGE (stage)); - xdpy = mutter_plugin_get_xdisplay (global->plugin); + xdpy = meta_plugin_get_xdisplay (global->plugin); XSetInputFocus (xdpy, xstage, RevertToPointerRoot, shell_global_get_current_time (global)); } @@ -430,11 +430,11 @@ shell_global_set_stage_input_mode (ShellGlobal *global, g_return_if_fail (SHELL_IS_GLOBAL (global)); if (mode == SHELL_STAGE_INPUT_MODE_NONREACTIVE || global->gtk_grab_active) - mutter_plugin_set_stage_reactive (global->plugin, FALSE); + meta_plugin_set_stage_reactive (global->plugin, FALSE); else if (mode == SHELL_STAGE_INPUT_MODE_FULLSCREEN || !global->input_region) - mutter_plugin_set_stage_reactive (global->plugin, TRUE); + meta_plugin_set_stage_reactive (global->plugin, TRUE); else - mutter_plugin_set_stage_input_region (global->plugin, global->input_region); + meta_plugin_set_stage_input_region (global->plugin, global->input_region); if (mode == SHELL_STAGE_INPUT_MODE_FOCUSED) shell_global_focus_stage (global); @@ -503,7 +503,7 @@ shell_global_set_cursor (ShellGlobal *global, } if (!global->stage_window) { - ClutterStage *stage = CLUTTER_STAGE (mutter_plugin_get_stage (global->plugin)); + ClutterStage *stage = CLUTTER_STAGE (meta_plugin_get_stage (global->plugin)); global->stage_window = gdk_window_foreign_new (clutter_x11_get_stage_window (stage)); } @@ -542,7 +542,7 @@ void shell_global_set_stage_input_region (ShellGlobal *global, GSList *rectangles) { - MetaScreen *screen = mutter_plugin_get_screen (global->plugin); + MetaScreen *screen = meta_plugin_get_screen (global->plugin); MetaDisplay *display = meta_screen_get_display (screen); Display *xdpy = meta_display_get_xdisplay (display); MetaRectangle *rect; @@ -583,7 +583,7 @@ shell_global_set_stage_input_region (ShellGlobal *global, MetaScreen * shell_global_get_screen (ShellGlobal *global) { - return mutter_plugin_get_screen (global->plugin); + return meta_plugin_get_screen (global->plugin); } /** @@ -600,18 +600,18 @@ shell_global_get_gdk_screen (ShellGlobal *global) } /** - * shell_global_get_windows: + * shell_global_get_window_actors: * - * Gets the list of MutterWindows for the plugin's screen + * Gets the list of #MetaWindowActor for the plugin's screen * - * Return value: (element-type Meta.MutterWindow) (transfer none): the list of windows + * Return value: (element-type Meta.WindowActor) (transfer none): the list of windows */ GList * -shell_global_get_windows (ShellGlobal *global) +shell_global_get_window_actors (ShellGlobal *global) { g_return_val_if_fail (SHELL_IS_GLOBAL (global), NULL); - return mutter_plugin_get_windows (global->plugin); + return meta_plugin_get_window_actors (global->plugin); } static gboolean @@ -620,7 +620,7 @@ update_screen_size (gpointer data) int width, height; ShellGlobal *global = SHELL_GLOBAL (data); - mutter_plugin_query_screen_size (global->plugin, &width, &height); + meta_plugin_query_screen_size (global->plugin, &width, &height); if (global->last_change_screen_width == width && global->last_change_screen_height == height) return FALSE; @@ -683,8 +683,8 @@ global_stage_after_paint (ClutterStage *stage, } void -_shell_global_set_plugin (ShellGlobal *global, - MutterPlugin *plugin) +_shell_global_set_plugin (ShellGlobal *global, + MetaPlugin *plugin) { ClutterActor *stage; MetaScreen *screen; @@ -696,7 +696,7 @@ _shell_global_set_plugin (ShellGlobal *global, global->plugin = plugin; global->wm = shell_wm_new (plugin); - stage = mutter_plugin_get_stage (plugin); + stage = meta_plugin_get_stage (plugin); g_signal_connect (stage, "notify::width", G_CALLBACK (global_stage_notify_width), global); @@ -718,7 +718,7 @@ _shell_global_set_plugin (ShellGlobal *global, "End of stage page repaint", ""); - screen = mutter_plugin_get_screen (global->plugin); + screen = meta_plugin_get_screen (global->plugin); display = meta_screen_get_display (screen); g_signal_connect (display, "notify::focus-window", G_CALLBACK (focus_window_changed), global); @@ -751,10 +751,10 @@ gboolean shell_global_begin_modal (ShellGlobal *global, guint32 timestamp) { - ClutterStage *stage = CLUTTER_STAGE (mutter_plugin_get_stage (global->plugin)); + ClutterStage *stage = CLUTTER_STAGE (meta_plugin_get_stage (global->plugin)); Window stagewin = clutter_x11_get_stage_window (stage); - return mutter_plugin_begin_modal (global->plugin, stagewin, None, 0, timestamp); + return meta_plugin_begin_modal (global->plugin, stagewin, None, 0, timestamp); } /** @@ -767,7 +767,7 @@ void shell_global_end_modal (ShellGlobal *global, guint32 timestamp) { - mutter_plugin_end_modal (global->plugin, timestamp); + meta_plugin_end_modal (global->plugin, timestamp); } /** @@ -788,7 +788,7 @@ shell_global_end_modal (ShellGlobal *global, gboolean shell_global_display_is_grabbed (ShellGlobal *global) { - MetaScreen *screen = mutter_plugin_get_screen (global->plugin); + MetaScreen *screen = meta_plugin_get_screen (global->plugin); MetaDisplay *display = meta_screen_get_display (screen); return meta_display_get_grab_op (display) != META_GRAB_OP_NONE; @@ -1262,7 +1262,7 @@ shell_global_create_root_pixmap_actor (ShellGlobal *global) /* Initialize to the stage color, since that's what will be seen * in the main view if there's no actual background window. */ - stage = mutter_plugin_get_stage (global->plugin); + stage = meta_plugin_get_stage (global->plugin); clutter_stage_get_color (CLUTTER_STAGE (stage), &stage_color); clutter_texture_set_from_rgb_data (CLUTTER_TEXTURE (global->root_pixmap), /* ClutterColor has the same layout diff --git a/src/shell-global.h b/src/shell-global.h index 5cf5e1373..ab0f50b4e 100644 --- a/src/shell-global.h +++ b/src/shell-global.h @@ -2,7 +2,7 @@ #ifndef __SHELL_GLOBAL_H__ #define __SHELL_GLOBAL_H__ -#include "mutter-plugin.h" +#include "meta-plugin.h" #include #include #include @@ -70,7 +70,7 @@ void shell_global_set_stage_input_mode (ShellGlobal *global, void shell_global_set_stage_input_region (ShellGlobal *global, GSList *rectangles); -GList *shell_global_get_windows (ShellGlobal *global); +GList *shell_global_get_window_actors (ShellGlobal *global); gboolean shell_global_begin_modal (ShellGlobal *global, guint32 timestamp); diff --git a/src/shell-wm-private.h b/src/shell-wm-private.h index 76d412cea..c0cd84d23 100644 --- a/src/shell-wm-private.h +++ b/src/shell-wm-private.h @@ -8,32 +8,32 @@ G_BEGIN_DECLS /* These forward along the different effects from GnomeShellPlugin */ -void _shell_wm_minimize (ShellWM *wm, - MutterWindow *actor); -void _shell_wm_maximize (ShellWM *wm, - MutterWindow *actor, - gint x, - gint y, - gint width, - gint height); -void _shell_wm_unmaximize (ShellWM *wm, - MutterWindow *actor, - gint x, - gint y, - gint width, - gint height); -void _shell_wm_map (ShellWM *wm, - MutterWindow *actor); -void _shell_wm_destroy (ShellWM *wm, - MutterWindow *actor); +void _shell_wm_minimize (ShellWM *wm, + MetaWindowActor *actor); +void _shell_wm_maximize (ShellWM *wm, + MetaWindowActor *actor, + gint x, + gint y, + gint width, + gint height); +void _shell_wm_unmaximize (ShellWM *wm, + MetaWindowActor *actor, + gint x, + gint y, + gint width, + gint height); +void _shell_wm_map (ShellWM *wm, + MetaWindowActor *actor); +void _shell_wm_destroy (ShellWM *wm, + MetaWindowActor *actor); -void _shell_wm_switch_workspace (ShellWM *wm, - gint from, - gint to, - MetaMotionDirection direction); -void _shell_wm_kill_window_effects (ShellWM *wm, - MutterWindow *actor); -void _shell_wm_kill_switch_workspace (ShellWM *wm); +void _shell_wm_switch_workspace (ShellWM *wm, + gint from, + gint to, + MetaMotionDirection direction); +void _shell_wm_kill_window_effects (ShellWM *wm, + MetaWindowActor *actor); +void _shell_wm_kill_switch_workspace (ShellWM *wm); G_END_DECLS diff --git a/src/shell-wm.c b/src/shell-wm.c index 8e861b710..669ef4afb 100644 --- a/src/shell-wm.c +++ b/src/shell-wm.c @@ -13,7 +13,7 @@ struct _ShellWM { GObject parent; - MutterPlugin *plugin; + MetaPlugin *plugin; }; /* Signals */ @@ -63,7 +63,7 @@ shell_wm_class_init (ShellWMClass *klass) NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, - MUTTER_TYPE_COMP_WINDOW); + META_TYPE_WINDOW_ACTOR); shell_wm_signals[MAXIMIZE] = g_signal_new ("maximize", G_TYPE_FROM_CLASS (klass), @@ -72,7 +72,7 @@ shell_wm_class_init (ShellWMClass *klass) NULL, NULL, _shell_marshal_VOID__OBJECT_INT_INT_INT_INT, G_TYPE_NONE, 5, - MUTTER_TYPE_COMP_WINDOW, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT); + META_TYPE_WINDOW_ACTOR, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT); shell_wm_signals[UNMAXIMIZE] = g_signal_new ("unmaximize", G_TYPE_FROM_CLASS (klass), @@ -81,7 +81,7 @@ shell_wm_class_init (ShellWMClass *klass) NULL, NULL, _shell_marshal_VOID__OBJECT_INT_INT_INT_INT, G_TYPE_NONE, 1, - MUTTER_TYPE_COMP_WINDOW, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT); + META_TYPE_WINDOW_ACTOR, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT); shell_wm_signals[MAP] = g_signal_new ("map", G_TYPE_FROM_CLASS (klass), @@ -90,7 +90,7 @@ shell_wm_class_init (ShellWMClass *klass) NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, - MUTTER_TYPE_COMP_WINDOW); + META_TYPE_WINDOW_ACTOR); shell_wm_signals[DESTROY] = g_signal_new ("destroy", G_TYPE_FROM_CLASS (klass), @@ -99,7 +99,7 @@ shell_wm_class_init (ShellWMClass *klass) NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, - MUTTER_TYPE_COMP_WINDOW); + META_TYPE_WINDOW_ACTOR); shell_wm_signals[SWITCH_WORKSPACE] = g_signal_new ("switch-workspace", G_TYPE_FROM_CLASS (klass), @@ -125,7 +125,7 @@ shell_wm_class_init (ShellWMClass *klass) NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, - MUTTER_TYPE_COMP_WINDOW); + META_TYPE_WINDOW_ACTOR); /** * ShellWM::keybinding: @@ -174,77 +174,77 @@ _shell_wm_switch_workspace (ShellWM *wm, void shell_wm_completed_switch_workspace (ShellWM *wm) { - mutter_plugin_switch_workspace_completed (wm->plugin); + meta_plugin_switch_workspace_completed (wm->plugin); } /** * shell_wm_completed_minimize * @wm: the ShellWM - * @actor: the MutterWindow actor + * @actor: the MetaWindowActor actor * * The plugin must call this when it has completed a window minimize effect. **/ void -shell_wm_completed_minimize (ShellWM *wm, - MutterWindow *actor) +shell_wm_completed_minimize (ShellWM *wm, + MetaWindowActor *actor) { - mutter_plugin_minimize_completed (wm->plugin, actor); + meta_plugin_minimize_completed (wm->plugin, actor); } /** * shell_wm_completed_maximize * @wm: the ShellWM - * @actor: the MutterWindow actor + * @actor: the MetaWindowActor actor * * The plugin must call this when it has completed a window maximize effect. **/ void -shell_wm_completed_maximize (ShellWM *wm, - MutterWindow *actor) +shell_wm_completed_maximize (ShellWM *wm, + MetaWindowActor *actor) { - mutter_plugin_maximize_completed (wm->plugin, actor); + meta_plugin_maximize_completed (wm->plugin, actor); } /** * shell_wm_completed_unmaximize * @wm: the ShellWM - * @actor: the MutterWindow actor + * @actor: the MetaWindowActor actor * * The plugin must call this when it has completed a window unmaximize effect. **/ void -shell_wm_completed_unmaximize (ShellWM *wm, - MutterWindow *actor) +shell_wm_completed_unmaximize (ShellWM *wm, + MetaWindowActor *actor) { - mutter_plugin_unmaximize_completed (wm->plugin, actor); + meta_plugin_unmaximize_completed (wm->plugin, actor); } /** * shell_wm_completed_map * @wm: the ShellWM - * @actor: the MutterWindow actor + * @actor: the MetaWindowActor actor * * The plugin must call this when it has completed a window map effect. **/ void -shell_wm_completed_map (ShellWM *wm, - MutterWindow *actor) +shell_wm_completed_map (ShellWM *wm, + MetaWindowActor *actor) { - mutter_plugin_map_completed (wm->plugin, actor); + meta_plugin_map_completed (wm->plugin, actor); } /** * shell_wm_completed_destroy * @wm: the ShellWM - * @actor: the MutterWindow actor + * @actor: the MetaWindowActor actor * * The plugin must call this when it has completed a window destroy effect. **/ void -shell_wm_completed_destroy (ShellWM *wm, - MutterWindow *actor) +shell_wm_completed_destroy (ShellWM *wm, + MetaWindowActor *actor) { - mutter_plugin_destroy_completed (wm->plugin, actor); + meta_plugin_destroy_completed (wm->plugin, actor); } void @@ -254,66 +254,66 @@ _shell_wm_kill_switch_workspace (ShellWM *wm) } void -_shell_wm_kill_window_effects (ShellWM *wm, - MutterWindow *actor) +_shell_wm_kill_window_effects (ShellWM *wm, + MetaWindowActor *actor) { g_signal_emit (wm, shell_wm_signals[KILL_WINDOW_EFFECTS], 0, actor); } void -_shell_wm_minimize (ShellWM *wm, - MutterWindow *actor) +_shell_wm_minimize (ShellWM *wm, + MetaWindowActor *actor) { g_signal_emit (wm, shell_wm_signals[MINIMIZE], 0, actor); } void -_shell_wm_maximize (ShellWM *wm, - MutterWindow *actor, - int target_x, - int target_y, - int target_width, - int target_height) +_shell_wm_maximize (ShellWM *wm, + MetaWindowActor *actor, + int target_x, + int target_y, + int target_width, + int target_height) { g_signal_emit (wm, shell_wm_signals[MAXIMIZE], 0, actor, target_x, target_y, target_width, target_height); } void -_shell_wm_unmaximize (ShellWM *wm, - MutterWindow *actor, - int target_x, - int target_y, - int target_width, - int target_height) +_shell_wm_unmaximize (ShellWM *wm, + MetaWindowActor *actor, + int target_x, + int target_y, + int target_width, + int target_height) { g_signal_emit (wm, shell_wm_signals[UNMAXIMIZE], 0, actor, target_x, target_y, target_width, target_height); } void -_shell_wm_map (ShellWM *wm, - MutterWindow *actor) +_shell_wm_map (ShellWM *wm, + MetaWindowActor *actor) { g_signal_emit (wm, shell_wm_signals[MAP], 0, actor); } void -_shell_wm_destroy (ShellWM *wm, - MutterWindow *actor) +_shell_wm_destroy (ShellWM *wm, + MetaWindowActor *actor) { g_signal_emit (wm, shell_wm_signals[DESTROY], 0, actor); } /** * shell_wm_new: - * @plugin: the #MutterPlugin + * @plugin: the #MetaPlugin * * Creates a new window management interface by hooking into @plugin. * * Return value: the new window-management interface **/ ShellWM * -shell_wm_new (MutterPlugin *plugin) +shell_wm_new (MetaPlugin *plugin) { ShellWM *wm; @@ -342,7 +342,7 @@ shell_wm_key_handler (MetaDisplay *display, /** * shell_wm_takeover_keybinding: * @wm: the #ShellWM - * @binding_name: a mutter keybinding name + * @binding_name: a meta keybinding name * * Tells mutter to forward keypresses for @binding_name to the shell * rather than processing them internally. This will cause a diff --git a/src/shell-wm.h b/src/shell-wm.h index f7ab962ca..477ac1e70 100644 --- a/src/shell-wm.h +++ b/src/shell-wm.h @@ -3,7 +3,7 @@ #define __SHELL_WM_H__ #include -#include +#include G_BEGIN_DECLS @@ -25,19 +25,19 @@ struct _ShellWMClass GType shell_wm_get_type (void) G_GNUC_CONST; -ShellWM *shell_wm_new (MutterPlugin *plugin); +ShellWM *shell_wm_new (MetaPlugin *plugin); -void shell_wm_completed_minimize (ShellWM *wm, - MutterWindow *actor); -void shell_wm_completed_maximize (ShellWM *wm, - MutterWindow *actor); -void shell_wm_completed_unmaximize (ShellWM *wm, - MutterWindow *actor); -void shell_wm_completed_map (ShellWM *wm, - MutterWindow *actor); -void shell_wm_completed_destroy (ShellWM *wm, - MutterWindow *actor); -void shell_wm_completed_switch_workspace (ShellWM *wm); +void shell_wm_completed_minimize (ShellWM *wm, + MetaWindowActor *actor); +void shell_wm_completed_maximize (ShellWM *wm, + MetaWindowActor *actor); +void shell_wm_completed_unmaximize (ShellWM *wm, + MetaWindowActor *actor); +void shell_wm_completed_map (ShellWM *wm, + MetaWindowActor *actor); +void shell_wm_completed_destroy (ShellWM *wm, + MetaWindowActor *actor); +void shell_wm_completed_switch_workspace (ShellWM *wm); /* Keybinding stuff */ void shell_wm_takeover_keybinding (ShellWM *wm, From 95ac478f87f90377bc59e9af0cf894becc126d37 Mon Sep 17 00:00:00 2001 From: Maxim Ermilov Date: Sun, 24 Oct 2010 05:45:54 +0400 Subject: [PATCH 11/27] dnd: Handle destruction of drag actor during drag The shell crashes if the drag actor is destroyed during the drag operation. Cancel the drag gracefully in this case. https://bugzilla.gnome.org/show_bug.cgi?id=620389 --- js/ui/dnd.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/js/ui/dnd.js b/js/ui/dnd.js index 217a83982..9ebb2d400 100644 --- a/js/ui/dnd.js +++ b/js/ui/dnd.js @@ -86,6 +86,9 @@ _Draggable.prototype = { Lang.bind(this, this._onButtonPress)); this.actor.connect('destroy', Lang.bind(this, function() { + this._actorDestroyed = true; + if (this._dragInProgress) + this._cancelDrag(global.get_current_time()); this.disconnectAll(); })); this._onEventId = null; @@ -417,6 +420,8 @@ _Draggable.prototype = { targX, targY, event.get_time())) { + if (this._actorDestroyed) + return true; // If it accepted the drop without taking the actor, // handle it ourselves. if (this._dragActor.get_parent() == this._dragActor.get_stage()) { @@ -458,6 +463,12 @@ _Draggable.prototype = { this._dragInProgress = false; let [snapBackX, snapBackY] = this._getRestoreLocation(); + if (this._actorDestroyed) { + global.unset_cursor(); + this.emit('drag-end', eventTime, false); + return; + } + this._animationInProgress = true; // No target, so snap back Tweener.addTween(this._dragActor, From 17055023dbba36d14b2014f0996ff2c23fee61b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=20Di=C3=A9guez?= Date: Mon, 25 Oct 2010 01:02:24 +0200 Subject: [PATCH 12/27] Updated galician translations --- po/gl.po | 120 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 89 insertions(+), 31 deletions(-) diff --git a/po/gl.po b/po/gl.po index bad4876a4..ff85d858b 100644 --- a/po/gl.po +++ b/po/gl.po @@ -10,8 +10,8 @@ msgid "" msgstr "" "Project-Id-Version: gnome-shell master\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-10-07 13:04+0200\n" -"PO-Revision-Date: 2010-10-07 13:20+0200\n" +"POT-Creation-Date: 2010-10-25 00:55+0200\n" +"PO-Revision-Date: 2010-10-25 01:02+0200\n" "Last-Translator: Fran Diéguez \n" "Language-Team: Galician \n" "Language: gl\n" @@ -250,6 +250,15 @@ msgid "" "push: when the magnified mouse intersects a boundary of the zoom region, the " "contents are scrolled into view." msgstr "" +"Determina a posición da imaxe magnificada do rato dentro da vista " +"magnificada e como reacciona ao movemento do rato do sistema. Os valores son " +"«none» (ningún): sen seguimento do rato; «centered» (centrado): a imaxe do " +"rato móstrase no centro da rexión ampliada (que tamén representa o punto " +"baixo o rato do sistema) e o contido magnificado deslízase segundo se move o " +"rato do sistema; «proporcional»: a posición do rato magnificado na rexión de " +"ampliación é proporcionalmente a mesma que a posición do rato do sistema na " +"pantalla; «push» (empurrar): cando o rato magnificado cruza un límite da " +"rexión de ampliación, o contido deslízase na vista." #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:5 msgid "" @@ -265,11 +274,13 @@ msgid "" "are clipped such that the ends of the horizontal and vertical lines surround " "the mouse image." msgstr "" +"Determina se as cruces cruzan o «sprite» magnificado do rato ou fíxanse de " +"tal forma que os finais das liñas horizontais e verticais rodean a imaxe do " +"rato." #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:7 -#, fuzzy msgid "Enable lens mode" -msgstr "Activado" +msgstr "Activar o modo lente" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:8 msgid "" @@ -285,6 +296,9 @@ msgid "" "of the screen, the magnified contents continue to scroll such that the " "screen edge moves into the magnified view." msgstr "" +"Para o seguimento do centro do rato, cando o punteiro do sistema está preto " +"do bordo da pantalla, o contido magnificado continúa desprazándose de tal " +"forma que o bordo da pantalla móvese dentro da vista magnificada." #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:10 msgid "Length of the crosshairs" @@ -482,58 +496,58 @@ msgid "Undo" msgstr "Desfacer" #. TODO - _quit() doesn't really work on apps in state STARTING yet -#: ../js/ui/panel.js:468 +#: ../js/ui/panel.js:469 #, c-format msgid "Quit %s" msgstr "Saír de %s" -#: ../js/ui/panel.js:493 +#: ../js/ui/panel.js:494 msgid "Preferences" msgstr "Preferencias" #. Translators: This is the time format with date used #. in 24-hour mode. -#: ../js/ui/panel.js:579 +#: ../js/ui/panel.js:580 msgid "%a %b %e, %R:%S" msgstr "%a %e de %b, %R:%S" -#: ../js/ui/panel.js:580 +#: ../js/ui/panel.js:581 msgid "%a %b %e, %R" msgstr "%a %e de %b, %R" #. Translators: This is the time format without date used #. in 24-hour mode. -#: ../js/ui/panel.js:584 +#: ../js/ui/panel.js:585 msgid "%a %R:%S" msgstr "%a %R:%S" -#: ../js/ui/panel.js:585 +#: ../js/ui/panel.js:586 msgid "%a %R" msgstr "%a %R" #. Translators: This is a time format with date used #. for AM/PM. -#: ../js/ui/panel.js:592 +#: ../js/ui/panel.js:593 msgid "%a %b %e, %l:%M:%S %p" msgstr "%a %e de %b, %H:%M:%S" -#: ../js/ui/panel.js:593 +#: ../js/ui/panel.js:594 msgid "%a %b %e, %l:%M %p" msgstr "%a %e de %b, %H:%M" #. Translators: This is a time format without date used #. for AM/PM. -#: ../js/ui/panel.js:597 +#: ../js/ui/panel.js:598 msgid "%a %l:%M:%S %p" msgstr "%a %H:%M:%S" -#: ../js/ui/panel.js:598 +#: ../js/ui/panel.js:599 msgid "%a %l:%M %p" msgstr "%a %l:%M %p" #. Button on the left side of the panel. #. Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview". -#: ../js/ui/panel.js:743 +#: ../js/ui/panel.js:744 msgid "Activities" msgstr "Actividades" @@ -568,42 +582,86 @@ msgstr "Insira unha orde:" msgid "Execution of '%s' failed:" msgstr "Produciuse un fallo na execución de %s" -#: ../js/ui/statusMenu.js:91 +#: ../js/ui/statusMenu.js:97 msgid "Available" msgstr "Dispoñíbel" -#: ../js/ui/statusMenu.js:95 +#: ../js/ui/statusMenu.js:101 msgid "Busy" msgstr "Ocupado" -#: ../js/ui/statusMenu.js:99 +#: ../js/ui/statusMenu.js:105 msgid "Invisible" msgstr "Invisíbel" -#: ../js/ui/statusMenu.js:106 +#: ../js/ui/statusMenu.js:112 msgid "Account Information..." msgstr "Información da conta..." -#: ../js/ui/statusMenu.js:110 +#: ../js/ui/statusMenu.js:116 msgid "System Settings..." msgstr "Configuracións do sistema..." -#: ../js/ui/statusMenu.js:117 +#: ../js/ui/statusMenu.js:123 msgid "Lock Screen" msgstr "Bloquear pantalla" -#: ../js/ui/statusMenu.js:121 +#: ../js/ui/statusMenu.js:127 msgid "Switch User" msgstr "Cambiar de usuario" -#: ../js/ui/statusMenu.js:126 +#: ../js/ui/statusMenu.js:132 msgid "Log Out..." msgstr "Saír da sesión..." -#: ../js/ui/statusMenu.js:130 +#: ../js/ui/statusMenu.js:136 msgid "Shut Down..." msgstr "Apagar..." +#: ../js/ui/status/accessibility.js:88 +msgid "Screen Reader" +msgstr "Lector de pantalla" + +#: ../js/ui/status/accessibility.js:91 +msgid "Screen Keyboard" +msgstr "Teclado en pantalla" + +#: ../js/ui/status/accessibility.js:94 +msgid "Visual Alerts" +msgstr "Alertas visuais" + +#: ../js/ui/status/accessibility.js:97 +msgid "Sticky Keys" +msgstr "Teclas persistentes" + +#: ../js/ui/status/accessibility.js:100 +msgid "Slow Keys" +msgstr "Teclas lentas" + +#: ../js/ui/status/accessibility.js:103 +msgid "Bounce Keys" +msgstr "Rebote das teclas" + +#: ../js/ui/status/accessibility.js:106 +msgid "Mouse Keys" +msgstr "Teclas do Rato" + +#: ../js/ui/status/accessibility.js:110 +msgid "Universal Access Settings" +msgstr "Configuracións de acceso universal" + +#: ../js/ui/status/accessibility.js:163 +msgid "High Contrast" +msgstr "Alto contraste" + +#: ../js/ui/status/accessibility.js:202 +msgid "Large Text" +msgstr "Texto máis grande" + +#: ../js/ui/status/accessibility.js:223 +msgid "Zoom" +msgstr "Ampliación" + #: ../js/ui/windowAttentionHandler.js:43 #, c-format msgid "%s has finished starting" @@ -614,43 +672,43 @@ msgstr "%s rematou de iniarse" msgid "'%s' is ready" msgstr "«%s» está preparado" -#: ../js/ui/workspacesView.js:230 +#: ../js/ui/workspacesView.js:229 msgid "" "Can't add a new workspace because maximum workspaces limit has been reached." msgstr "" "Non é posíbel engadir unha área de traballo nova porque chegouse ao límite " "de áreas de traballo." -#: ../js/ui/workspacesView.js:247 +#: ../js/ui/workspacesView.js:246 msgid "Can't remove the first workspace." msgstr "Non é posíbel quitar a primeira área de traballo." -#: ../src/shell-global.c:1196 +#: ../src/shell-global.c:1204 msgid "Less than a minute ago" msgstr "Hai menos dun minuto" -#: ../src/shell-global.c:1200 +#: ../src/shell-global.c:1208 #, c-format msgid "%d minute ago" msgid_plural "%d minutes ago" msgstr[0] "hai %d minuto" msgstr[1] "hai %d minutos" -#: ../src/shell-global.c:1205 +#: ../src/shell-global.c:1213 #, c-format msgid "%d hour ago" msgid_plural "%d hours ago" msgstr[0] "hai %d hora" msgstr[1] "hai %d horas" -#: ../src/shell-global.c:1210 +#: ../src/shell-global.c:1218 #, c-format msgid "%d day ago" msgid_plural "%d days ago" msgstr[0] "hai %d día" msgstr[1] "hai %d días" -#: ../src/shell-global.c:1215 +#: ../src/shell-global.c:1223 #, c-format msgid "%d week ago" msgid_plural "%d weeks ago" From bc22109130c44799c9c4120ee737a17bd28684a3 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Sun, 24 Oct 2010 14:26:50 +0200 Subject: [PATCH 13/27] Avoid warnings on null actors for tray icons Plugging the GtkSocket icon can fail, in which case NaTrayManager emits tray-icon-removed but the icon has never emitted plug-added, thus the ShellTrayIcon has not been created. This results in various criticals and exceptions in the tray-icon-removed handler. https://bugzilla.gnome.org/show_bug.cgi?id=633028 --- src/shell-tray-manager.c | 22 +++++++++++++++------- src/tray/na-tray-manager.c | 2 +- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/shell-tray-manager.c b/src/shell-tray-manager.c index ada5f4c05..37368dab3 100644 --- a/src/shell-tray-manager.c +++ b/src/shell-tray-manager.c @@ -60,11 +60,13 @@ free_tray_icon (gpointer data) { ShellTrayManagerChild *child = data; - gtk_widget_hide (child->window); gtk_widget_destroy (child->window); - g_signal_handlers_disconnect_matched (child->actor, G_SIGNAL_MATCH_DATA, - 0, 0, NULL, NULL, child); - g_object_unref (child->actor); + if (child->actor) + { + g_signal_handlers_disconnect_matched (child->actor, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, child); + g_object_unref (child->actor); + } g_slice_free (ShellTrayManagerChild, child); } @@ -314,8 +316,14 @@ na_tray_icon_removed (NaTrayManager *na_manager, GtkWidget *socket, child = g_hash_table_lookup (manager->priv->icons, socket); g_return_if_fail (child != NULL); - g_signal_emit (manager, - shell_tray_manager_signals[TRAY_ICON_REMOVED], 0, - child->actor); + if (child->actor != NULL) + { + /* Only emit signal if a corresponding tray-icon-added signal was emitted, + that is, if embedding did not fail and we got a plug-added + */ + g_signal_emit (manager, + shell_tray_manager_signals[TRAY_ICON_REMOVED], 0, + child->actor); + } g_hash_table_remove (manager->priv->icons, socket); } diff --git a/src/tray/na-tray-manager.c b/src/tray/na-tray-manager.c index 5a0b3bd79..bccda638e 100644 --- a/src/tray/na-tray-manager.c +++ b/src/tray/na-tray-manager.c @@ -300,8 +300,8 @@ na_tray_manager_handle_dock_request (NaTrayManager *manager, if (!gtk_socket_get_plug_window (GTK_SOCKET (child))) { /* Embedding failed, we won't get a plug-removed signal */ + /* This signal destroys the socket */ g_signal_emit (manager, manager_signals[TRAY_ICON_REMOVED], 0, child); - gtk_widget_destroy (child); return; } From a915af4b30a5692fd72db861a5c5280059c72327 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Sun, 24 Oct 2010 14:30:03 +0200 Subject: [PATCH 14/27] Avoid warnings on leave-event for widgets tracking hover ClutterCrossingEvent->related can be NULL if the pointer is not under any actor. Unconditionally set hover to FALSE in that case. https://bugzilla.gnome.org/show_bug.cgi?id=633028 --- src/st/st-widget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/st/st-widget.c b/src/st/st-widget.c index e5f30509f..48c7a3dde 100644 --- a/src/st/st-widget.c +++ b/src/st/st-widget.c @@ -594,7 +594,7 @@ st_widget_leave (ClutterActor *actor, if (priv->track_hover) { - if (!clutter_actor_contains (actor, event->related)) + if (!event->related || !clutter_actor_contains (actor, event->related)) st_widget_set_hover (ST_WIDGET (actor), FALSE); } From c48c80e4e990209ca7e82a719ae0f7448213a6a1 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Sun, 24 Oct 2010 14:31:41 +0200 Subject: [PATCH 15/27] Allow for empty WM_CLASS and _NET_WM_NAME in tray icons The system tray specification says the hint should be set, but some icons leave it empty anyway. Don't throw exceptions in that case. https://bugzilla.gnome.org/show_bug.cgi?id=633028 --- js/ui/notificationDaemon.js | 2 +- js/ui/statusIconDispatcher.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js index 59c48d59f..61de6943f 100644 --- a/js/ui/notificationDaemon.js +++ b/js/ui/notificationDaemon.js @@ -372,7 +372,7 @@ NotificationDaemon.prototype = { _onTrayIconAdded: function(o, icon) { let source = this._sources[icon.pid]; if (!source) - source = this._newSource(icon.title, icon.pid); + source = this._newSource(icon.title || icon.wm_class || _("Unknown"), icon.pid); source.setTrayIcon(icon); }, diff --git a/js/ui/statusIconDispatcher.js b/js/ui/statusIconDispatcher.js index fc754c9f4..8c796acd6 100644 --- a/js/ui/statusIconDispatcher.js +++ b/js/ui/statusIconDispatcher.js @@ -36,7 +36,7 @@ StatusIconDispatcher.prototype = { }, _onTrayIconAdded: function(o, icon) { - let wmClass = icon.wm_class.toLowerCase(); + let wmClass = (icon.wm_class || 'unknown').toLowerCase(); let role = STANDARD_TRAY_ICON_IMPLEMENTATIONS[wmClass]; if (role) this.emit('status-icon-added', icon, role); @@ -45,7 +45,7 @@ StatusIconDispatcher.prototype = { }, _onTrayIconRemoved: function(o, icon) { - let wmClass = icon.wm_class.toLowerCase(); + let wmClass = (icon.wm_class || 'unknown').toLowerCase(); let role = STANDARD_TRAY_ICON_IMPLEMENTATIONS[wmClass]; if (role) this.emit('status-icon-removed', icon); From ef544f6e064663bf3994df7a2436ad4725d13ab9 Mon Sep 17 00:00:00 2001 From: Maxim Ermilov Date: Mon, 25 Oct 2010 19:47:40 +0400 Subject: [PATCH 16/27] add /usr/local/share/applications to gs-applications.menu https://bugzilla.gnome.org/show_bug.cgi?id=630866 --- data/gs-applications.menu | 1 + 1 file changed, 1 insertion(+) diff --git a/data/gs-applications.menu b/data/gs-applications.menu index a523ee830..1d0bfdc03 100644 --- a/data/gs-applications.menu +++ b/data/gs-applications.menu @@ -5,6 +5,7 @@ Tools Applications + /usr/local/share/applications Games From 6064661de9b3df89e4db89992b65c5956375790e Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Mon, 25 Oct 2010 15:20:01 -0400 Subject: [PATCH 17/27] gnome-shell.modules: order GConf after gtk3 GConf has test programs that link against GTK+, and defaults to using gtk3 if found, so build GConf after gtk3. --- tools/build/gnome-shell.modules | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/build/gnome-shell.modules b/tools/build/gnome-shell.modules index ffc03ef63..abf6df9cd 100644 --- a/tools/build/gnome-shell.modules +++ b/tools/build/gnome-shell.modules @@ -131,6 +131,7 @@ + From c217377114a4e885e352d95ac91121ba445810f7 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 14 Oct 2010 10:38:33 -0400 Subject: [PATCH 18/27] main: use Meta.Display.get_keybinding_action for PrintScreen as well (and trigger it on keyrelease rather than keypress, like the other bindings) https://bugzilla.gnome.org/show_bug.cgi?id=632151 --- js/ui/main.js | 69 +++++++++++++++++++++++---------------------------- 1 file changed, 31 insertions(+), 38 deletions(-) diff --git a/js/ui/main.js b/js/ui/main.js index cc017e32d..8e46209e6 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -292,13 +292,30 @@ function _removeUnusedWorkspaces() { function _globalKeyPressHandler(actor, event) { if (modalCount == 0) return false; + if (event.type() != Clutter.EventType.KEY_RELEASE) + return false; - let type = event.type(); + let symbol = event.get_key_symbol(); + let keyCode = event.get_key_code(); + let modifierState = Shell.get_event_state(event); + // Check the overview key first, this isn't a Meta.KeyBindingAction yet + if (symbol == Clutter.Super_L || symbol == Clutter.Super_R) { + // The super key is the default for triggering the overview, and should + // get us out of the overview when we are already in it. + if (overview.visible) + overview.hide(); - if (type == Clutter.EventType.KEY_PRESS) { - let symbol = event.get_key_symbol(); - if (symbol == Clutter.Print) { - // We want to be able to take screenshots of the shell at all times + return true; + } + + // Whitelist some of the Metacity actions + let display = global.screen.get_display(); + let activeWorkspaceIndex = global.screen.get_active_workspace_index(); + + // This relies on the fact that Clutter.ModifierType is the same as Gdk.ModifierType + let action = display.get_keybinding_action(keyCode, modifierState); + switch (action) { + case Meta.KeyBindingAction.COMMAND_SCREENSHOT: let gconf = GConf.Client.get_default(); let command = gconf.get_string('/apps/metacity/keybinding_commands/command_screenshot'); if (command != null && command != '') { @@ -306,41 +323,17 @@ function _globalKeyPressHandler(actor, event) { let p = new Shell.Process({'args' : args}); p.run(); } - return true; - } - } else if (type == Clutter.EventType.KEY_RELEASE) { - let symbol = event.get_key_symbol(); - let keyCode = event.get_key_code(); - let modifierState = Shell.get_event_state(event); - // Check the overview key first, this isn't a Meta.KeyBindingAction yet - if (symbol == Clutter.Super_L || symbol == Clutter.Super_R) { - // The super key is the default for triggering the overview, and should - // get us out of the overview when we are already in it. - if (overview.visible) - overview.hide(); - + case Meta.KeyBindingAction.WORKSPACE_LEFT: + wm.actionMoveWorkspaceLeft(); + return true; + case Meta.KeyBindingAction.WORKSPACE_RIGHT: + wm.actionMoveWorkspaceRight(); + return true; + case Meta.KeyBindingAction.PANEL_RUN_DIALOG: + case Meta.KeyBindingAction.COMMAND_2: + getRunDialog().open(); return true; - } - - // Whitelist some of the Metacity actions - let display = global.screen.get_display(); - let activeWorkspaceIndex = global.screen.get_active_workspace_index(); - - // This relies on the fact that Clutter.ModifierType is the same as Gdk.ModifierType - let action = display.get_keybinding_action(symbol, keyCode, modifierState); - switch (action) { - case Meta.KeyBindingAction.WORKSPACE_LEFT: - wm.actionMoveWorkspaceLeft(); - return true; - case Meta.KeyBindingAction.WORKSPACE_RIGHT: - wm.actionMoveWorkspaceRight(); - return true; - case Meta.KeyBindingAction.PANEL_RUN_DIALOG: - case Meta.KeyBindingAction.COMMAND_2: - getRunDialog().open(); - return true; - } } return false; From 86efdc906aa94b5fcf5c398019567acc6ca0c0f3 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 19 Oct 2010 11:59:23 -0400 Subject: [PATCH 19/27] PopupImageMenuItem: always show icon, on the right, not the left In the new mockups, the user menu icons are on the right, not the left. Also, get rid of the idea of optional icons; the design doesn't have icons on those items, and there probably aren't going to be symbolic versions of some of those icons anyway. So if the caller specifies PopupImageMenuItem, then always show an icon, and just use regular PopupMenuItems for the items that don't have icons in the current design. https://bugzilla.gnome.org/show_bug.cgi?id=631193 --- js/ui/popupMenu.js | 52 ++++++++++----------------------------------- js/ui/statusMenu.js | 12 +++++------ 2 files changed, 17 insertions(+), 47 deletions(-) diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index cb17c021a..934d35446 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -372,64 +372,34 @@ PopupSwitchMenuItem.prototype = { } -function PopupImageMenuItem(text, iconName, alwaysShowImage) { - this._init(text, iconName, alwaysShowImage); +function PopupImageMenuItem(text, iconName) { + this._init(text, iconName); } -// We need to instantiate a GtkImageMenuItem so it -// hooks up its properties on the GtkSettings -var _gtkImageMenuItemCreated = false; - PopupImageMenuItem.prototype = { __proto__: PopupBaseMenuItem.prototype, - _init: function (text, iconName, alwaysShowImage) { + _init: function (text, iconName) { PopupBaseMenuItem.prototype._init.call(this); - if (!_gtkImageMenuItemCreated) { - let menuItem = new Gtk.ImageMenuItem(); - menuItem.destroy(); - _gtkImageMenuItemCreated = true; - } - - this._alwaysShowImage = alwaysShowImage; - this._iconName = iconName; this._size = 16; let box = new St.BoxLayout({ style_class: 'popup-image-menu-item' }); this.actor.set_child(box); - this._imageBin = new St.Bin({ width: this._size, height: this._size }); - box.add(this._imageBin, { y_fill: false }); this.label = new St.Label({ text: text }); box.add(this.label, { expand: true }); + this._imageBin = new St.Bin({ width: this._size, height: this._size }); + box.add(this._imageBin, { y_fill: false }); - if (!alwaysShowImage) { - let settings = Gtk.Settings.get_default(); - settings.connect('notify::gtk-menu-images', Lang.bind(this, this._onMenuImagesChanged)); - } - this._onMenuImagesChanged(); + this.setIcon(iconName); }, - _onMenuImagesChanged: function() { - let show; - if (this._alwaysShowImage) { - show = true; - } else { - let settings = Gtk.Settings.get_default(); - show = settings.gtk_menu_images; - } - if (!show) { - this._imageBin.hide(); - } else { - let img = St.TextureCache.get_default().load_icon_name(this._iconName, St.IconType.SYMBOLIC, this._size); - this._imageBin.set_child(img); - this._imageBin.show(); - } - }, - setIcon: function(name) { - this._iconName = name; - this._onMenuImagesChanged(); + if (this._imageBin.child) + this._imageBin.child.destroy(); + + let img = St.TextureCache.get_default().load_icon_name(name, St.IconType.SYMBOLIC, this._size); + this._imageBin.set_child(img); } }; diff --git a/js/ui/statusMenu.js b/js/ui/statusMenu.js index 9aae26cb4..1979668e1 100644 --- a/js/ui/statusMenu.js +++ b/js/ui/statusMenu.js @@ -109,31 +109,31 @@ StatusMenuButton.prototype = { item = new PopupMenu.PopupSeparatorMenuItem(); this.menu.addMenuItem(item); - item = new PopupMenu.PopupImageMenuItem(_("Account Information..."), 'user-info'); + item = new PopupMenu.PopupMenuItem(_("Account Information...")); item.connect('activate', Lang.bind(this, this._onAccountInformationActivate)); this.menu.addMenuItem(item); - item = new PopupMenu.PopupImageMenuItem(_("System Settings..."), 'preferences-desktop'); + item = new PopupMenu.PopupMenuItem(_("System Settings...")); item.connect('activate', Lang.bind(this, this._onPreferencesActivate)); this.menu.addMenuItem(item); item = new PopupMenu.PopupSeparatorMenuItem(); this.menu.addMenuItem(item); - item = new PopupMenu.PopupImageMenuItem(_("Lock Screen"), 'system-lock-screen'); + item = new PopupMenu.PopupMenuItem(_("Lock Screen")); item.connect('activate', Lang.bind(this, this._onLockScreenActivate)); this.menu.addMenuItem(item); - item = new PopupMenu.PopupImageMenuItem(_("Switch User"), 'system-users'); + item = new PopupMenu.PopupMenuItem(_("Switch User")); item.connect('activate', Lang.bind(this, this._onLoginScreenActivate)); this.menu.addMenuItem(item); this._loginScreenItem = item; - item = new PopupMenu.PopupImageMenuItem(_("Log Out..."), 'system-log-out'); + item = new PopupMenu.PopupMenuItem(_("Log Out...")); item.connect('activate', Lang.bind(this, this._onQuitSessionActivate)); this.menu.addMenuItem(item); - item = new PopupMenu.PopupImageMenuItem(_("Shut Down..."), 'system-shutdown'); + item = new PopupMenu.PopupMenuItem(_("Shut Down...")); item.connect('activate', Lang.bind(this, this._onShutDownActivate)); this.menu.addMenuItem(item); }, From fa752110f3fb55131fe8819352f11b1db12bbf2f Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 19 Oct 2010 12:04:58 -0400 Subject: [PATCH 20/27] statusMenu: fix menu items to match latest mockups Rename a few, and add Suspend and Restart, although currently they do the same thing as Shut Down (ie, they bring up a dialog that lets you do any of those three). This will be fixed later when we have the in-shell modal dialogs for these features. https://bugzilla.gnome.org/show_bug.cgi?id=631193 --- js/ui/statusMenu.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/js/ui/statusMenu.js b/js/ui/statusMenu.js index 1979668e1..89eb4eb08 100644 --- a/js/ui/statusMenu.js +++ b/js/ui/statusMenu.js @@ -109,11 +109,11 @@ StatusMenuButton.prototype = { item = new PopupMenu.PopupSeparatorMenuItem(); this.menu.addMenuItem(item); - item = new PopupMenu.PopupMenuItem(_("Account Information...")); - item.connect('activate', Lang.bind(this, this._onAccountInformationActivate)); + item = new PopupMenu.PopupMenuItem(_("My Account...")); + item.connect('activate', Lang.bind(this, this._onMyAccountActivate)); this.menu.addMenuItem(item); - item = new PopupMenu.PopupMenuItem(_("System Settings...")); + item = new PopupMenu.PopupMenuItem(_("System Preferences...")); item.connect('activate', Lang.bind(this, this._onPreferencesActivate)); this.menu.addMenuItem(item); @@ -133,6 +133,17 @@ StatusMenuButton.prototype = { item.connect('activate', Lang.bind(this, this._onQuitSessionActivate)); this.menu.addMenuItem(item); + item = new PopupMenu.PopupSeparatorMenuItem(); + this.menu.addMenuItem(item); + + item = new PopupMenu.PopupMenuItem(_("Suspend")); + item.connect('activate', Lang.bind(this, this._onShutDownActivate)); + this.menu.addMenuItem(item); + + item = new PopupMenu.PopupMenuItem(_("Restart...")); + item.connect('activate', Lang.bind(this, this._onShutDownActivate)); + this.menu.addMenuItem(item); + item = new PopupMenu.PopupMenuItem(_("Shut Down...")); item.connect('activate', Lang.bind(this, this._onShutDownActivate)); this.menu.addMenuItem(item); @@ -142,7 +153,7 @@ StatusMenuButton.prototype = { this._presence.setStatus(status); }, - _onAccountInformationActivate: function() { + _onMyAccountActivate: function() { Main.overview.hide(); this._spawn(['gnome-about-me']); }, From 5661946de129301763e0863b80231af314f31eb5 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 19 Oct 2010 13:41:41 -0400 Subject: [PATCH 21/27] popupMenu: make menu layout more table-like When there are menu items with right-aligned items, all the right-aligned items should appear to the right of all the left-aligned items. Clutter doesn't have an equivalent of GtkSizeGroup, so hack something up using ShellGenericContainer and some javascript. https://bugzilla.gnome.org/show_bug.cgi?id=631193 --- data/theme/gnome-shell.css | 6 +- js/ui/popupMenu.js | 193 ++++++++++++++++++++++++++++++++----- 2 files changed, 172 insertions(+), 27 deletions(-) diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css index 981b9743b..a08c69c12 100644 --- a/data/theme/gnome-shell.css +++ b/data/theme/gnome-shell.css @@ -126,6 +126,7 @@ StTooltip { .popup-menu-item { padding: .4em 1.25em; + spacing: 1em; } .popup-menu-item:active { @@ -133,11 +134,6 @@ StTooltip { } .popup-image-menu-item { - spacing: .75em; -} - -.popup-switch-menu-item { - spacing: 2em; } .popup-separator-menu-item { diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index 934d35446..3d1718b98 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -56,13 +56,18 @@ PopupBaseMenuItem.prototype = { params = Params.parse (params, { reactive: true, activate: true, hover: true }); - this.actor = new St.Bin({ style_class: 'popup-menu-item', - reactive: params.reactive, - track_hover: params.reactive, - x_fill: true, - y_fill: true, - x_align: St.Align.START }); + this.actor = new Shell.GenericContainer({ style_class: 'popup-menu-item', + reactive: params.reactive, + track_hover: params.reactive }); + this.actor.connect('get-preferred-width', Lang.bind(this, this._getPreferredWidth)); + this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight)); + this.actor.connect('allocate', Lang.bind(this, this._allocate)); + this.actor.connect('style-changed', Lang.bind(this, this._onStyleChanged)); this.actor._delegate = this; + + this._children = []; + this._columnWidths = null; + this._spacing = 0; this.active = false; if (params.reactive && params.activate) { @@ -74,6 +79,12 @@ PopupBaseMenuItem.prototype = { this.actor.connect('notify::hover', Lang.bind(this, this._hoverChanged)); }, + _onStyleChanged: function (actor) { + let themeNode = actor.get_theme_node(); + let [found, spacing] = themeNode.get_length('spacing', false); + this._spacing = found ? spacing : 0; + }, + _hoverChanged: function (actor) { this.setActive(actor.hover); }, @@ -107,6 +118,114 @@ PopupBaseMenuItem.prototype = { // true if non descendant content includes @actor contains: function(actor) { return false; + }, + + // adds an actor to the menu item; @column defaults to the next + // open column, @span defaults to 1. If @span is -1, the actor + // will span the width of the menu item. Children are not + // allowed to overlap each other. + addActor: function(child, column, span) { + if (column == null) { + if (this._children.length) { + let lastChild = this._children[this._children.length - 1]; + column = lastChild.column + lastChild.span; + } else + column = 0; + span = 1; + } else if (span == null) + span = 1; + + this._children.push({ actor: child, + column: column, + span: span }); + this.actor.connect('destroy', Lang.bind(this, function () { this.removeActor(child); })); + this.actor.add_actor(child); + }, + + removeActor: function(child) { + for (let i = 0; i < this._children.length; i++) { + if (this._children[i].actor == child) { + this._children.splice(i, 1); + this.actor.remove_actor(child); + return; + } + } + }, + + getColumnWidths: function() { + let widths = []; + for (let i = 0, col = 0; i < this._children.length; i++) { + let child = this._children[i]; + let [min, natural] = child.actor.get_preferred_width(-1); + widths[col++] = natural; + if (child.span > 1) { + for (let j = 1; j < child.span; j++) + widths[col++] = 0; + } + } + return widths; + }, + + setColumnWidths: function(widths) { + this._columnWidths = widths; + }, + + _getPreferredWidth: function(actor, forHeight, alloc) { + let width = 0; + if (this._columnWidths) { + for (let i = 0; i < this._columnWidths.length; i++) { + if (i > 0) + width += this._spacing; + width += this._columnWidths[i]; + } + } else { + for (let i = 0; i < this._children.length; i++) { + let child = this._children[i]; + if (i > 0) + width += this._spacing; + let [min, natural] = child.actor.get_preferred_width(forHeight); + width += natural; + } + } + alloc.min_size = alloc.natural_size = width; + }, + + _getPreferredHeight: function(actor, forWidth, alloc) { + let height = 0; + for (let i = 0; i < this._children.length; i++) { + let child = this._children[i]; + let [min, natural] = child.actor.get_preferred_height(-1); + if (natural > height) + height = natural; + } + alloc.min_size = alloc.natural_size = height; + }, + + _allocate: function(actor, box, flags) { + let x = box.x1, height = box.y2 - box.y1; + for (let i = 0, col = 0; i < this._children.length; i++) { + let child = this._children[i]; + let childBox = new Clutter.ActorBox(); + childBox.x1 = x; + if (this._columnWidths) { + if (child.span == -1) + childBox.x2 = box.x2; + else { + childBox.x2 = x; + for (let j = 0; j < child.span; j++) + childBox.x2 += this._columnWidths[col++]; + } + } else { + let [min, natural] = child.actor.get_preferred_width(-1); + childBox.x2 = x + natural; + } + let [min, natural] = child.actor.get_preferred_height(-1); + childBox.y1 = Math.round(box.y1 + (height - natural) / 2); + childBox.y2 = childBox.y1 + natural; + child.actor.allocate(childBox, flags); + + x = childBox.x2 + this._spacing; + } } }; Signals.addSignalMethods(PopupBaseMenuItem.prototype); @@ -122,7 +241,7 @@ PopupMenuItem.prototype = { PopupBaseMenuItem.prototype._init.call(this); this.label = new St.Label({ text: text }); - this.actor.set_child(this.label); + this.addActor(this.label); } }; @@ -137,7 +256,7 @@ PopupSeparatorMenuItem.prototype = { PopupBaseMenuItem.prototype._init.call(this, { reactive: false }); this._drawingArea = new St.DrawingArea({ style_class: 'popup-separator-menu-item' }); - this.actor.set_child(this._drawingArea); + this.addActor(this._drawingArea, 0, -1); this._drawingArea.connect('repaint', Lang.bind(this, this._onRepaint)); }, @@ -180,7 +299,7 @@ PopupSliderMenuItem.prototype = { this._value = Math.max(Math.min(value, 1), 0); this._slider = new St.DrawingArea({ style_class: 'popup-slider-menu-item', reactive: true }); - this.actor.set_child(this._slider); + this.addActor(this._slider, 0, -1); this._slider.connect('repaint', Lang.bind(this, this._sliderRepaint)); this._slider.connect('button-press-event', Lang.bind(this, this._startDragging)); this._slider.connect('scroll-event', Lang.bind(this, this._onScrollEvent)); @@ -347,10 +466,8 @@ PopupSwitchMenuItem.prototype = { this.label = new St.Label({ text: text }); this._switch = new Switch(this.active); - this._box = new St.BoxLayout({ style_class: 'popup-switch-menu-item' }); - this._box.add(this.label, { expand: true, y_fill: false }); - this._box.add(this._switch.actor, { y_fill: false }); - this.actor.set_child(this._box); + this.addActor(this.label); + this.addActor(this._switch.actor); this.connect('activate', Lang.bind(this,function(from) { this.toggle(); @@ -384,12 +501,10 @@ PopupImageMenuItem.prototype = { this._size = 16; - let box = new St.BoxLayout({ style_class: 'popup-image-menu-item' }); - this.actor.set_child(box); this.label = new St.Label({ text: text }); - box.add(this.label, { expand: true }); + this.addActor(this.label); this._imageBin = new St.Bin({ width: this._size, height: this._size }); - box.add(this._imageBin, { y_fill: false }); + this.addActor(this._imageBin); this.setIcon(iconName); }, @@ -442,15 +557,51 @@ PopupMenu.prototype = { x_align: St.Align.START }); this.actor = this._boxPointer.actor; this.actor.style_class = 'popup-menu-boxpointer'; + this._boxWrapper = new Shell.GenericContainer(); + this._boxWrapper.connect('get-preferred-width', Lang.bind(this, this._boxGetPreferredWidth)); + this._boxWrapper.connect('get-preferred-height', Lang.bind(this, this._boxGetPreferredHeight)); + this._boxWrapper.connect('allocate', Lang.bind(this, this._boxAllocate)); + this._boxPointer.bin.set_child(this._boxWrapper); + this._box = new St.BoxLayout({ style_class: 'popup-menu-content', vertical: true }); - this._boxPointer.bin.set_child(this._box); + this._boxWrapper.add_actor(this._box); this.actor.add_style_class_name('popup-menu'); this.isOpen = false; this._activeMenuItem = null; }, + _boxGetPreferredWidth: function (actor, forHeight, alloc) { + // Update the menuitem column widths + let columnWidths = []; + let items = this._box.get_children(); + for (let i = 0; i < items.length; i++) { + if (items[i]._delegate instanceof PopupBaseMenuItem) { + let itemColumnWidths = items[i]._delegate.getColumnWidths(); + for (let j = 0; j < itemColumnWidths.length; j++) { + if (j >= columnWidths.length || itemColumnWidths[j] > columnWidths[j]) + columnWidths[j] = itemColumnWidths[j]; + } + } + } + for (let i = 0; i < items.length; i++) { + if (items[i]._delegate instanceof PopupBaseMenuItem) + items[i]._delegate.setColumnWidths(columnWidths); + } + + // Now they will request the right sizes + [alloc.min_size, alloc.natural_size] = this._box.get_preferred_width(forHeight); + }, + + _boxGetPreferredHeight: function (actor, forWidth, alloc) { + [alloc.min_size, alloc.natural_size] = this._box.get_preferred_height(forWidth); + }, + + _boxAllocate: function (actor, box, flags) { + this._box.allocate(box, flags); + }, + addAction: function(title, callback) { var menuItem = new PopupMenuItem(title); this.addMenuItem(menuItem); @@ -652,10 +803,8 @@ PopupSubMenuMenuItem.prototype = { this.actor.connect('enter-event', Lang.bind(this, this._mouseEnter)); this.label = new St.Label({ text: text }); - this._container = new St.BoxLayout(); - this._container.add(this.label, { fill: true, expand: true }); - this._container.add(new St.Label({ text: '>' })); - this.actor.set_child(this._container); + this.addActor(this.label); + this.addActor(new St.Label({ text: '>' })); this.menu = new PopupMenu(this.actor, St.Align.MIDDLE, St.Side.LEFT, 0, true); Main.chrome.addActor(this.menu.actor, { visibleInOverview: true, From 9d94da83d765b32fcd14f4b37813d833716dda27 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Wed, 20 Oct 2010 12:43:22 -0400 Subject: [PATCH 22/27] statusMenu: show a radio button-style dot next to the presence status Adding a "PopupMenuRadioButtonItem" wouldn't work well, because we'll need radio-button indicators on multiple different styles of menu item. Also, the current design draws the indicator in the menu item's padding, so it's sort of special anyway. So just add support at the BaseMenuItem level. Also, redo the menu/menuitem padding so that all the horizontal padding is in the menu item, or else the indicator dot will show up in the wrong spot. https://bugzilla.gnome.org/show_bug.cgi?id=631193 --- data/theme/gnome-shell.css | 4 ++-- js/ui/popupMenu.js | 48 +++++++++++++++++++++++++++++++++++++- js/ui/statusMenu.js | 7 ++++++ 3 files changed, 56 insertions(+), 3 deletions(-) diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css index a08c69c12..30e74fe93 100644 --- a/data/theme/gnome-shell.css +++ b/data/theme/gnome-shell.css @@ -121,11 +121,11 @@ StTooltip { * override .popup-menu.font-size, everything else will scale with it. */ .popup-menu-content { - padding: 1em .5em; + padding: 1em 0em; } .popup-menu-item { - padding: .4em 1.25em; + padding: .4em 1.75em; spacing: 1em; } diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index 3d1718b98..7ef3bbb8a 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -66,6 +66,7 @@ PopupBaseMenuItem.prototype = { this.actor._delegate = this; this._children = []; + this._dot = null; this._columnWidths = null; this._spacing = 0; this.active = false; @@ -152,6 +153,38 @@ PopupBaseMenuItem.prototype = { } }, + setShowDot: function(show) { + if (show) { + if (this._dot) + return; + + this._dot = new St.DrawingArea({ style_class: 'popup-menu-item-dot' }); + this._dot.connect('repaint', Lang.bind(this, this._onRepaintDot)); + this.actor.add_actor(this._dot); + } else { + if (!this._dot) + return; + + this._dot.destroy(); + this._dot = null; + } + }, + + _onRepaintDot: function(area) { + let cr = area.get_context(); + let [width, height] = area.get_surface_size(); + let color = new Clutter.Color(); + area.get_theme_node().get_foreground_color(color); + + cr.setSourceRGBA ( + color.red / 255, + color.green / 255, + color.blue / 255, + color.alpha / 255); + cr.arc(width / 2, height / 2, width / 3, 0, 2 * Math.PI); + cr.fill(); + }, + getColumnWidths: function() { let widths = []; for (let i = 0, col = 0; i < this._children.length; i++) { @@ -202,7 +235,20 @@ PopupBaseMenuItem.prototype = { }, _allocate: function(actor, box, flags) { - let x = box.x1, height = box.y2 - box.y1; + let height = box.y2 - box.y1; + + if (this._dot) { + let dotBox = new Clutter.ActorBox(); + let dotWidth = Math.round(box.x1 / 2); + + dotBox.x1 = Math.round(box.x1 / 4); + dotBox.x2 = dotBox.x1 + dotWidth; + dotBox.y1 = Math.round(box.y1 + (height - dotWidth) / 2); + dotBox.y2 = dotBox.y1 + dotWidth; + this._dot.allocate(dotBox, flags); + } + + let x = box.x1; for (let i = 0, col = 0; i < this._children.length; i++) { let child = this._children[i]; let childBox = new Clutter.ActorBox(); diff --git a/js/ui/statusMenu.js b/js/ui/statusMenu.js index 89eb4eb08..5d12567e4 100644 --- a/js/ui/statusMenu.js +++ b/js/ui/statusMenu.js @@ -35,6 +35,7 @@ StatusMenuButton.prototype = { this._user = this._gdm.get_user(GLib.get_user_name()); this._presence = new GnomeSession.Presence(); + this._presenceItems = {}; this.actor.connect('destroy', Lang.bind(this, this._onDestroy)); @@ -89,6 +90,9 @@ StatusMenuButton.prototype = { this._iconBox.child = this._invisibleIcon; else this._iconBox.child = this._idleIcon; + + for (let itemStatus in this._presenceItems) + this._presenceItems[itemStatus].setShowDot(itemStatus == status); }, _createSubMenu: function() { @@ -97,14 +101,17 @@ StatusMenuButton.prototype = { item = new PopupMenu.PopupImageMenuItem(_("Available"), 'user-available', true); item.connect('activate', Lang.bind(this, this._setPresenceStatus, GnomeSession.PresenceStatus.AVAILABLE)); this.menu.addMenuItem(item); + this._presenceItems[GnomeSession.PresenceStatus.AVAILABLE] = item; item = new PopupMenu.PopupImageMenuItem(_("Busy"), 'user-busy', true); item.connect('activate', Lang.bind(this, this._setPresenceStatus, GnomeSession.PresenceStatus.BUSY)); this.menu.addMenuItem(item); + this._presenceItems[GnomeSession.PresenceStatus.BUSY] = item; item = new PopupMenu.PopupImageMenuItem(_("Invisible"), 'user-invisible', true); item.connect('activate', Lang.bind(this, this._setPresenceStatus, GnomeSession.PresenceStatus.INVISIBLE)); this.menu.addMenuItem(item); + this._presenceItems[GnomeSession.PresenceStatus.INVISIBLE] = item; item = new PopupMenu.PopupSeparatorMenuItem(); this.menu.addMenuItem(item); From 2b3c31a5031382241885b86180b5988305279d5f Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Mon, 25 Oct 2010 11:50:00 -0400 Subject: [PATCH 23/27] boxpointer: keep a margin between the box and the screen edge per the mockups https://bugzilla.gnome.org/show_bug.cgi?id=631193 --- js/ui/boxpointer.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/js/ui/boxpointer.js b/js/ui/boxpointer.js index ff8775946..06977e8c1 100644 --- a/js/ui/boxpointer.js +++ b/js/ui/boxpointer.js @@ -258,8 +258,6 @@ BoxPointer.prototype = { }, setPosition: function(sourceActor, gap, alignment) { - let primary = global.get_primary_monitor(); - // We need to show it now to force an allocation, // so that we can query the correct size. this.actor.show(); @@ -270,6 +268,12 @@ BoxPointer.prototype = { let [minWidth, minHeight, natWidth, natHeight] = this.actor.get_preferred_size(); + // We also want to keep it onscreen, and separated from the + // edge by the same distance as the main part of the box is + // separated from its sourceActor + let primary = global.get_primary_monitor(); + let arrowRise = this.actor.get_theme_node().get_length('-arrow-rise'); + let resX, resY; switch (this._arrowSide) { @@ -304,7 +308,7 @@ BoxPointer.prototype = { break; } - resX = Math.min(resX, primary.x + primary.width - natWidth); + resX = Math.min(resX, primary.x + primary.width - natWidth - arrowRise - gap); resX = Math.max(resX, primary.x); this.setArrowOrigin((sourceX - resX) + Math.floor(sourceWidth / 2)); @@ -324,7 +328,7 @@ BoxPointer.prototype = { break; } - resY = Math.min(resY, primary.y + primary.height - natHeight); + resY = Math.min(resY, primary.y + primary.height - natHeight - arrowRise - gap); resY = Math.max(resY, primary.y); this.setArrowOrigin((sourceY - resY) + Math.floor(sourceHeight / 2)); From f8dc32c36607558b2a3d5560999b7da6d0ea4c7a Mon Sep 17 00:00:00 2001 From: Yaron Shahrabani Date: Tue, 26 Oct 2010 08:20:57 +0200 Subject: [PATCH 24/27] Updated Hebrew translation. --- po/he.po | 50 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/po/he.po b/po/he.po index f034f9145..b4662371f 100644 --- a/po/he.po +++ b/po/he.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: gnome-shell master\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-10-20 23:49+0200\n" -"PO-Revision-Date: 2010-10-20 23:50+0200\n" +"POT-Creation-Date: 2010-10-26 08:20+0200\n" +"PO-Revision-Date: 2010-10-26 08:20+0200\n" "Last-Translator: Yaron Shahrabani \n" "Language-Team: Hebrew \n" "MIME-Version: 1.0\n" @@ -567,7 +567,7 @@ msgstr "התחברות אל..." #. "ON" and "OFF") or "toggle-switch-intl" (for toggle #. switches containing "◯" and "|"). Other values will #. simply result in invisible toggle switches. -#: ../js/ui/popupMenu.js:31 +#: ../js/ui/popupMenu.js:33 msgid "toggle-switch-us" msgstr "toggle-switch-intl" @@ -580,39 +580,47 @@ msgstr "נא להזין פקודה:" msgid "Execution of '%s' failed:" msgstr "ההרצה של '%s' נכשלה:" -#: ../js/ui/statusMenu.js:97 +#: ../js/ui/statusMenu.js:101 msgid "Available" msgstr "זמין" -#: ../js/ui/statusMenu.js:101 +#: ../js/ui/statusMenu.js:106 msgid "Busy" msgstr "עסוק" -#: ../js/ui/statusMenu.js:105 +#: ../js/ui/statusMenu.js:111 msgid "Invisible" msgstr "בלתי נראה" -#: ../js/ui/statusMenu.js:112 -msgid "Account Information..." -msgstr "פרטי המשתמש..." - -#: ../js/ui/statusMenu.js:116 -msgid "System Settings..." -msgstr "הגדרות מערכת..." +#: ../js/ui/statusMenu.js:119 +msgid "My Account..." +msgstr "החשבון שלי..." #: ../js/ui/statusMenu.js:123 +msgid "System Preferences..." +msgstr "העדפות המערכת..." + +#: ../js/ui/statusMenu.js:130 msgid "Lock Screen" msgstr "נעילת המסך" -#: ../js/ui/statusMenu.js:127 +#: ../js/ui/statusMenu.js:134 msgid "Switch User" msgstr "החלפת משתמש" -#: ../js/ui/statusMenu.js:132 +#: ../js/ui/statusMenu.js:139 msgid "Log Out..." msgstr "ניתוק..." -#: ../js/ui/statusMenu.js:136 +#: ../js/ui/statusMenu.js:146 +msgid "Suspend" +msgstr "השהיה" + +#: ../js/ui/statusMenu.js:150 +msgid "Restart..." +msgstr "הפעלה מחדש..." + +#: ../js/ui/statusMenu.js:154 msgid "Shut Down..." msgstr "כיבוי..." @@ -670,12 +678,12 @@ msgstr "%s סיים את תהליך ההתחלה" msgid "'%s' is ready" msgstr "'%s' מוכן" -#: ../js/ui/workspacesView.js:230 +#: ../js/ui/workspacesView.js:229 msgid "" "Can't add a new workspace because maximum workspaces limit has been reached." msgstr "לא ניתן להוסיף מרחבי עבודה כיוון שהם ממלאים את המכסה המרבית." -#: ../js/ui/workspacesView.js:247 +#: ../js/ui/workspacesView.js:246 msgid "Can't remove the first workspace." msgstr "לא ניתן להסיר את מרחב העבודה הראשון." @@ -739,6 +747,12 @@ msgstr "חיפוש" msgid "%1$s: %2$s" msgstr "%1$s: %2$s" +#~ msgid "Account Information..." +#~ msgstr "פרטי המשתמש..." + +#~ msgid "System Settings..." +#~ msgstr "הגדרות מערכת..." + #~ msgid "ON" #~ msgstr "1" From 9ae12380382ef3f750ae0f1cd847880babf3a16d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Gonz=C3=A1lez?= Date: Tue, 26 Oct 2010 10:45:02 +0200 Subject: [PATCH 25/27] Updated Spanish translation --- po/es.po | 81 +++++++++++++++++++++++++++++++++----------------------- 1 file changed, 48 insertions(+), 33 deletions(-) diff --git a/po/es.po b/po/es.po index 30a2537c1..373bcf1fe 100644 --- a/po/es.po +++ b/po/es.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: gnome-shell.master\n" "Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-" "shell&component=general\n" -"POT-Creation-Date: 2010-10-18 08:59+0000\n" -"PO-Revision-Date: 2010-10-18 11:12+0200\n" +"POT-Creation-Date: 2010-10-25 21:45+0000\n" +"PO-Revision-Date: 2010-10-26 10:43+0200\n" "Last-Translator: Jorge González \n" "Language-Team: Español \n" "MIME-Version: 1.0\n" @@ -503,58 +503,58 @@ msgid "Undo" msgstr "Deshacer" #. TODO - _quit() doesn't really work on apps in state STARTING yet -#: ../js/ui/panel.js:468 +#: ../js/ui/panel.js:469 #, c-format msgid "Quit %s" msgstr "Salir de %s" -#: ../js/ui/panel.js:493 +#: ../js/ui/panel.js:494 msgid "Preferences" msgstr "Preferencias" #. Translators: This is the time format with date used #. in 24-hour mode. -#: ../js/ui/panel.js:579 +#: ../js/ui/panel.js:580 msgid "%a %b %e, %R:%S" msgstr "%a %e de %b, %R:%S" -#: ../js/ui/panel.js:580 +#: ../js/ui/panel.js:581 msgid "%a %b %e, %R" msgstr "%a %e de %b, %R" #. Translators: This is the time format without date used #. in 24-hour mode. -#: ../js/ui/panel.js:584 +#: ../js/ui/panel.js:585 msgid "%a %R:%S" msgstr "%a %R:%S" -#: ../js/ui/panel.js:585 +#: ../js/ui/panel.js:586 msgid "%a %R" msgstr "%a %R" #. Translators: This is a time format with date used #. for AM/PM. -#: ../js/ui/panel.js:592 +#: ../js/ui/panel.js:593 msgid "%a %b %e, %l:%M:%S %p" msgstr "%a %e de %b, %H:%M:%S" -#: ../js/ui/panel.js:593 +#: ../js/ui/panel.js:594 msgid "%a %b %e, %l:%M %p" msgstr "%a %e de %b, %H:%M" #. Translators: This is a time format without date used #. for AM/PM. -#: ../js/ui/panel.js:597 +#: ../js/ui/panel.js:598 msgid "%a %l:%M:%S %p" msgstr "%a %H:%M:%S" -#: ../js/ui/panel.js:598 +#: ../js/ui/panel.js:599 msgid "%a %l:%M %p" msgstr "%a %H:%M" #. Button on the left side of the panel. #. Translators: If there is no suitable word for "Activities" in your language, you can use the word for "Overview". -#: ../js/ui/panel.js:743 +#: ../js/ui/panel.js:744 msgid "Activities" msgstr "Actividades" @@ -589,39 +589,48 @@ msgstr "Introduzca un comando:" msgid "Execution of '%s' failed:" msgstr "Falló la ejecución de «%s»:" -#: ../js/ui/statusMenu.js:97 +#: ../js/ui/statusMenu.js:101 msgid "Available" msgstr "Disponible" -#: ../js/ui/statusMenu.js:101 +#: ../js/ui/statusMenu.js:106 msgid "Busy" msgstr "Ocupado" -#: ../js/ui/statusMenu.js:105 +#: ../js/ui/statusMenu.js:111 msgid "Invisible" msgstr "Invisible" -#: ../js/ui/statusMenu.js:112 -msgid "Account Information..." -msgstr "Información de la cuenta…" - -#: ../js/ui/statusMenu.js:116 -msgid "System Settings..." -msgstr "Ajustes del sistema…" +#: ../js/ui/statusMenu.js:119 +msgid "My Account..." +msgstr "Mi cuenta…" #: ../js/ui/statusMenu.js:123 +#| msgid "Preferences" +msgid "System Preferences..." +msgstr "Preferencias del sistema…" + +#: ../js/ui/statusMenu.js:130 msgid "Lock Screen" msgstr "Bloquear la pantalla" -#: ../js/ui/statusMenu.js:127 +#: ../js/ui/statusMenu.js:134 msgid "Switch User" msgstr "Cambiar de usuario" -#: ../js/ui/statusMenu.js:132 +#: ../js/ui/statusMenu.js:139 msgid "Log Out..." msgstr "Salir…" -#: ../js/ui/statusMenu.js:136 +#: ../js/ui/statusMenu.js:146 +msgid "Suspend" +msgstr "Suspender" + +#: ../js/ui/statusMenu.js:150 +msgid "Restart..." +msgstr "Reiniciar…" + +#: ../js/ui/statusMenu.js:154 msgid "Shut Down..." msgstr "Apagar…" @@ -679,43 +688,43 @@ msgstr "%s finalizó su lanzamiento" msgid "'%s' is ready" msgstr "«%s» está preparado" -#: ../js/ui/workspacesView.js:230 +#: ../js/ui/workspacesView.js:229 msgid "" "Can't add a new workspace because maximum workspaces limit has been reached." msgstr "" "No se puede añadir un área de trabajo nueva porque se ha llegado al límite " "de áreas de trabajo." -#: ../js/ui/workspacesView.js:247 +#: ../js/ui/workspacesView.js:246 msgid "Can't remove the first workspace." msgstr "No se puede quitar el primer área de trabajo." -#: ../src/shell-global.c:1196 +#: ../src/shell-global.c:1204 msgid "Less than a minute ago" msgstr "Hace menos de un minuto" -#: ../src/shell-global.c:1200 +#: ../src/shell-global.c:1208 #, c-format msgid "%d minute ago" msgid_plural "%d minutes ago" msgstr[0] "Hace %d minuto" msgstr[1] "Hace %d minutos" -#: ../src/shell-global.c:1205 +#: ../src/shell-global.c:1213 #, c-format msgid "%d hour ago" msgid_plural "%d hours ago" msgstr[0] "Hace %d hora" msgstr[1] "Hace %d horas" -#: ../src/shell-global.c:1210 +#: ../src/shell-global.c:1218 #, c-format msgid "%d day ago" msgid_plural "%d days ago" msgstr[0] "Hace %d día" msgstr[1] "Hace %d días" -#: ../src/shell-global.c:1215 +#: ../src/shell-global.c:1223 #, c-format msgid "%d week ago" msgid_plural "%d weeks ago" @@ -746,6 +755,12 @@ msgstr "Buscar" msgid "%1$s: %2$s" msgstr "%1$s: %2$s" +#~ msgid "Account Information..." +#~ msgstr "Información de la cuenta…" + +#~ msgid "System Settings..." +#~ msgstr "Ajustes del sistema…" + #~ msgid "ON" #~ msgstr "ENCENDIDO" From e5dd86276de93159dbaa6818df94c9ec38f3ecf4 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Wed, 13 Oct 2010 14:10:38 -0400 Subject: [PATCH 26/27] PopupSwitchMenuItem: don't misuse this.active The constructor was setting this.active to reflect the switch state, which is wrong; this.active indicates whether or not the item is highlighted. https://bugzilla.gnome.org/show_bug.cgi?id=621671 --- js/ui/popupMenu.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js index 7ef3bbb8a..23969a6a5 100644 --- a/js/ui/popupMenu.js +++ b/js/ui/popupMenu.js @@ -508,9 +508,8 @@ PopupSwitchMenuItem.prototype = { _init: function(text, active) { PopupBaseMenuItem.prototype._init.call(this); - this.active = !!active; this.label = new St.Label({ text: text }); - this._switch = new Switch(this.active); + this._switch = new Switch(active); this.addActor(this.label); this.addActor(this._switch.actor); From ec018a000e94c7f7cfe432f2e553e47c48079b26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=20Di=C3=A9guez?= Date: Tue, 26 Oct 2010 16:37:39 +0200 Subject: [PATCH 27/27] Updated Galician translations --- po/gl.po | 83 ++++++++++++++++++++++++++++++++++---------------------- 1 file changed, 51 insertions(+), 32 deletions(-) diff --git a/po/gl.po b/po/gl.po index ff85d858b..c1378201f 100644 --- a/po/gl.po +++ b/po/gl.po @@ -10,8 +10,8 @@ msgid "" msgstr "" "Project-Id-Version: gnome-shell master\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-10-25 00:55+0200\n" -"PO-Revision-Date: 2010-10-25 01:02+0200\n" +"POT-Creation-Date: 2010-10-26 16:28+0200\n" +"PO-Revision-Date: 2010-10-26 16:36+0200\n" "Last-Translator: Fran Diéguez \n" "Language-Team: Galician \n" "Language: gl\n" @@ -43,7 +43,7 @@ msgid "" "dialog." msgstr "" "Permite o acceso ás ferramentas de depuración e monitorización internas " -"usando o diálogo Alt-F2" +"usando o diálogo Alt-F2." #: ../data/org.gnome.shell.gschema.xml.in.h:2 msgid "Custom format of the clock" @@ -84,7 +84,7 @@ msgid "" "If true and format is either \"12-hour\" or \"24-hour\", display date in the " "clock, in addition to time." msgstr "" -"Se é verdadeiro e o formato é \"12-hour\" ou \"24-hour\" móstrase a data no " +"Se é verdadeiro e o formato é «12-hour» ou «24-hour» móstrase a data no " "reloxo, ademais da hora." #: ../data/org.gnome.shell.gschema.xml.in.h:10 @@ -92,8 +92,8 @@ msgid "" "If true and format is either \"12-hour\" or \"24-hour\", display seconds in " "time." msgstr "" -"Se é verdadeiro e o formato é \"12-hour\" ou \"24-hour\" móstranse os " -"segundos na hora." +"Se é verdadeiro e o formato é «12-hour» ou «24-hour» móstranse os segundos " +"na hora." #: ../data/org.gnome.shell.gschema.xml.in.h:11 msgid "If true, display the ISO week date in the calendar." @@ -118,10 +118,15 @@ msgid "" "to an empty value, the default pipeline will be used. This is currently " "'videorate ! theoraenc ! oggmux' and records to Ogg Theora." msgstr "" -"Estabelece a tubería do GStreamer usada para codificar as gravacións. Segue " -"a sintaxe usada por gst-launch. A tubería debe ter un desprazamento de " -"sumideiro non conectado cando o vídeo gravado estea gravado. Normalmente " -"terá un ......." +"Estabelece a tubería GStreamer usada para codificar gravacións. Segue a " +"sintaxe usada para gst-launch. A tubería debería ter un sumideiro («sink») " +"de ensamblaxe/desensamblaxe onde o vídeo que se está gravando grávase. " +"Xeralmente terá unha orixe de ensamblado/desensamblado; a saída dese punto " +"escribirase no ficheiro de saída. Porén, a tubería tamén pode tomar parte na " +"súa propia saída; isto pódese usar para enviar a saída a un servidor " +"«icecast» a través de shout2send ou similar. Cando non está estabelecido ou " +"está a un valor baleiro, usarase a tubería predeterminada. Actualmente é " +"«videorate ! theoraenc ! oggmux» e grava en Ogg Theora." #: ../data/org.gnome.shell.gschema.xml.in.h:15 msgid "Show date in clock" @@ -207,12 +212,12 @@ msgid "" "the show_date and show_seconds keys are ignored." msgstr "" "Esta chave especifica o formato de hora usado polo reloxo do panel. Os " -"posíbeis valores son \"12-hour\", \"24-hour\", \"unix\"e \"custom\". Se está " -"estabelecido a \"unix\", o reloxo mostrará a hora en segundos desde Epoch, p." -"ex. 01-01-1970. Se está estabelecido a \"custom\", o reloxo mostrará a hora " +"posíbeis valores son «12-hour», «24-hour», «unix» e «custom». Se está " +"estabelecido a «unix», o reloxo mostrará a hora en segundos desde Epoch, p." +"ex. 01-01-1970. Se está estabelecido a «custom», o reloxo mostrará a hora " "segundo o formato especificado na chave custom_format. Teña en conta que se " -"está estabelecido a \"unix\" ou \"custom\", as chaves show_date e " -"show_seconds ignoraranse." +"está estabelecido a «unix» ou «custom», as chaves show_date e show_seconds " +"ignoraranse." #: ../data/org.gnome.shell.gschema.xml.in.h:26 msgid "Uuids of extensions to disable" @@ -220,7 +225,7 @@ msgstr "Os Uuid das extensións a desactivar" #: ../data/org.gnome.shell.gschema.xml.in.h:27 msgid "Whether to collect stats about applications usage" -msgstr "Indica se recoller estatísticas sobre o uso dos aplicativos ou non." +msgstr "Indica se recoller estatísticas sobre o uso dos aplicativos" #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:1 msgid "Clip the crosshairs at the center" @@ -288,7 +293,7 @@ msgid "" "sprite." msgstr "" "Activa/desactiva a visualización do punto de mira centrada no mapa de bits " -"de magnificación do rato" +"de magnificación do rato." #: ../data/org.gnome.accessibility.magnifier.gschema.xml.in.h:9 msgid "" @@ -456,7 +461,7 @@ msgstr "Non hai resultados que coincidan." #. network locations, etc. #: ../js/ui/dash.js:797 ../js/ui/placeDisplay.js:554 msgid "PLACES & DEVICES" -msgstr "LUGARES e DISPOSITIVOS" +msgstr "LUGARES E DISPOSITIVOS" #. **** Documents **** #: ../js/ui/dash.js:804 ../js/ui/docDisplay.js:494 @@ -580,41 +585,49 @@ msgstr "Insira unha orde:" #: ../js/ui/runDialog.js:378 #, c-format msgid "Execution of '%s' failed:" -msgstr "Produciuse un fallo na execución de %s" +msgstr "Produciuse un fallo na execución de «%s»:" -#: ../js/ui/statusMenu.js:97 +#: ../js/ui/statusMenu.js:101 msgid "Available" msgstr "Dispoñíbel" -#: ../js/ui/statusMenu.js:101 +#: ../js/ui/statusMenu.js:106 msgid "Busy" msgstr "Ocupado" -#: ../js/ui/statusMenu.js:105 +#: ../js/ui/statusMenu.js:111 msgid "Invisible" msgstr "Invisíbel" -#: ../js/ui/statusMenu.js:112 -msgid "Account Information..." -msgstr "Información da conta..." - -#: ../js/ui/statusMenu.js:116 -msgid "System Settings..." -msgstr "Configuracións do sistema..." +#: ../js/ui/statusMenu.js:119 +msgid "My Account..." +msgstr "A miña conta..." #: ../js/ui/statusMenu.js:123 +msgid "System Preferences..." +msgstr "Preferencias do sistema..." + +#: ../js/ui/statusMenu.js:130 msgid "Lock Screen" msgstr "Bloquear pantalla" -#: ../js/ui/statusMenu.js:127 +#: ../js/ui/statusMenu.js:134 msgid "Switch User" msgstr "Cambiar de usuario" -#: ../js/ui/statusMenu.js:132 +#: ../js/ui/statusMenu.js:139 msgid "Log Out..." msgstr "Saír da sesión..." -#: ../js/ui/statusMenu.js:136 +#: ../js/ui/statusMenu.js:146 +msgid "Suspend" +msgstr "Suspender" + +#: ../js/ui/statusMenu.js:150 +msgid "Restart..." +msgstr "Reiniciar..." + +#: ../js/ui/statusMenu.js:154 msgid "Shut Down..." msgstr "Apagar..." @@ -739,6 +752,12 @@ msgstr "Buscar" msgid "%1$s: %2$s" msgstr "%1$s: %2$s" +#~ msgid "Account Information..." +#~ msgstr "Información da conta..." + +#~ msgid "System Settings..." +#~ msgstr "Configuracións do sistema..." + #~ msgid "ON" #~ msgstr "⚫"