]> git.sur5r.net Git - i3/i3/commitdiff
Merge branch 'master' into next
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 28 Jun 2014 11:01:48 +0000 (13:01 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 28 Jun 2014 11:01:48 +0000 (13:01 +0200)
1  2 
src/manage.c

diff --combined src/manage.c
index fa3a4958b41c6a63ae25a2b6c0c27f2186bd9be9,a7002bf3abc33c3c4aa1baa559859bb211a45a0f..d86eb06ca441f308dcc9a0f52641cd43f9ceacc6
@@@ -56,16 -56,16 +56,16 @@@ void restore_geometry(void) 
      DLOG("Restoring geometry\n");
  
      Con *con;
 -    TAILQ_FOREACH (con, &all_cons, all_cons)
 -        if (con->window) {
 -            DLOG("Re-adding X11 border of %d px\n", con->border_width);
 -            con->window_rect.width += (2 * con->border_width);
 -            con->window_rect.height += (2 * con->border_width);
 -            xcb_set_window_rect(conn, con->window->id, con->window_rect);
 -            DLOG("placing window %08x at %d %d\n", con->window->id, con->rect.x, con->rect.y);
 -            xcb_reparent_window(conn, con->window->id, root,
 -                                con->rect.x, con->rect.y);
 -        }
 +    TAILQ_FOREACH(con, &all_cons, all_cons)
 +    if (con->window) {
 +        DLOG("Re-adding X11 border of %d px\n", con->border_width);
 +        con->window_rect.width += (2 * con->border_width);
 +        con->window_rect.height += (2 * con->border_width);
 +        xcb_set_window_rect(conn, con->window->id, con->window_rect);
 +        DLOG("placing window %08x at %d %d\n", con->window->id, con->rect.x, con->rect.y);
 +        xcb_reparent_window(conn, con->window->id, root,
 +                            con->rect.x, con->rect.y);
 +    }
  
      /* Strictly speaking, this line doesn’t really belong here, but since we
       * are syncing, let’s un-register as a window manager first */
@@@ -436,6 -436,11 +436,6 @@@ void manage_window(xcb_window_t window
      if (nc->geometry.width == 0)
          nc->geometry = (Rect) {geom->x, geom->y, geom->width, geom->height};
  
 -    if (want_floating) {
 -        DLOG("geometry = %d x %d\n", nc->geometry.width, nc->geometry.height);
 -        floating_enable(nc, true);
 -    }
 -
      if (motif_border_style != BS_NORMAL) {
          DLOG("MOTIF_WM_HINTS specifies decorations (border_style = %d)\n", motif_border_style);
          if (want_floating) {
          }
      }
  
 +    if (want_floating) {
 +        DLOG("geometry = %d x %d\n", nc->geometry.width, nc->geometry.height);
 +        /* motif hints will be applied only when `new_float` is `normal` or not
 +         * specified */
 +        bool automatic_border = (config.default_floating_border != BS_NORMAL &&
 +                                 motif_border_style == BS_NORMAL);
 +
 +        floating_enable(nc, automatic_border);
 +    }
 +
+     if (nc->border_style == BS_PIXEL) {
+         /* if the border style is BS_PIXEL, explicitly set the border width of
+          * the new container */
+         nc->current_border_width = (want_floating ? config.default_floating_border_width : config.default_border_width);
+     }
      /* to avoid getting an UnmapNotify event due to reparenting, we temporarily
       * declare no interest in any state change event of this window */
      values[0] = XCB_NONE;
  
      /* Defer setting focus after the 'new' event has been sent to ensure the
       * proper window event sequence. */
 -    if (set_focus && nc->mapped) {
 +    if (set_focus && !nc->window->doesnt_accept_focus && nc->mapped) {
          DLOG("Now setting focus.\n");
          con_focus(nc);
      }