fix multi-monitor
1. in removeArea, remove area container from the right parent and do not
remove and destroy helper since helper is child of container (15556e40f4)
2. do not set area and helper position to monitor position value, since their position is relative to the container (that already have the monitor position)
This commit is contained in:
parent
15556e40f4
commit
9e6b58d3da
4
draw.js
4
draw.js
|
|
@ -856,8 +856,8 @@ var DrawingHelper = new Lang.Class({
|
|||
else
|
||||
this.vscrollbar_policy = Gtk.PolicyType.NEVER;
|
||||
this.set_height(Math.min(this.height, maxHeight));
|
||||
this.set_position(this.monitor.x + Math.floor(this.monitor.width / 2 - this.width / 2),
|
||||
this.monitor.y + Math.floor(this.monitor.height / 2 - this.height / 2));
|
||||
this.set_position(Math.floor(this.monitor.width / 2 - this.width / 2),
|
||||
Math.floor(this.monitor.height / 2 - this.height / 2));
|
||||
|
||||
Tweener.removeTweens(this);
|
||||
Tweener.addTween(this, { opacity: 255,
|
||||
|
|
|
|||
|
|
@ -103,7 +103,6 @@ var AreaManager = new Lang.Class({
|
|||
Main.uiGroup.insert_child_above(container, global.window_group);
|
||||
container.set_position(monitor.x, monitor.y);
|
||||
container.set_size(monitor.width, monitor.height);
|
||||
area.set_position(monitor.x, monitor.y);
|
||||
area.set_size(monitor.width, monitor.height);
|
||||
area.emitter.stopDrawingHandler = area.emitter.connect('stop-drawing', this.toggleDrawing.bind(this));
|
||||
area.emitter.showOsdHandler = area.emitter.connect('show-osd', this.showOsd.bind(this));
|
||||
|
|
@ -275,13 +274,12 @@ var AreaManager = new Lang.Class({
|
|||
removeAreas: function() {
|
||||
for (let i = 0; i < this.areas.length; i++) {
|
||||
let area = this.areas[i];
|
||||
Main.uiGroup.remove_actor(area.helper);
|
||||
Main.uiGroup.remove_actor(area.get_parent());
|
||||
let container = area.get_parent();
|
||||
container.get_parent().remove_actor(container);
|
||||
area.emitter.disconnect(area.emitter.stopDrawingHandler);
|
||||
area.emitter.disconnect(area.emitter.showOsdHandler);
|
||||
area.disable();
|
||||
area.helper.destroy();
|
||||
area.get_parent().destroy();
|
||||
container.destroy();
|
||||
}
|
||||
this.areas = [];
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue