]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Don’t call resize_client if the width/height increment properties did not...
authorMichael Stapelberg <michael@stapelberg.de>
Tue, 25 Aug 2009 21:16:17 +0000 (23:16 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 25 Aug 2009 21:16:17 +0000 (23:16 +0200)
This avoids an endless loop, preventing clients to go to fullscreen

src/handlers.c

index b8725c1bab7df7e07edd0d7522f2c3fe0b5267a7..49a56f7adbcd055d6ea273c5276b832ae8a41fbb 100644 (file)
@@ -1026,13 +1026,23 @@ int handle_normal_hints(void *data, xcb_connection_t *conn, uint8_t state, xcb_w
         }
 
         if ((size_hints.flags & XCB_SIZE_HINT_P_RESIZE_INC)) {
+                bool changed = false;
+
                 if (size_hints.width_inc > 0)
-                        client->width_increment = size_hints.width_inc;
+                        if (client->width_increment != size_hints.width_inc) {
+                                client->width_increment = size_hints.width_inc;
+                                changed = true;
+                        }
                 if (size_hints.height_inc > 0)
-                        client->height_increment = size_hints.height_inc;
+                        if (client->height_increment != size_hints.height_inc) {
+                                client->height_increment = size_hints.height_inc;
+                                changed = true;
+                        }
 
-                resize_client(conn, client);
-                xcb_flush(conn);
+                if (changed) {
+                        resize_client(conn, client);
+                        xcb_flush(conn);
+                }
         }
 
         int base_width = 0, base_height = 0;