From 47d0c48ab510df25274ce55872aabe3e759f98f2 Mon Sep 17 00:00:00 2001 From: ShootingStarDragons Date: Tue, 23 Jan 2024 11:21:36 +0800 Subject: [PATCH] chore: remove unused code --- include/sway/input/text_input.h | 1 - sway/input/text_input.c | 13 ------------- 2 files changed, 14 deletions(-) diff --git a/include/sway/input/text_input.h b/include/sway/input/text_input.h index fe9cf9724..14b453741 100644 --- a/include/sway/input/text_input.h +++ b/include/sway/input/text_input.h @@ -42,7 +42,6 @@ struct sway_input_popup { struct wlr_input_popup_surface_v2 *popup_surface; int x, y; - bool visible; struct wl_list link; diff --git a/sway/input/text_input.c b/sway/input/text_input.c index 817ac34d0..a0315f5b1 100644 --- a/sway/input/text_input.c +++ b/sway/input/text_input.c @@ -351,16 +351,6 @@ static void input_popup_update(struct sway_input_popup *popup) { popup->x = x; popup->y = y; - // Hide popup if cursor position is completely out of bounds - bool x1_in_bounds = (cursor.x >= 0 && cursor.x < parent.width); - bool y1_in_bounds = (cursor.y >= 0 && cursor.y < parent.height); - bool x2_in_bounds = (cursor.x + cursor.width >= 0 - && cursor.x + cursor.width < parent.width); - bool y2_in_bounds = (cursor.y + cursor.height >= 0 - && cursor.y + cursor.height < parent.height); - popup->visible = - (x1_in_bounds && y1_in_bounds) || (x2_in_bounds && y2_in_bounds); - if (cursor_rect) { struct wlr_box box = { .x = x1 - x, @@ -395,8 +385,6 @@ static void input_popup_set_focus(struct sway_input_popup *popup, struct sway_view *view = view_from_wlr_surface(surface); wl_signal_add(&view->events.unmap, &popup->focused_surface_unmap); - - // Since the focus has changed, the popup may have to adjust } static void handle_im_popup_destroy(struct wl_listener *listener, void *data) { @@ -424,7 +412,6 @@ static void handle_im_focused_surface_unmap( struct wl_listener *listener, void *data) { struct sway_input_popup *popup = wl_container_of(listener, popup, focused_surface_unmap); - //input_popup_send_outputs(popup, surface_send_leave_iterator); input_popup_update(popup); }