mirror of
https://github.com/gosticks/PaperWM.git
synced 2026-02-27 03:02:44 +00:00
grab: pass the correct focus window to navigator
When ending a grab we want to have full control over what space and window gains focus. So simply pass the window through navigator.finish in addition to the space.
This commit is contained in:
parent
d1e594e6cf
commit
7bc192a6d4
2
grab.js
2
grab.js
@ -461,7 +461,7 @@ var MoveGrab = class MoveGrab {
|
||||
// metaWindow.change_workspace(space.workspace)
|
||||
// space.workspace.activate(global.get_current_time());
|
||||
Tiling.inGrab = false;
|
||||
Navigator.getNavigator().finish(destSpace);
|
||||
Navigator.getNavigator().finish(destSpace, metaWindow);
|
||||
global.display.set_cursor(Meta.Cursor.DEFAULT);
|
||||
}
|
||||
|
||||
|
||||
13
navigator.js
13
navigator.js
@ -235,14 +235,14 @@ var Navigator = class Navigator {
|
||||
this.was_accepted = true;
|
||||
}
|
||||
|
||||
finish(space) {
|
||||
finish(space, focus) {
|
||||
if (grab)
|
||||
return;
|
||||
this.accept();
|
||||
this.destroy(space);
|
||||
this.destroy(space, focus);
|
||||
}
|
||||
|
||||
destroy(space) {
|
||||
destroy(space, focus) {
|
||||
this.minimaps.forEach(m => {
|
||||
if (typeof(m) === 'number')
|
||||
Mainloop.source_remove(m);
|
||||
@ -308,8 +308,11 @@ var Navigator = class Navigator {
|
||||
selected = this.space.indexOf(selected) !== -1 ? selected :
|
||||
this.space.selectedWindow;
|
||||
|
||||
let focus = display.focus_window;
|
||||
if (focus && focus.is_on_all_workspaces())
|
||||
let curFocus = display.focus_window;
|
||||
if (force && curFocus && curFocus.is_on_all_workspaces())
|
||||
selected = curFocus;
|
||||
|
||||
if (focus)
|
||||
selected = focus;
|
||||
|
||||
if (selected && !Tiling.inGrab) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user