]> git.sur5r.net Git - i3/i3/commitdiff
Move base_width and base_height from Con to Window
authorIngo Bürk <ingo.buerk@tngtech.com>
Sun, 30 Aug 2015 20:48:37 +0000 (22:48 +0200)
committerIngo Bürk <ingo.buerk@tngtech.com>
Sun, 30 Aug 2015 20:48:37 +0000 (22:48 +0200)
relates to #665

include/data.h
src/floating.c
src/handlers.c

index 634cca674f5bcb7707c1336d5be92ac5a8ecc891..4f69706ff58f9c45da57a6ef7811f17e8dc9a0b5 100644 (file)
@@ -409,6 +409,11 @@ struct Window {
 
     /** Depth of the window */
     uint16_t depth;
+
+    /* the wanted size of the window, used in combination with size
+     * increments (see below). */
+    int base_width;
+    int base_height;
 };
 
 /**
@@ -572,10 +577,6 @@ struct Con {
 
     /* aspect ratio from WM_NORMAL_HINTS (MPlayer uses this for example) */
     double aspect_ratio;
-    /* the wanted size of the window, used in combination with size
-     * increments (see below). */
-    int base_width;
-    int base_height;
 
     /* the x11 border pixel attribute */
     int border_width;
index a82e2525c2a1e31927f428b56a304838c1b7e6e8..60322c0c0066948ffc2da788f96ef8619ad51754 100644 (file)
@@ -55,17 +55,17 @@ void floating_check_size(Con *floating_con) {
             border_rect.height += render_deco_height();
 
         if (focused_con->height_increment &&
-            floating_con->rect.height >= focused_con->base_height + border_rect.height) {
-            floating_con->rect.height -= focused_con->base_height + border_rect.height;
+            floating_con->rect.height >= focused_con->window->base_height + border_rect.height) {
+            floating_con->rect.height -= focused_con->window->base_height + border_rect.height;
             floating_con->rect.height -= floating_con->rect.height % focused_con->height_increment;
-            floating_con->rect.height += focused_con->base_height + border_rect.height;
+            floating_con->rect.height += focused_con->window->base_height + border_rect.height;
         }
 
         if (focused_con->width_increment &&
-            floating_con->rect.width >= focused_con->base_width + border_rect.width) {
-            floating_con->rect.width -= focused_con->base_width + border_rect.width;
+            floating_con->rect.width >= focused_con->window->base_width + border_rect.width) {
+            floating_con->rect.width -= focused_con->window->base_width + border_rect.width;
             floating_con->rect.width -= floating_con->rect.width % focused_con->width_increment;
-            floating_con->rect.width += focused_con->base_width + border_rect.width;
+            floating_con->rect.width += focused_con->window->base_width + border_rect.width;
         }
     }
 
index 1daefbc912de21b21f93aeb9c33c6d3d6165e01f..8e92bec98b637607b8b1932cd73f7337cb61d18b 100644 (file)
@@ -960,10 +960,10 @@ static bool handle_normal_hints(void *data, xcb_connection_t *conn, uint8_t stat
         base_height = size_hints.min_height;
     }
 
-    if (base_width != con->base_width ||
-        base_height != con->base_height) {
-        con->base_width = base_width;
-        con->base_height = base_height;
+    if (base_width != con->window->base_width ||
+        base_height != con->window->base_height) {
+        con->window->base_width = base_width;
+        con->window->base_height = base_height;
         DLOG("client's base_height changed to %d\n", base_height);
         DLOG("client's base_width changed to %d\n", base_width);
         changed = true;