keyboard: Filter redundant FocusTracker::position-changed signals
Just emit the signal if it did actually change.
This commit is contained in:
parent
b2fabd9356
commit
7ea034c719
@ -492,6 +492,7 @@ var FocusTracker = new Lang.Class({
|
|||||||
|
|
||||||
_init() {
|
_init() {
|
||||||
this._currentWindow = null;
|
this._currentWindow = null;
|
||||||
|
this._rect = null;
|
||||||
|
|
||||||
global.display.connect('notify::focus-window', () => {
|
global.display.connect('notify::focus-window', () => {
|
||||||
this._setCurrentWindow(global.display.focus_window);
|
this._setCurrentWindow(global.display.focus_window);
|
||||||
@ -535,6 +536,13 @@ var FocusTracker = new Lang.Class({
|
|||||||
rect.y -= frameRect.y;
|
rect.y -= frameRect.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this._rect &&
|
||||||
|
this._rect.x == rect.x &&
|
||||||
|
this._rect.y == rect.y &&
|
||||||
|
this._rect.width == rect.width &&
|
||||||
|
this._rect.height == rect.height)
|
||||||
|
return;
|
||||||
|
|
||||||
this._rect = rect;
|
this._rect = rect;
|
||||||
this.emit('position-changed');
|
this.emit('position-changed');
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user