Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,11 @@ class CinnamonBarApplet extends Applet.Applet {
}

expo() {
if (!Main.expo.animationInProgress)
Main.expo.toggle();
Main.expo.toggle();
}

scale() {
if (!Main.overview.animationInProgress)
Main.overview.toggle();
Main.overview.toggle();
}

}
Expand Down
3 changes: 1 addition & 2 deletions files/usr/share/cinnamon/applets/expo@cinnamon.org/applet.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ class CinnamonExpoApplet extends Applet.IconApplet {
}

doAction() {
if (!Main.expo.animationInProgress)
Main.expo.toggle();
Main.expo.toggle();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ class CinnamonScaleApplet extends Applet.IconApplet {
}

doAction() {
if (!Main.overview.animationInProgress)
Main.overview.toggle();
Main.overview.toggle();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,7 @@ class CinnamonWorkspaceSwitcher extends Applet.Applet {

let expoMenuItem = new PopupMenu.PopupIconMenuItem(_("Manage workspaces (Expo)"), "xsi-view-grid-symbolic", St.IconType.SYMBOLIC);
expoMenuItem.connect('activate', Lang.bind(this, function() {
if (!Main.expo.animationInProgress)
Main.expo.toggle();
Main.expo.toggle();
}));
this._applet_context_menu.addMenuItem(expoMenuItem);

Expand Down
19 changes: 12 additions & 7 deletions js/misc/signalTracker.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
/* exported addObjectSignalMethods */
const GObject = imports.gi.GObject;
const Clutter = imports.gi.Clutter;

/**
* @private
* @param {Object} obj - an object
* @returns {bool} - true if obj has a 'destroy' GObject signal
* @returns {bool} - true if obj's 'destroy' signal indicates its own lifecycle
* end (i.e. obj is a Clutter.Actor or subclass).
*
* Some classes (e.g. Cinnamon.WM) declare a 'destroy' signal with
* domain-specific semantics unrelated to the emitter's own lifetime, so we
* only treat the signal as lifecycle for Clutter actors.
*/
function _hasDestroySignal(obj) {
return obj instanceof GObject.Object &&
GObject.signal_lookup('destroy', obj);
function _hasLifecycleDestroy(obj) {
return obj instanceof Clutter.Actor;
}

var TransientSignalHolder = GObject.registerClass(
Expand All @@ -20,7 +25,7 @@ class TransientSignalHolder extends GObject.Object {
constructor(owner) {
super();

if (_hasDestroySignal(owner))
if (_hasLifecycleDestroy(owner))
owner.connectObject('destroy', () => this.destroy(), this);
}

Expand Down Expand Up @@ -84,7 +89,7 @@ class SignalTracker {
* @param {Object=} owner - object that owns the tracker
*/
constructor(owner) {
if (_hasDestroySignal(owner))
if (_hasLifecycleDestroy(owner))
this._ownerDestroyId = owner.connect_after('destroy', () => this.clear());

this._owner = owner;
Expand Down Expand Up @@ -152,7 +157,7 @@ class SignalTracker {
* @returns {void}
*/
track(obj, ...handlerIds) {
if (_hasDestroySignal(obj))
if (_hasLifecycleDestroy(obj))
this._trackDestroy(obj);

this._getSignalData(obj).ownerSignals.push(...handlerIds);
Expand Down
6 changes: 2 additions & 4 deletions js/ui/cinnamonDBus.js
Original file line number Diff line number Diff line change
Expand Up @@ -429,13 +429,11 @@ var CinnamonDBus = class {
}

ShowExpo() {
if (!Main.expo.animationInProgress)
Main.expo.toggle();
Main.expo.toggle();
}

ShowOverview() {
if (!Main.overview.animationInProgress)
Main.overview.toggle();
Main.overview.toggle();
}

PushSubprocessResult(process_id, result, success) {
Expand Down
15 changes: 15 additions & 0 deletions js/ui/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,21 @@ function init() {
_easeActorProperty(this, 'value', target, params);
};

// Cinnamon.get_event_state() is typed against the ClutterEvent union,
// which GJS delivers to signal callbacks. Vfunc overrides instead get
// a boxed subtype struct (ClutterButtonEvent, ClutterKeyEvent, etc.)
// that GJS refuses to marshal into the union — so wrap the call and
// fall back to masking event.modifier_state directly in that case.
const _origGetEventState = Cinnamon.get_event_state;
const _modMask = Clutter.ModifierType.MODIFIER_MASK
& ~Clutter.ModifierType.MOD2_MASK
& ~Clutter.ModifierType.LOCK_MASK;
Cinnamon.get_event_state = function (event) {
if (event instanceof Clutter.Event)
return _origGetEventState(event);
return event.modifier_state & _modMask;
};

// Work around https://bugzilla.mozilla.org/show_bug.cgi?id=508783
Date.prototype.toLocaleFormat = function(format) {
return Cinnamon.util_format_date(format, this.getTime());
Expand Down
Loading
Loading