mirror of
https://github.com/zoriya/fairy.git
synced 2026-06-03 11:05:31 +00:00
Fix cycle next/prev in monocle
This commit is contained in:
+7
-2
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
+10
-14
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user