summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar taiyu <taiyu.len@gmail.com>2015-08-21 10:45:18 -0700
committerLibravatar taiyu <taiyu.len@gmail.com>2015-08-21 10:45:18 -0700
commitd2e1c660b19e8bb24e496b3dd52d4696456863f0 (patch)
treea1cc9658c3558dca9476449e44f300ce4ded3329
parentcheck floating mod for resizing windows, and dont send click (diff)
downloadsway-d2e1c660b19e8bb24e496b3dd52d4696456863f0.tar.gz
sway-d2e1c660b19e8bb24e496b3dd52d4696456863f0.tar.zst
sway-d2e1c660b19e8bb24e496b3dd52d4696456863f0.zip
swayc_is_fullscreen
-rw-r--r--sway/commands.c2
-rw-r--r--sway/handlers.c4
-rw-r--r--sway/layout.c6
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) {
684 } 684 }
685 685
686 swayc_t *container = get_focused_view(&root_container); 686 swayc_t *container = get_focused_view(&root_container);
687 bool current = (wlc_view_get_state(container->handle) & WLC_BIT_FULLSCREEN) > 0; 687 bool current = swayc_is_fullscreen(container);
688 wlc_view_set_state(container->handle, WLC_BIT_FULLSCREEN, !current); 688 wlc_view_set_state(container->handle, WLC_BIT_FULLSCREEN, !current);
689 // Resize workspace if going from fullscreen -> notfullscreen 689 // Resize workspace if going from fullscreen -> notfullscreen
690 // otherwise just resize container 690 // 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
568 if (config->focus_follows_mouse && prev_handle != handle) { 568 if (config->focus_follows_mouse && prev_handle != handle) {
569 // Dont change focus if fullscreen 569 // Dont change focus if fullscreen
570 swayc_t *focused = get_focused_view(view); 570 swayc_t *focused = get_focused_view(view);
571 if (!(focused->type == C_VIEW && wlc_view_get_state(focused->handle) & WLC_BIT_FULLSCREEN) 571 if (!swayc_is_fullscreen(focused)
572 && !(pointer_state.l_held || pointer_state.r_held)) { 572 && !(pointer_state.l_held || pointer_state.r_held)) {
573 set_focused_container(container_under_pointer()); 573 set_focused_container(container_under_pointer());
574 } 574 }
@@ -600,7 +600,7 @@ static bool handle_pointer_button(wlc_handle view, uint32_t time, const struct w
600 uint32_t button, enum wlc_button_state state, const struct wlc_origin *origin) { 600 uint32_t button, enum wlc_button_state state, const struct wlc_origin *origin) {
601 swayc_t *focused = get_focused_container(&root_container); 601 swayc_t *focused = get_focused_container(&root_container);
602 // dont change focus if fullscreen 602 // dont change focus if fullscreen
603 if (focused->type == C_VIEW && wlc_view_get_state(focused->handle) & WLC_BIT_FULLSCREEN) { 603 if (swayc_is_fullscreen(focused)) {
604 return false; 604 return false;
605 } 605 }
606 if (state == WLC_BUTTON_STATE_PRESSED) { 606 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) {
204 .h = height - container->gaps 204 .h = height - container->gaps
205 } 205 }
206 }; 206 };
207 if (wlc_view_get_state(container->handle) & WLC_BIT_FULLSCREEN) { 207 if (swayc_is_fullscreen(container)) {
208 swayc_t *parent = swayc_parent_by_type(container, C_OUTPUT); 208 swayc_t *parent = swayc_parent_by_type(container, C_OUTPUT);
209 geometry.origin.x = 0; 209 geometry.origin.x = 0;
210 geometry.origin.y = 0; 210 geometry.origin.y = 0;
@@ -303,7 +303,7 @@ void arrange_windows(swayc_t *container, double width, double height) {
303 .h = view->height 303 .h = view->height
304 } 304 }
305 }; 305 };
306 if (wlc_view_get_state(view->handle) & WLC_BIT_FULLSCREEN) { 306 if (swayc_is_fullscreen(view)) {
307 swayc_t *parent = swayc_parent_by_type(view, C_OUTPUT); 307 swayc_t *parent = swayc_parent_by_type(view, C_OUTPUT);
308 geometry.origin.x = 0; 308 geometry.origin.x = 0;
309 geometry.origin.y = 0; 309 geometry.origin.y = 0;
@@ -318,7 +318,7 @@ void arrange_windows(swayc_t *container, double width, double height) {
318 // have higher indexes 318 // have higher indexes
319 // This is conditional on there not being a fullscreen view in the workspace 319 // This is conditional on there not being a fullscreen view in the workspace
320 if (!container->focused 320 if (!container->focused
321 || !(wlc_view_get_state(container->focused->handle) & WLC_BIT_FULLSCREEN)) { 321 || !swayc_is_fullscreen(container->focused)) {
322 wlc_view_bring_to_front(view->handle); 322 wlc_view_bring_to_front(view->handle);
323 } 323 }
324 } 324 }