appDisplay: Add event blocker inhibition API

The event blocker is an actor that is added in between the
icon grid and the app folder popup in order to guarantee
that clicking outside the app folder will collapse it.

However, the next patch will require allowing dragging events
to be passed to folder icons, and the event blocker gets in
our way here, preventing drag n' drop to work properly.

Add an API to inhibit the event blocker. This API will be
used by the app folders while an item is dragged.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/603
This commit is contained in:
Georges Basile Stavracas Neto 2019-06-28 19:44:20 -03:00
parent 038917e5f1
commit 23191ec239
No known key found for this signature in database
GPG Key ID: 886C17EE170D1385

View File

@ -338,6 +338,8 @@ var AllView = class AllView extends BaseAppView {
this._folderSettings.connect('changed::folder-children', () => {
Main.queueDeferredWork(this._redisplayWorkId);
});
this._nEventBlockerInhibits = 0;
}
_itemNameChanged(item) {
@ -672,6 +674,16 @@ var AllView = class AllView extends BaseAppView {
for (let i = 0; i < this.folderIcons.length; i++)
this.folderIcons[i].adaptToSize(availWidth, availHeight);
}
inhibitEventBlocker() {
this._nEventBlockerInhibits++;
this._eventBlocker.visible = this._nEventBlockerInhibits == 0;
}
uninhibitEventBlocker() {
this._nEventBlockerInhibits--;
this._eventBlocker.visible = this._nEventBlockerInhibits == 0;
}
};
Signals.addSignalMethods(AllView.prototype);