aboutsummaryrefslogtreecommitdiffstats
path: root/sway/handlers.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/handlers.c')
-rw-r--r--sway/handlers.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/sway/handlers.c b/sway/handlers.c
index 4980f65c..ec2b123e 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -106,6 +106,12 @@ static void handle_output_destroyed(wlc_handle output) {
106 if (i < list->length) { 106 if (i < list->length) {
107 destroy_output(list->items[i]); 107 destroy_output(list->items[i]);
108 } 108 }
109 if (list->length == 0) {
110 active_workspace = NULL;
111 } else {
112 //switch to other outputs active workspace
113 workspace_switch(((swayc_t *)root_container.children->items[0])->focused);
114 }
109} 115}
110 116
111static void handle_output_resolution_change(wlc_handle output, const struct wlc_size *from, const struct wlc_size *to) { 117static void handle_output_resolution_change(wlc_handle output, const struct wlc_size *from, const struct wlc_size *to) {
@@ -320,6 +326,9 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct
320 mouse_origin = *origin; 326 mouse_origin = *origin;
321 bool changed_floating = false; 327 bool changed_floating = false;
322 int i = 0; 328 int i = 0;
329 if (!active_workspace) {
330 return false;
331 }
323 // Do checks to determine if proper keys are being held 332 // Do checks to determine if proper keys are being held
324 swayc_t *view = active_workspace->focused; 333 swayc_t *view = active_workspace->focused;
325 if (m1_held && view) { 334 if (m1_held && view) {
@@ -400,7 +409,11 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct
400 } 409 }
401 } 410 }
402 if (config->focus_follows_mouse && prev_handle != handle) { 411 if (config->focus_follows_mouse && prev_handle != handle) {
403 set_focused_container(container_under_pointer()); 412 //Dont change focus if fullscreen
413 swayc_t *focused = get_focused_view(view);
414 if (!(focused->type == C_VIEW && wlc_view_get_state(focused->handle) & WLC_BIT_FULLSCREEN)) {
415 set_focused_container(container_under_pointer());
416 }
404 } 417 }
405 prev_handle = handle; 418 prev_handle = handle;
406 prev_pos = mouse_origin; 419 prev_pos = mouse_origin;
@@ -414,6 +427,10 @@ static bool handle_pointer_motion(wlc_handle handle, uint32_t time, const struct
414static bool handle_pointer_button(wlc_handle view, uint32_t time, const struct wlc_modifiers *modifiers, 427static bool handle_pointer_button(wlc_handle view, uint32_t time, const struct wlc_modifiers *modifiers,
415 uint32_t button, enum wlc_button_state state) { 428 uint32_t button, enum wlc_button_state state) {
416 swayc_t *focused = get_focused_container(&root_container); 429 swayc_t *focused = get_focused_container(&root_container);
430 //dont change focus if fullscreen
431 if (focused->type == C_VIEW && wlc_view_get_state(focused->handle) & WLC_BIT_FULLSCREEN) {
432 return false;
433 }
417 if (state == WLC_BUTTON_STATE_PRESSED) { 434 if (state == WLC_BUTTON_STATE_PRESSED) {
418 sway_log(L_DEBUG, "Mouse button %u pressed", button); 435 sway_log(L_DEBUG, "Mouse button %u pressed", button);
419 if (button == 272) { 436 if (button == 272) {