Skip to content

Commit

Permalink
remove useless: focused_surface_unmap
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed May 24, 2022
1 parent a5a4f77 commit 5d8fbd1
Showing 1 changed file with 1 addition and 43 deletions.
44 changes: 1 addition & 43 deletions dwl.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ struct dwl_input_popup {
struct wl_listener popup_unmap;
struct wl_listener popup_destroy;
struct wl_listener popup_surface_commit;
struct wl_listener focused_surface_unmap;
//struct wl_listener focused_surface_unmap;
};

/* Used to move all of the data necessary to render a surface from the top-level
Expand Down Expand Up @@ -2434,41 +2434,13 @@ static void handle_im_popup_unmap(struct wl_listener *listener, void *data) {
static void handle_im_popup_destroy(struct wl_listener *listener, void *data) {
struct dwl_input_popup *popup =
wl_container_of(listener, popup, popup_destroy);
wl_list_remove(&popup->focused_surface_unmap.link);
//wl_list_remove(&popup->popup_surface_commit.link);
wl_list_remove(&popup->popup_destroy.link);
wl_list_remove(&popup->popup_unmap.link);
wl_list_remove(&popup->popup_map.link);
free(popup);
}



static void input_popup_set_focus(struct dwl_input_popup *popup,
struct wlr_surface *surface) {
Client* client;
struct wlr_layer_surface_v1* layer_surface;
LayerSurface* layer;

wl_list_remove(&popup->focused_surface_unmap.link);

if (wlr_surface_is_layer_surface(surface)) {
layer_surface = wlr_layer_surface_v1_from_wlr_surface(surface);
layer = layer_surface_from_wlr_layer_surface_v1(layer_surface);
wl_signal_add(&layer->layer_surface->events.unmap,
&popup->focused_surface_unmap);
//input_popup_update(popup);
return;
}

client = client_from_wlr_surface(surface);
wl_signal_add(&client->surface.xdg->events.unmap,
&popup->focused_surface_unmap);
//input_popup_update(popup);
}



static void handle_im_new_popup_surface(struct wl_listener *listener, void *data) {
struct dwl_text_input* text_input;

Expand All @@ -2491,20 +2463,6 @@ static void handle_im_new_popup_surface(struct wl_listener *listener, void *data
&popup->popup_surface->events.destroy, &popup->popup_destroy);
popup->popup_destroy.notify = handle_im_popup_destroy;

/* wl_signal_add(&popup->popup_surface->surface->events.commit, */
/* &popup->popup_surface_commit); */
/* popup->popup_surface_commit.notify = handle_im_popup_surface_commit; */

wl_list_init(&popup->focused_surface_unmap.link);
/* popup->focused_surface_unmap.notify = handle_im_focused_surface_destroy; */

text_input = relay_get_focused_text_input(relay);
if (text_input) {
input_popup_set_focus(popup, text_input->input->focused_surface);
} else {
//input_popup_set_focus(popup, NULL);
}

}


Expand Down

0 comments on commit 5d8fbd1

Please sign in to comment.