]> git.sur5r.net Git - i3/i3/blobdiff - src/handlers.c
Merge branch 'master' into next
[i3/i3] / src / handlers.c
index 61a2e1752b2426c67be314bf832f218c4f7e1c9c..3508e6d6d45d7f4a16a6e95b5d7291b6fc5339e9 100644 (file)
@@ -400,23 +400,9 @@ static int handle_configure_request(xcb_configure_request_event_t *event) {
                  event->height, newrect.height, con->border_width);
         }
 
-        /* Sanity check: Are the new coordinates on any output? If not, we
-         * ignore that request. */
-        Output *output = get_output_containing(
-            newrect.x + (newrect.width / 2),
-            newrect.y + (newrect.height / 2));
-
-        if (!output) {
-            ELOG("No output found at destination coordinates. Ignoring this ConfigureRequest.\n");
-            fake_absolute_configure_notify(con);
-            return 0;
-        }
-
         DLOG("Container is a floating leaf node, will do that.\n");
-        floatingcon->rect = newrect;
-
-        floating_maybe_reassign_ws(floatingcon);
-        tree_render();
+        floating_reposition(floatingcon, newrect);
+        return 1;
     }
 
     /* Dock windows can be reconfigured in their height */
@@ -648,11 +634,6 @@ static int handle_windowclass_change(void *data, xcb_connection_t *conn, uint8_t
 static int handle_expose_event(xcb_expose_event_t *event) {
     Con *parent;
 
-    /* event->count is the number of minimum remaining expose events for this
-     * window, so we skip all events but the last one */
-    if (event->count != 0)
-        return 1;
-
     DLOG("window = %08x\n", event->window);
 
     if ((parent = con_by_frame_id(event->window)) == NULL) {
@@ -660,8 +641,13 @@ static int handle_expose_event(xcb_expose_event_t *event) {
         return 1;
     }
 
-    /* re-render the parent (recursively, if it’s a split con) */
-    x_deco_recurse(parent);
+    /* Since we render to our pixmap on every change anyways, expose events
+     * only tell us that the X server lost (parts of) the window contents. We
+     * can handle that by copying the appropriate part from our pixmap to the
+     * window. */
+    xcb_copy_area(conn, parent->pixmap, parent->frame, parent->pm_gc,
+                  event->x, event->y, event->x, event->y,
+                  event->width, event->height);
     xcb_flush(conn);
 
     return 1;