TimUntersberger / nog

A tiling window manager for Windows
MIT License
697 stars 20 forks source link

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

Open keepitsane opened 3 years ago

keepitsane commented 3 years ago

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.

ramirezmike commented 3 years ago

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)
keepitsane commented 3 years ago

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 commented 3 years ago

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.