mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
Check input_mode to see whether window switcher is active or not
...rather than "if (server->osd_state.cycle_view){..}".
This commit is contained in:
parent
398b80b26f
commit
5d3ce3e190
6 changed files with 17 additions and 14 deletions
|
|
@ -29,7 +29,8 @@ foreign_request_fullscreen(struct foreign_toplevel *toplevel, bool fullscreen)
|
|||
void
|
||||
foreign_request_activate(struct foreign_toplevel *toplevel)
|
||||
{
|
||||
if (toplevel->view->server->osd_state.cycle_view) {
|
||||
if (toplevel->view->server->input_mode
|
||||
== LAB_INPUT_STATE_WINDOW_SWITCHER) {
|
||||
wlr_log(WLR_INFO, "Preventing focus request while in window switcher");
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -614,7 +614,8 @@ cursor_process_motion(struct server *server, uint32_t time, double *sx, double *
|
|||
}
|
||||
|
||||
if ((ctx.view || ctx.surface) && rc.focus_follow_mouse
|
||||
&& !server->osd_state.cycle_view) {
|
||||
&& server->input_mode
|
||||
!= LAB_INPUT_STATE_WINDOW_SWITCHER) {
|
||||
desktop_focus_view_or_surface(seat, ctx.view, ctx.surface,
|
||||
rc.raise_on_focus);
|
||||
}
|
||||
|
|
@ -655,7 +656,8 @@ _cursor_update_focus(struct server *server)
|
|||
|
||||
if ((ctx.view || ctx.surface) && rc.focus_follow_mouse
|
||||
&& !rc.focus_follow_mouse_requires_movement
|
||||
&& !server->osd_state.cycle_view) {
|
||||
&& server->input_mode
|
||||
!= LAB_INPUT_STATE_WINDOW_SWITCHER) {
|
||||
/* Prevents changing keyboard focus during A-Tab */
|
||||
desktop_focus_view_or_surface(&server->seat, ctx.view,
|
||||
ctx.surface, rc.raise_on_focus);
|
||||
|
|
@ -901,7 +903,7 @@ static void
|
|||
handle_release_mousebinding(struct server *server,
|
||||
struct cursor_context *ctx, uint32_t button)
|
||||
{
|
||||
if (server->osd_state.cycle_view) {
|
||||
if (server->input_mode == LAB_INPUT_STATE_WINDOW_SWITCHER) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -968,7 +970,7 @@ static bool
|
|||
handle_press_mousebinding(struct server *server, struct cursor_context *ctx,
|
||||
uint32_t button)
|
||||
{
|
||||
if (server->osd_state.cycle_view) {
|
||||
if (server->input_mode == LAB_INPUT_STATE_WINDOW_SWITCHER) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -133,10 +133,12 @@ keyboard_modifiers_notify(struct wl_listener *listener, void *data)
|
|||
overlay_update(seat);
|
||||
}
|
||||
|
||||
if (server->osd_state.cycle_view
|
||||
|| seat->workspace_osd_shown_by_modifier) {
|
||||
bool window_switcher_active = server->input_mode
|
||||
== LAB_INPUT_STATE_WINDOW_SWITCHER;
|
||||
|
||||
if (window_switcher_active || seat->workspace_osd_shown_by_modifier) {
|
||||
if (!keyboard_any_modifiers_pressed(wlr_keyboard)) {
|
||||
if (server->osd_state.cycle_view) {
|
||||
if (window_switcher_active) {
|
||||
if (key_state_nr_bound_keys()) {
|
||||
should_cancel_cycling_on_next_key_release = true;
|
||||
} else {
|
||||
|
|
@ -570,9 +572,7 @@ handle_compositor_keybindings(struct keyboard *keyboard,
|
|||
key_state_store_pressed_key_as_bound(event->keycode);
|
||||
handle_menu_keys(server, &keyinfo.translated);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (server->osd_state.cycle_view) {
|
||||
} else if (server->input_mode == LAB_INPUT_STATE_WINDOW_SWITCHER) {
|
||||
key_state_store_pressed_key_as_bound(event->keycode);
|
||||
handle_cycle_view_key(server, &keyinfo);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ osd_on_view_destroy(struct view *view)
|
|||
assert(view);
|
||||
struct osd_state *osd_state = &view->server->osd_state;
|
||||
|
||||
if (!osd_state->cycle_view) {
|
||||
if (view->server->input_mode != LAB_INPUT_STATE_WINDOW_SWITCHER) {
|
||||
/* OSD not active, no need for clean up */
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -874,7 +874,7 @@ xdg_activation_handle_request(struct wl_listener *listener, void *data)
|
|||
return;
|
||||
}
|
||||
|
||||
if (view->server->osd_state.cycle_view) {
|
||||
if (view->server->input_mode == LAB_INPUT_STATE_WINDOW_SWITCHER) {
|
||||
wlr_log(WLR_INFO, "Preventing focus request while in window switcher");
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -402,7 +402,7 @@ handle_request_activate(struct wl_listener *listener, void *data)
|
|||
return;
|
||||
}
|
||||
|
||||
if (view->server->osd_state.cycle_view) {
|
||||
if (view->server->input_mode == LAB_INPUT_STATE_WINDOW_SWITCHER) {
|
||||
wlr_log(WLR_INFO, "Preventing focus request while in window switcher");
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue