]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Raise clients only when needed
authorMichael Stapelberg <michael+git@stapelberg.de>
Sat, 28 Feb 2009 01:15:14 +0000 (02:15 +0100)
committerMichael Stapelberg <michael+git@stapelberg.de>
Sat, 28 Feb 2009 01:15:14 +0000 (02:15 +0100)
src/layout.c
src/mainx.c
src/util.c

index 18d431e36b235cabcccbb8eb9cb80a97b1739042..c1386778f099bedcd15d3cdfb6cfcb341915139f 100644 (file)
@@ -253,11 +253,6 @@ void render_container(xcb_connection_t *connection, Container *container) {
                                         current_client * decoration_height);
                         current_client++;
                 }
-
-                /* Raise the focused window */
-                uint32_t values[] = { XCB_STACK_MODE_ABOVE };
-                xcb_configure_window(connection, container->currently_focused->frame,
-                                     XCB_CONFIG_WINDOW_STACK_MODE, values);
         }
 }
 
index 84150e780b068f31bfe57c11aa3b8ea5c9cb0ea4..9a9003963975288b9c042d469af679b065a4d7ae 100644 (file)
@@ -282,6 +282,9 @@ int main(int argc, char *argv[], char *env[]) {
         xcb_window_t root;
         xcb_intern_atom_cookie_t atom_cookies[NUM_ATOMS];
 
+        if (!isatty(stdout))
+                setbuf(stdout, NULL);
+
         application_path = sstrdup(argv[0]);
 
         /* Initialize the table data structures for each workspace */
index a25e63763d191114b188be02264839e60f81d592..d565508b5aa9965ca66ce432c09865c39c1dbd85 100644 (file)
@@ -149,9 +149,13 @@ void set_focus(xcb_connection_t *conn, Client *client) {
         decorate_window(conn, client, client->frame, client->titlegc, 0);
 
         /* If we’re in stacking mode, we render the container to update changes in the title
-           bars and to raise the focused client */
-        if (client->container->mode == MODE_STACK)
+           bars and raise the focused client */
+        if (client->container->mode == MODE_STACK) {
                 render_container(conn, client->container);
+                uint32_t values[] = { XCB_STACK_MODE_ABOVE };
+                xcb_configure_window(conn, client->frame,
+                                     XCB_CONFIG_WINDOW_STACK_MODE, values);
+        }
 
         xcb_flush(conn);
 }
@@ -189,6 +193,11 @@ void switch_layout_mode(xcb_connection_t *conn, Container *container, int mode)
                 stack_win->container = container;
 
                 SLIST_INSERT_HEAD(&stack_wins, stack_win, stack_windows);
+                /* Raise the focused window */
+                values[0] = XCB_STACK_MODE_ABOVE;
+                xcb_configure_window(conn, container->currently_focused->frame,
+                                     XCB_CONFIG_WINDOW_STACK_MODE, values);
+
         } else {
                 if (container->mode == MODE_STACK) {
                         /* When going out of stacking mode, we need to close the window */