From 19a525f3b51ed16d400d92fe27553967833f85d9 Mon Sep 17 00:00:00 2001 From: emersion Date: Mon, 26 Mar 2018 19:02:28 -0400 Subject: [PATCH 1/2] rootston: damage view when zxdg-popup-v6 is mapped/unmapped --- include/rootston/view.h | 2 ++ rootston/xdg_shell_v6.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/include/rootston/view.h b/include/rootston/view.h index 775f3d11..1fd7353a 100644 --- a/include/rootston/view.h +++ b/include/rootston/view.h @@ -177,6 +177,8 @@ struct roots_xdg_popup_v6 { struct roots_view_child view_child; struct wlr_xdg_popup_v6 *wlr_popup; struct wl_listener destroy; + struct wl_listener map; + struct wl_listener unmap; struct wl_listener new_popup; }; diff --git a/rootston/xdg_shell_v6.c b/rootston/xdg_shell_v6.c index 001232ab..8d1a340e 100644 --- a/rootston/xdg_shell_v6.c +++ b/rootston/xdg_shell_v6.c @@ -28,6 +28,18 @@ static void popup_handle_destroy(struct wl_listener *listener, void *data) { popup_destroy((struct roots_view_child *)popup); } +static void popup_handle_map(struct wl_listener *listener, void *data) { + struct roots_xdg_popup_v6 *popup = + wl_container_of(listener, popup, map); + view_damage_whole(popup->view_child.view); +} + +static void popup_handle_unmap(struct wl_listener *listener, void *data) { + struct roots_xdg_popup_v6 *popup = + wl_container_of(listener, popup, unmap); + view_damage_whole(popup->view_child.view); +} + static struct roots_xdg_popup_v6 *popup_create(struct roots_view *view, struct wlr_xdg_popup_v6 *wlr_popup); @@ -50,6 +62,10 @@ static struct roots_xdg_popup_v6 *popup_create(struct roots_view *view, view_child_init(&popup->view_child, view, wlr_popup->base->surface); popup->destroy.notify = popup_handle_destroy; wl_signal_add(&wlr_popup->base->events.destroy, &popup->destroy); + popup->map.notify = popup_handle_map; + wl_signal_add(&wlr_popup->base->events.map, &popup->map); + popup->unmap.notify = popup_handle_unmap; + wl_signal_add(&wlr_popup->base->events.unmap, &popup->unmap); popup->new_popup.notify = popup_handle_new_popup; wl_signal_add(&wlr_popup->base->events.new_popup, &popup->new_popup); return popup; From 4abca435cc1ca9d89c077f0d06419696213a36c4 Mon Sep 17 00:00:00 2001 From: emersion Date: Tue, 27 Mar 2018 17:27:58 -0400 Subject: [PATCH 2/2] rootston: damage view when xdg-popup is mapped/unmapped --- include/rootston/view.h | 2 ++ rootston/xdg_shell.c | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/include/rootston/view.h b/include/rootston/view.h index 1fd7353a..1397a8d2 100644 --- a/include/rootston/view.h +++ b/include/rootston/view.h @@ -186,6 +186,8 @@ struct roots_xdg_popup { struct roots_view_child view_child; struct wlr_xdg_popup *wlr_popup; struct wl_listener destroy; + struct wl_listener map; + struct wl_listener unmap; struct wl_listener new_popup; }; diff --git a/rootston/xdg_shell.c b/rootston/xdg_shell.c index 099e622c..923fbeb4 100644 --- a/rootston/xdg_shell.c +++ b/rootston/xdg_shell.c @@ -28,6 +28,16 @@ static void popup_handle_destroy(struct wl_listener *listener, void *data) { popup_destroy((struct roots_view_child *)popup); } +static void popup_handle_map(struct wl_listener *listener, void *data) { + struct roots_xdg_popup *popup = wl_container_of(listener, popup, map); + view_damage_whole(popup->view_child.view); +} + +static void popup_handle_unmap(struct wl_listener *listener, void *data) { + struct roots_xdg_popup *popup = wl_container_of(listener, popup, unmap); + view_damage_whole(popup->view_child.view); +} + static struct roots_xdg_popup *popup_create(struct roots_view *view, struct wlr_xdg_popup *wlr_popup); @@ -50,6 +60,10 @@ static struct roots_xdg_popup *popup_create(struct roots_view *view, view_child_init(&popup->view_child, view, wlr_popup->base->surface); popup->destroy.notify = popup_handle_destroy; wl_signal_add(&wlr_popup->base->events.destroy, &popup->destroy); + popup->map.notify = popup_handle_map; + wl_signal_add(&wlr_popup->base->events.map, &popup->map); + popup->unmap.notify = popup_handle_unmap; + wl_signal_add(&wlr_popup->base->events.unmap, &popup->unmap); popup->new_popup.notify = popup_handle_new_popup; wl_signal_add(&wlr_popup->base->events.new_popup, &popup->new_popup); return popup;