diff options
author | Thomas Letan <lthms@soap.coffee> | 2022-08-21 22:07:12 +0200 |
---|---|---|
committer | Thomas Letan <lthms@soap.coffee> | 2022-08-21 22:07:12 +0200 |
commit | f6f36070ec76bc780d68d6019f7ee334f662c88f (patch) | |
tree | 8aaea2603d45fc58adbda226a69cbcef56f380be | |
parent | Do not assume the magic string is read from the socket in one go (diff) |
Ignore floating containers
-rw-r--r-- | bin/spatial/main.ml | 15 | ||||
-rw-r--r-- | bin/spatial/state.ml | 4 |
2 files changed, 14 insertions, 5 deletions
diff --git a/bin/spatial/main.ml b/bin/spatial/main.ml index da99f2b..dfec612 100644 --- a/bin/spatial/main.ml +++ b/bin/spatial/main.ml @@ -27,9 +27,18 @@ let window_handle (ev : Event.window_event) state = | Event.Focus | Event.Title | Event.Fullscreen_mode | Event.Move | Event.Mark | Event.Urgent -> Lwt.return (state, false) - | Event.Floating -> - (* TODO: disable spatial-sway for the concerned workspace *) - Lwt.return (state, false) + | Event.Floating -> ( + match ev.container.node_type with + | Con -> + let state = + State.register_window false 2 state.State.current_workspace state + ev.container + in + Lwt.return (state, true) + | Floating_con -> + let state = State.unregister_window state ev.container.id in + Lwt.return (state, true) + | _ -> Lwt.return (state, false)) let event_handle ev state = let open Lwt.Syntax in diff --git a/bin/spatial/state.ml b/bin/spatial/state.ml index d967d16..7cfb96b 100644 --- a/bin/spatial/state.ml +++ b/bin/spatial/state.ml @@ -96,8 +96,8 @@ let arrange_current_workspace state = let register_window default_full_view default_maximum_visible workspace state (tree : Node.t) = - match tree.app_id with - | Some app_id -> + match (tree.node_type, tree.app_id) with + | Con, Some app_id -> insert_window default_full_view default_maximum_visible workspace tree.id app_id state | _ -> state |