From 82bc36c6812b24fca27c2ec176e2c2998e4df6d5 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 6 Aug 2015 08:24:14 -0400 Subject: Start to build out window management functions --- sway/handlers.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 sway/handlers.c (limited to 'sway/handlers.c') diff --git a/sway/handlers.c b/sway/handlers.c new file mode 100644 index 00000000..d6d30b71 --- /dev/null +++ b/sway/handlers.c @@ -0,0 +1,32 @@ +#include +#include +#include +#include "layout.h" +#include "handlers.h" + +bool handle_output_created(wlc_handle output) { + return true; +} + +void handle_output_destroyed(wlc_handle output) { +} + +void handle_output_resolution_change(wlc_handle output, const struct wlc_size *from, const struct wlc_size *to) { +} + +bool handle_view_created(wlc_handle view) { + printf("View created, focusing"); + wlc_view_focus(view); + wlc_view_bring_to_front(view); + return true; +} + +void handle_view_destroyed(wlc_handle view) { + printf("View destroyed"); + wlc_view_focus(get_topmost(wlc_view_get_output(view), 0)); + return true; +} + +void handle_view_focus(wlc_handle view, bool focus) { + wlc_view_set_state(view, WLC_BIT_ACTIVATED, focus); +} -- cgit v1.2.3