From c27c7fc020b727154ea4da6911df76e2e1f150cd Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 3 May 2009 16:24:12 +0200 Subject: [PATCH] Bugfix: Insert windows at correct position/set focus correctly when moving between containers --- debian/changelog | 3 +++ src/commands.c | 5 ++++- src/handlers.c | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index d5f767d0..16c5af8f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -31,6 +31,9 @@ i3-wm (3.a-bf1-1) unstable; urgency=low * Bugfix: Correctly restore focus when leaving fullscreen mode * Bugfix: Re-distribute free space when closing customly resized containers, re-evaluate for other containers + * Bugfix: When moving windows into different containers, insert them at the + correct position. + * Bugfix: Correctly set focus when moving windows into other containers * Implement scrolling on stack windows and on the bottom bar. * Create i3-wm-dbg with debug symbols * Don't rely on libxcb-wm any longer, as it got removed in libxcb 0.3.4. diff --git a/src/commands.c b/src/commands.c index f3e31a3a..09c21b34 100644 --- a/src/commands.c +++ b/src/commands.c @@ -221,7 +221,10 @@ static void move_current_window(xcb_connection_t *conn, direction_t direction) { /* Remove it from the old container and put it into the new one */ remove_client_from_container(conn, current_client, container); - CIRCLEQ_INSERT_TAIL(&(new->clients), current_client, clients); + + if (new->currently_focused != NULL) + CIRCLEQ_INSERT_AFTER(&(new->clients), new->currently_focused, current_client, clients); + else CIRCLEQ_INSERT_TAIL(&(new->clients), current_client, clients); SLIST_INSERT_HEAD(&(new->workspace->focus_stack), current_client, focus_clients); /* Update data structures */ diff --git a/src/handlers.c b/src/handlers.c index 1113b826..d2eec978 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -589,6 +589,9 @@ int handle_configure_event(void *prophs, xcb_connection_t *conn, xcb_configure_n LOG("handle_configure_event for window %08x\n", event->window); LOG("event->type = %d, \n", event->response_type); LOG("event->x = %d, ->y = %d, ->width = %d, ->height = %d\n", event->x, event->y, event->width, event->height); + + /* We ignore this sequence twice because events for child and frame should be ignored */ + add_ignore_event(event->sequence); add_ignore_event(event->sequence); if (event->event == root) { -- 2.39.5