]> git.sur5r.net Git - i3/i3/blobdiff - src/con.c
Separate border width for floating windows
[i3/i3] / src / con.c
index 5a3c88d21ce0bd8dff731ff8e3df44c8a8a40f6e..4b47b182f32c6066a352cd9fe8209fc6586532fc 100644 (file)
--- a/src/con.c
+++ b/src/con.c
@@ -241,6 +241,17 @@ bool con_is_leaf(Con *con) {
     return TAILQ_EMPTY(&(con->nodes_head));
 }
 
+/*
+ * Returns true when this con is a leaf node with a managed X11 window (e.g.,
+ * excluding dock containers)
+ */
+bool con_has_managed_window(Con *con) {
+    return (con != NULL
+            && con->window != NULL
+            && con->window->id != XCB_WINDOW_NONE
+            && con_get_workspace(con) != NULL);
+}
+
 /**
  * Returns true if this node has regular or floating children.
  *
@@ -609,6 +620,9 @@ void con_toggle_fullscreen(Con *con, int fullscreen_mode) {
 
     DLOG("mode now: %d\n", con->fullscreen_mode);
 
+    /* Send an ipc window "fullscreen_mode" event */
+    ipc_send_window_event("fullscreen_mode", con);
+
     /* update _NET_WM_STATE if this container has a window */
     /* TODO: when a window is assigned to a container which is already
      * fullscreened, this state needs to be pushed to the client, too */
@@ -1076,8 +1090,13 @@ Rect con_border_style_rect(Con *con) {
     int border_width = con->current_border_width;
     DLOG("The border width for con is set to: %d\n", con->current_border_width);
     Rect result;
-    if (con->current_border_width < 0)
-        border_width = config.default_border_width;
+    if (con->current_border_width < 0) {
+        if (con_is_floating(con)) {
+            border_width = config.default_floating_border_width;
+        } else {
+            border_width = config.default_border_width;
+        }
+    }
     DLOG("Effective border width is set to: %d\n", border_width);
     /* Shortcut to avoid calling con_adjacent_borders() on dock containers. */
     int border_style = con_border_style(con);