In inactive state, drawing area was over other ui widgets and
prevented drag-and-drop. Now we put the drawing area above windows and
below overviewGroup.
This commit is contained in:
abakkk 2019-03-10 13:05:38 +01:00
parent 39301d9367
commit 15556e40f4
1 changed files with 20 additions and 7 deletions

View File

@ -95,14 +95,14 @@ var AreaManager = new Lang.Class({
for (let i = 0; i < this.monitors.length; i++) { for (let i = 0; i < this.monitors.length; i++) {
let monitor = this.monitors[i]; let monitor = this.monitors[i];
let container = new St.Widget({ name: 'drawOnYourSreenContainer' + i });
let helper = new Draw.DrawingHelper({ name: 'drawOnYourSreenHelper' + i }, monitor); let helper = new Draw.DrawingHelper({ name: 'drawOnYourSreenHelper' + i }, monitor);
let bgContainer = new St.Bin({ name: 'drawOnYourSreenContainer' + i });
let area = new Draw.DrawingArea({ name: 'drawOnYourSreenArea' + i }, monitor, helper); let area = new Draw.DrawingArea({ name: 'drawOnYourSreenArea' + i }, monitor, helper);
bgContainer.set_child(area); container.add_child(area);
Main.uiGroup.add_actor(bgContainer); container.add_child(helper);
Main.uiGroup.add_actor(helper); Main.uiGroup.insert_child_above(container, global.window_group);
bgContainer.set_position(monitor.x, monitor.y); container.set_position(monitor.x, monitor.y);
bgContainer.set_size(monitor.width, monitor.height); container.set_size(monitor.width, monitor.height);
area.set_position(monitor.x, monitor.y); area.set_position(monitor.x, monitor.y);
area.set_size(monitor.width, monitor.height); area.set_size(monitor.width, monitor.height);
area.emitter.stopDrawingHandler = area.emitter.connect('stop-drawing', this.toggleDrawing.bind(this)); area.emitter.stopDrawingHandler = area.emitter.connect('stop-drawing', this.toggleDrawing.bind(this));
@ -216,23 +216,34 @@ var AreaManager = new Lang.Class({
toggleDrawing: function() { toggleDrawing: function() {
if (this.activeArea) { if (this.activeArea) {
let activeIndex = this.areas.indexOf(this.activeArea);
let activeContainer = this.activeArea.get_parent();
if (this.hiddenList) if (this.hiddenList)
this.togglePanelAndDockOpacity(); this.togglePanelAndDockOpacity();
Main.popModal(this.activeArea); Main.popModal(this.activeArea);
let activeIndex = this.areas.indexOf(this.activeArea);
this.removeInternalKeybindings(); this.removeInternalKeybindings();
this.activeArea.reactive = false; this.activeArea.reactive = false;
this.activeArea.leaveDrawingMode(); this.activeArea.leaveDrawingMode();
this.activeArea = null; this.activeArea = null;
Main.uiGroup.set_child_above_sibling(activeContainer, global.window_group);
// check display or screen (API changes) // check display or screen (API changes)
if (global.display.set_cursor) if (global.display.set_cursor)
global.display.set_cursor(Meta.Cursor.DEFAULT); global.display.set_cursor(Meta.Cursor.DEFAULT);
else if (global.screen && global.screen.set_cursor) else if (global.screen && global.screen.set_cursor)
global.screen.set_cursor(Meta.Cursor.DEFAULT); global.screen.set_cursor(Meta.Cursor.DEFAULT);
Main.osdWindowManager.show(activeIndex, this.leaveGicon, _("Leaving drawing mode"), null); Main.osdWindowManager.show(activeIndex, this.leaveGicon, _("Leaving drawing mode"), null);
} else { } else {
// avoid to deal with Meta changes (global.display/global.screen) // avoid to deal with Meta changes (global.display/global.screen)
let currentIndex = Main.layoutManager.monitors.indexOf(Main.layoutManager.currentMonitor); let currentIndex = Main.layoutManager.monitors.indexOf(Main.layoutManager.currentMonitor);
let activeContainer = this.areas[currentIndex].get_parent();
Main.uiGroup.set_child_above_sibling(activeContainer, null);
// 256 is a custom Shell.ActionMode // 256 is a custom Shell.ActionMode
if (!Main.pushModal(this.areas[currentIndex], { actionMode: 256 | 1 })) if (!Main.pushModal(this.areas[currentIndex], { actionMode: 256 | 1 }))
return; return;
@ -240,11 +251,13 @@ var AreaManager = new Lang.Class({
this.addInternalKeybindings(); this.addInternalKeybindings();
this.activeArea.reactive = true; this.activeArea.reactive = true;
this.activeArea.enterDrawingMode(); this.activeArea.enterDrawingMode();
// check display or screen (API changes) // check display or screen (API changes)
if (global.display.set_cursor) if (global.display.set_cursor)
global.display.set_cursor(Meta.Cursor.POINTING_HAND); global.display.set_cursor(Meta.Cursor.POINTING_HAND);
else if (global.screen && global.screen.set_cursor) else if (global.screen && global.screen.set_cursor)
global.screen.set_cursor(Meta.Cursor.POINTING_HAND); global.screen.set_cursor(Meta.Cursor.POINTING_HAND);
// increase OSD display time // increase OSD display time
let hideTimeoutSave = OsdWindow.HIDE_TIMEOUT; let hideTimeoutSave = OsdWindow.HIDE_TIMEOUT;
OsdWindow.HIDE_TIMEOUT = 2000; OsdWindow.HIDE_TIMEOUT = 2000;