diff options
-rw-r--r-- | include/rootston/view.h | 2 | ||||
-rw-r--r-- | rootston/xdg_shell_v6.c | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/include/rootston/view.h b/include/rootston/view.h index 4d0cc5e0..85a6c1e7 100644 --- a/include/rootston/view.h +++ b/include/rootston/view.h @@ -28,6 +28,8 @@ struct roots_xdg_surface_v6 { struct wl_listener request_move; struct wl_listener request_resize; struct wl_listener request_show_window_menu; + + bool initialized; }; struct roots_xwayland_surface { diff --git a/rootston/xdg_shell_v6.c b/rootston/xdg_shell_v6.c index c9c2368a..2471b3ee 100644 --- a/rootston/xdg_shell_v6.c +++ b/rootston/xdg_shell_v6.c @@ -72,9 +72,11 @@ static void handle_commit(struct wl_listener *listener, void *data) { wl_container_of(listener, roots_xdg_surface, commit); struct roots_view *view = roots_xdg_surface->view; - bool centered = view_center(view); - if (centered) { - wl_list_remove(&listener->link); + if (!roots_xdg_surface->initialized) { + bool centered = view_center(view); + if (centered) { + roots_xdg_surface->initialized = true; + } } } |