aboutsummaryrefslogtreecommitdiff
path: root/rootston/xwayland.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-11-20 14:35:31 +0100
committeremersion <contact@emersion.fr>2017-11-20 14:35:31 +0100
commit1d08d317096a80f96d03cd67303381bdedaaac2a (patch)
tree0c2115f562fe6b5f6a609b561a05dbb9dddda10c /rootston/xwayland.c
parent272e0858e49bf341b363fdbe59a5f669ba678ce2 (diff)
parentc3e0fbdb8f0cb16d99e70d14bb5cef6bd48d4591 (diff)
Merge branch 'master' into laggy-move-resize
Diffstat (limited to 'rootston/xwayland.c')
-rw-r--r--rootston/xwayland.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/rootston/xwayland.c b/rootston/xwayland.c
index b2f64879..640694f7 100644
--- a/rootston/xwayland.c
+++ b/rootston/xwayland.c
@@ -106,7 +106,6 @@ static void maximize(struct roots_view *view, bool maximized) {
static void handle_destroy(struct wl_listener *listener, void *data) {
struct roots_xwayland_surface *roots_surface =
wl_container_of(listener, roots_surface, destroy);
- view_teardown(roots_surface->view);
wl_list_remove(&roots_surface->destroy.link);
wl_list_remove(&roots_surface->request_configure.link);
wl_list_remove(&roots_surface->request_move.link);
@@ -206,8 +205,8 @@ static void handle_surface_commit(struct wl_listener *listener, void *data) {
static void handle_map_notify(struct wl_listener *listener, void *data) {
struct roots_xwayland_surface *roots_surface =
wl_container_of(listener, roots_surface, map_notify);
+ struct wlr_xwayland_surface *xsurface = data;
struct roots_view *view = roots_surface->view;
- struct wlr_xwayland_surface *xsurface = view->xwayland_surface;
struct roots_desktop *desktop = view->desktop;
view->wlr_surface = xsurface->surface;
@@ -218,23 +217,17 @@ static void handle_map_notify(struct wl_listener *listener, void *data) {
wl_signal_add(&xsurface->surface->events.commit,
&roots_surface->surface_commit);
- wlr_list_push(desktop->views, roots_surface->view);
+ wl_list_insert(&desktop->views, &view->link);
}
static void handle_unmap_notify(struct wl_listener *listener, void *data) {
struct roots_xwayland_surface *roots_surface =
wl_container_of(listener, roots_surface, unmap_notify);
- struct roots_desktop *desktop = roots_surface->view->desktop;
roots_surface->view->wlr_surface = NULL;
wl_list_remove(&roots_surface->surface_commit.link);
- for (size_t i = 0; i < desktop->views->length; i++) {
- if (desktop->views->items[i] == roots_surface->view) {
- wlr_list_del(desktop->views, i);
- break;
- }
- }
+ wl_list_remove(&roots_surface->view->link);
}
void handle_xwayland_surface(struct wl_listener *listener, void *data) {
@@ -284,7 +277,6 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) {
view->xwayland_surface = surface;
view->roots_xwayland_surface = roots_surface;
view->wlr_surface = surface->surface;
- view->desktop = desktop;
view->activate = activate;
view->resize = resize;
view->move = move;
@@ -292,7 +284,7 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) {
view->maximize = maximize;
view->close = close;
roots_surface->view = view;
- wlr_list_add(desktop->views, view);
+ view_init(view, desktop);
if (!surface->override_redirect) {
view_setup(view);