swayc_is_fullscreen
This commit is contained in:
parent
dde8bfe728
commit
d2e1c660b1
|
@ -684,7 +684,7 @@ static bool cmd_fullscreen(struct sway_config *config, int argc, char **argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
swayc_t *container = get_focused_view(&root_container);
|
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);
|
wlc_view_set_state(container->handle, WLC_BIT_FULLSCREEN, !current);
|
||||||
// Resize workspace if going from fullscreen -> notfullscreen
|
// Resize workspace if going from fullscreen -> notfullscreen
|
||||||
// otherwise just resize container
|
// otherwise just resize container
|
||||||
|
|
|
@ -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) {
|
if (config->focus_follows_mouse && prev_handle != handle) {
|
||||||
// Dont change focus if fullscreen
|
// Dont change focus if fullscreen
|
||||||
swayc_t *focused = get_focused_view(view);
|
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)) {
|
&& !(pointer_state.l_held || pointer_state.r_held)) {
|
||||||
set_focused_container(container_under_pointer());
|
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) {
|
uint32_t button, enum wlc_button_state state, const struct wlc_origin *origin) {
|
||||||
swayc_t *focused = get_focused_container(&root_container);
|
swayc_t *focused = get_focused_container(&root_container);
|
||||||
// dont change focus if fullscreen
|
// 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;
|
return false;
|
||||||
}
|
}
|
||||||
if (state == WLC_BUTTON_STATE_PRESSED) {
|
if (state == WLC_BUTTON_STATE_PRESSED) {
|
||||||
|
|
|
@ -204,7 +204,7 @@ void arrange_windows(swayc_t *container, double width, double height) {
|
||||||
.h = height - container->gaps
|
.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);
|
swayc_t *parent = swayc_parent_by_type(container, C_OUTPUT);
|
||||||
geometry.origin.x = 0;
|
geometry.origin.x = 0;
|
||||||
geometry.origin.y = 0;
|
geometry.origin.y = 0;
|
||||||
|
@ -303,7 +303,7 @@ void arrange_windows(swayc_t *container, double width, double height) {
|
||||||
.h = view->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);
|
swayc_t *parent = swayc_parent_by_type(view, C_OUTPUT);
|
||||||
geometry.origin.x = 0;
|
geometry.origin.x = 0;
|
||||||
geometry.origin.y = 0;
|
geometry.origin.y = 0;
|
||||||
|
@ -318,7 +318,7 @@ void arrange_windows(swayc_t *container, double width, double height) {
|
||||||
// have higher indexes
|
// have higher indexes
|
||||||
// This is conditional on there not being a fullscreen view in the workspace
|
// This is conditional on there not being a fullscreen view in the workspace
|
||||||
if (!container->focused
|
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);
|
wlc_view_bring_to_front(view->handle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue