From d2e1c660b19e8bb24e496b3dd52d4696456863f0 Mon Sep 17 00:00:00 2001 From: taiyu Date: Fri, 21 Aug 2015 10:45:18 -0700 Subject: [PATCH] swayc_is_fullscreen --- sway/commands.c | 2 +- sway/handlers.c | 4 ++-- sway/layout.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sway/commands.c b/sway/commands.c index e485cdb5..efaa7472 100644 --- a/sway/commands.c +++ b/sway/commands.c @@ -684,7 +684,7 @@ static bool cmd_fullscreen(struct sway_config *config, int argc, char **argv) { } swayc_t *container = get_focused_view(&root_container); - bool current = (wlc_view_get_state(container->handle) & WLC_BIT_FULLSCREEN) > 0; + bool current = swayc_is_fullscreen(container); wlc_view_set_state(container->handle, WLC_BIT_FULLSCREEN, !current); // Resize workspace if going from fullscreen -> notfullscreen // otherwise just resize container diff --git a/sway/handlers.c b/sway/handlers.c index 3dda3e43..98809958 100644 --- a/sway/handlers.c +++ b/sway/handlers.c @@ -568,7 +568,7 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct if (config->focus_follows_mouse && prev_handle != handle) { // Dont change focus if fullscreen swayc_t *focused = get_focused_view(view); - if (!(focused->type == C_VIEW && wlc_view_get_state(focused->handle) & WLC_BIT_FULLSCREEN) + if (!swayc_is_fullscreen(focused) && !(pointer_state.l_held || pointer_state.r_held)) { set_focused_container(container_under_pointer()); } @@ -600,7 +600,7 @@ static bool handle_pointer_button(wlc_handle view, uint32_t time, const struct w uint32_t button, enum wlc_button_state state, const struct wlc_origin *origin) { swayc_t *focused = get_focused_container(&root_container); // dont change focus if fullscreen - if (focused->type == C_VIEW && wlc_view_get_state(focused->handle) & WLC_BIT_FULLSCREEN) { + if (swayc_is_fullscreen(focused)) { return false; } if (state == WLC_BUTTON_STATE_PRESSED) { diff --git a/sway/layout.c b/sway/layout.c index 446ad066..70d9eb21 100644 --- a/sway/layout.c +++ b/sway/layout.c @@ -204,7 +204,7 @@ void arrange_windows(swayc_t *container, double width, double height) { .h = height - container->gaps } }; - if (wlc_view_get_state(container->handle) & WLC_BIT_FULLSCREEN) { + if (swayc_is_fullscreen(container)) { swayc_t *parent = swayc_parent_by_type(container, C_OUTPUT); geometry.origin.x = 0; geometry.origin.y = 0; @@ -303,7 +303,7 @@ void arrange_windows(swayc_t *container, double width, double height) { .h = view->height } }; - if (wlc_view_get_state(view->handle) & WLC_BIT_FULLSCREEN) { + if (swayc_is_fullscreen(view)) { swayc_t *parent = swayc_parent_by_type(view, C_OUTPUT); geometry.origin.x = 0; geometry.origin.y = 0; @@ -318,7 +318,7 @@ void arrange_windows(swayc_t *container, double width, double height) { // have higher indexes // This is conditional on there not being a fullscreen view in the workspace if (!container->focused - || !(wlc_view_get_state(container->focused->handle) & WLC_BIT_FULLSCREEN)) { + || !swayc_is_fullscreen(container->focused)) { wlc_view_bring_to_front(view->handle); } }