Overview: use a normal chrome actor to handle events during XDND

Instead of using the input mode, when the overview is not modal
it should use a Chrome-tracked actor, that is added to the input
region. Because the overview always takes pointer input when
visible, the actor is added at startup, and it is shown and hidden
as needed.

https://bugzilla.gnome.org/show_bug.cgi?id=700735
This commit is contained in:
Giovanni Campagna 2013-05-22 18:05:24 +02:00
parent a259016436
commit f0113c5ff5
2 changed files with 22 additions and 28 deletions

View File

@ -189,11 +189,13 @@ const LayoutManager = new Lang.Class({
this.uiGroup.add_actor(global.window_group);
global.stage.remove_actor(global.overlay_group);
this.overviewGroup = new St.Widget({ name: 'overviewGroup' });
this.uiGroup.add_actor(this.overviewGroup);
global.stage.add_child(this.uiGroup);
this.overviewGroup = new St.Widget({ name: 'overviewGroup',
visible: false });
this.addChrome(this.overviewGroup);
this.screenShieldGroup = new St.Widget({ name: 'screenShieldGroup',
visible: false,
clip_to_allocation: true,
@ -244,24 +246,24 @@ const LayoutManager = new Lang.Class({
this._monitorsChanged();
},
// This is called by Main after everything else is constructed;
// it needs access to Main.overview, which didn't exist
// yet when the LayoutManager was constructed.
// This is called by Main after everything else is constructed
init: function() {
Main.overview.connect('showing', Lang.bind(this, this._overviewShowing));
Main.overview.connect('hidden', Lang.bind(this, this._overviewHidden));
Main.sessionMode.connect('updated', Lang.bind(this, this._sessionUpdated));
this._prepareStartupAnimation();
},
_overviewShowing: function() {
showOverview: function() {
this.overviewGroup.show();
this._inOverview = true;
this._updateVisibility();
this._queueUpdateRegions();
},
_overviewHidden: function() {
hideOverview: function() {
this.overviewGroup.hide();
this._inOverview = false;
this._updateVisibility();
this._queueUpdateRegions();

View File

@ -133,7 +133,6 @@ const Overview = new Lang.Class({
this._backgroundGroup = new Meta.BackgroundGroup();
Main.layoutManager.overviewGroup.add_child(this._backgroundGroup);
this._backgroundGroup.hide();
this._bgManagers = [];
this._activationTime = 0;
@ -152,7 +151,6 @@ const Overview = new Lang.Class({
this._overview.add_actor(this._coverPane);
this._coverPane.connect('event', Lang.bind(this, function (actor, event) { return true; }));
this._stack.hide();
this._stack.add_actor(this._overview);
Main.layoutManager.overviewGroup.add_child(this._stack);
@ -464,16 +462,17 @@ const Overview = new Lang.Class({
// show:
//
// Animates the overview visible and grabs mouse and keyboard input
show : function() {
show: function() {
if (this.isDummy)
return;
if (this._shown)
return;
this._shown = true;
if (!this._syncInputMode())
if (!this._syncGrab())
return;
Main.layoutManager.showOverview();
this._animateVisible();
},
@ -523,8 +522,6 @@ const Overview = new Lang.Class({
//
// Disable unredirection while in the overview
Meta.disable_unredirect_for_screen(global.screen);
this._stack.show();
this._backgroundGroup.show();
this._viewSelector.show();
this._stack.opacity = 0;
@ -565,7 +562,7 @@ const Overview = new Lang.Class({
this._animateNotVisible();
this._shown = false;
this._syncInputMode();
this._syncGrab();
},
toggle: function() {
@ -596,8 +593,8 @@ const Overview = new Lang.Class({
//// Private methods ////
_syncInputMode: function() {
// We delay input mode changes during animation so that when removing the
_syncGrab: function() {
// We delay grab changes during animation so that when removing the
// overview we don't have a problem with the release of a press/release
// going to an application.
if (this.animationInProgress)
@ -615,16 +612,12 @@ const Overview = new Lang.Class({
return false;
}
}
} else {
global.stage_input_mode = Shell.StageInputMode.FULLSCREEN;
}
} else {
if (this._modal) {
Main.popModal(this._overview);
this._modal = false;
}
else if (global.stage_input_mode == Shell.StageInputMode.FULLSCREEN)
global.stage_input_mode = Shell.StageInputMode.NORMAL;
}
return true;
},
@ -663,7 +656,7 @@ const Overview = new Lang.Class({
if (!this._shown)
this._animateNotVisible();
this._syncInputMode();
this._syncGrab();
global.sync_pointer();
},
@ -673,20 +666,19 @@ const Overview = new Lang.Class({
this._viewSelector.hide();
this._desktopFade.hide();
this._backgroundGroup.hide();
this._stack.hide();
this._coverPane.hide();
this.visible = false;
this.animationInProgress = false;
this._coverPane.hide();
this.emit('hidden');
// Handle any calls to show* while we were hiding
if (this._shown)
this._animateVisible();
else
Main.layoutManager.hideOverview();
this._syncInputMode();
this._syncGrab();
// Fake a pointer event if requested
if (this._needsFakePointerEvent) {