nog icon indicating copy to clipboard operation
nog copied to clipboard

Moving a window to a different workspace no longer auto focuses the new workspace

Open keepitsane opened this issue 3 years ago • 3 comments

Version (which release did you use?) Pinning

Describe the bug Using the in_move_to_ws(ws_id) used to also change the current active workspace to the provided ws_id. Now if I have a window on workspace 1 open on monitor 1 and move it to workspace 2 that is open on monitor 2, the window doesn't display on workspace 2 until I manually change my focus to it.

I can actually see both the current functionality and old functionality, both useful so maybe it can be introduced as an option? But regardless I think that when a window gets moved to a workspace that workspace should be refreshed to update the windows.

keepitsane avatar Jun 21 '21 15:06 keepitsane

I believe this was changed during the lua switch partially related to #263

You can get the old behavior if you do something like this since it's kinda a combination of ws_change and win_move_to_ws:

nog.nbind("alt+shift+1", function ()
    nog.win_move_to_ws(1)
    nog.ws_change(1)
end)

ramirezmike avatar Jun 22 '21 01:06 ramirezmike

Thanks that works perfectly. Here is the function I made so that you don't need to add a keybind for each workspace manually.

local workspaces = {1, 2, 3, 4, 5, 6, 7, 8, 9}

nog.nbind_tbl("alt+shift", function (id)
    nog.win_move_to_ws(id)
    nog.ws_change(id)
end, workspaces)

keepitsane avatar Jun 22 '21 12:06 keepitsane

I guess one issue that I think may still exist in the current implementation is the multi monitor support. When I move a window to a workspace that is open on a separate monitor even if that workspace isn't focused the moved window doesn't display until I manually focus. I feel it should still refresh the grid even if it doesn't follow the window.

keepitsane avatar Jun 22 '21 13:06 keepitsane