[gnome-shell] shellDBus: Emit a PropertyChanged for OverviewActive
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] shellDBus: Emit a PropertyChanged for OverviewActive
- Date: Thu, 13 Nov 2014 18:18:09 +0000 (UTC)
commit 891f30ff6386f40796b8033180b8311c5bd8c935
Author: Colin Walters <walters verbum org>
Date: Sat Jul 13 14:58:36 2013 -0400
shellDBus: Emit a PropertyChanged for OverviewActive
I was going to add another DBus property to signal when the shell was
done loading and was idle, and while implementing that I noticed we
aren't emitting PropertyChanged for, well, any property. Let's fix
OverviewActive.
It's unfortunate it's so tedious to correctly implement a DBus
property =/
https://bugzilla.gnome.org/show_bug.cgi?id=704163
js/ui/shellDBus.js | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/shellDBus.js b/js/ui/shellDBus.js
index 4ef03c1..45a2054 100644
--- a/js/ui/shellDBus.js
+++ b/js/ui/shellDBus.js
@@ -90,6 +90,12 @@ const GnomeShell = new Lang.Class({
function(display, action, deviceid, timestamp) {
this._emitAcceleratorActivated(action, deviceid, timestamp);
}));
+
+ this._cachedOverviewVisible = false;
+ Main.overview.connect('showing',
+ Lang.bind(this, this._checkOverviewVisibleChanged));
+ Main.overview.connect('hidden',
+ Lang.bind(this, this._checkOverviewVisibleChanged));
},
/**
@@ -235,8 +241,15 @@ const GnomeShell = new Lang.Class({
Mode: global.session_mode,
+ _checkOverviewVisibleChanged: function() {
+ if (Main.overview.visible !== this._cachedOverviewVisible) {
+ this._cachedOverviewVisible = Main.overview.visible;
+ this._dbusImpl.emit_property_changed('OverviewActive', new GLib.Variant('b',
this._cachedOverviewVisible));
+ }
+ },
+
get OverviewActive() {
- return Main.overview.visible;
+ return this._cachedOverviewVisible;
},
set OverviewActive(visible) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]