diff --git a/sources/keybinds.js b/sources/keybinds.js index 0880f43..32fe503 100644 --- a/sources/keybinds.js +++ b/sources/keybinds.js @@ -53,8 +53,10 @@ var KeyboardManager = GObject.registerClass( const state = this._state.monitors[mon]; const idx = this._state.workIndexByHandle(state.focused); const newW = this._state.workIndex(mon, state.tags, idx + 1); - if (newW && newW.handle !== state.focused) + if (newW && newW.handle !== state.focused) { this._state.focus(newW.handle); + this._renderer.render(mon); + } }); this._addBinding("cycle-next", () => this._focusNext()); @@ -200,7 +202,10 @@ var KeyboardManager = GObject.registerClass( const state = this._state.monitors[mon]; const idx = this._state.workIndexByHandle(state.focused); const win = this._state.workIndex(mon, state.tags, idx - 1); - if (win && win.handle !== state.focused) this._state.focus(win.handle); + if (win && win.handle !== state.focused) { + this._state.focus(win.handle); + this._renderer.render(mon); + } } } ); diff --git a/sources/state.js b/sources/state.js index c8a4ec5..2b3a534 100644 --- a/sources/state.js +++ b/sources/state.js @@ -108,20 +108,16 @@ var StateManager = GObject.registerClass( * @param {Meta.Window} handle */ focus(handle) { - GLib.idle_add(GLib.PRIORITY_DEFAULT_IDLE, () => { - const mon = handle.get_monitor(); - this.monitors[mon].focused = handle; - // This was focused without a zoom, removing the old zoom value. - this.monitors[mon].beforeZoom = null; + const mon = handle.get_monitor(); + this.monitors[mon].focused = handle; + // This was focused without a zoom, removing the old zoom value. + this.monitors[mon].beforeZoom = null; - log("focusing window with title", handle.get_title()); - handle.raise(); - handle.focus(global.display.get_current_time()); - handle.activate(global.display.get_current_time()); - this.warpCursor(handle); - // Do not retrigger this idle. - return false; - }); + log("focusing window with title", handle.get_title()); + handle.raise(); + handle.focus(global.display.get_current_time()); + handle.activate(global.display.get_current_time()); + this.warpCursor(handle); } /** @@ -185,7 +181,7 @@ var StateManager = GObject.registerClass( return [ { ...focused, - handle: focused.hanlde, + handle: focused.handle, maximized: true, minimized: false, x: 0,