overview: Try to do the right thing related to XDnD

Rather than expose a dizzying array of methods related to managing
state that require infecting every user of the overview methods, try
to do the sensible and smart thing internally. Now, the overview
itself tracks when XDND drags start, and simply calling show, hide or
toggle while an XDnD drag is in effect will show the overview, and
will only take the grab until after the XDND drag ends.

https://bugzilla.gnome.org/show_bug.cgi?id=663661
This commit is contained in:
Jasper St. Pierre
2013-03-04 17:02:02 -05:00
parent 7be1fe09f1
commit 36a7429aa0
3 changed files with 34 additions and 67 deletions

View File

@ -661,7 +661,7 @@ const ActivitiesButton = new Lang.Class({
if (this._xdndTimeOut != 0)
Mainloop.source_remove(this._xdndTimeOut);
this._xdndTimeOut = Mainloop.timeout_add(BUTTON_DND_ACTIVATION_TIMEOUT,
Lang.bind(this, this._xdndShowOverview, actor));
Lang.bind(this, this._xdndToggleOverview, actor));
return DND.DragMotionResult.CONTINUE;
},
@ -685,15 +685,12 @@ const ActivitiesButton = new Lang.Class({
}
},
_xdndShowOverview: function(actor) {
_xdndToggleOverview: function(actor) {
let [x, y, mask] = global.get_pointer();
let pickedActor = global.stage.get_actor_at_pos(Clutter.PickMode.REACTIVE, x, y);
if (pickedActor == this.actor) {
if (!Main.overview.visible && !Main.overview.animationInProgress) {
Main.overview.showTemporarily();
}
}
if (pickedActor == this.actor && Main.overview.shouldToggleByCornerOrButton())
Main.overview.toggle();
Mainloop.source_remove(this._xdndTimeOut);
this._xdndTimeOut = 0;