]> git.sur5r.net Git - i3/i3/blobdiff - src/resize.c
Merge branch 'fix-dump-log-errmsg'
[i3/i3] / src / resize.c
index 8f8c04d75c15b6d8f427e047de468a6d72c115fb..4b3289cdb288f47c21954534ae8bdc7d1d5d0694 100644 (file)
@@ -26,7 +26,7 @@ struct callback_params {
 };
 
 DRAGGING_CB(resize_callback) {
-    struct callback_params *params = extra;
+    const struct callback_params *params = extra;
     Con *output = params->output;
     DLOG("new x = %d, y = %d\n", new_x, new_y);
     if (params->orientation == HORIZ) {
@@ -49,7 +49,7 @@ DRAGGING_CB(resize_callback) {
     xcb_flush(conn);
 }
 
-int resize_graphical_handler(Con *first, Con *second, orientation_t orientation, xcb_button_press_event_t *event) {
+int resize_graphical_handler(Con *first, Con *second, orientation_t orientation, const xcb_button_press_event_t *event) {
     DLOG("resize handler\n");
 
     uint32_t new_position;
@@ -58,6 +58,9 @@ int resize_graphical_handler(Con *first, Con *second, orientation_t orientation,
     Con *output = con_get_output(first);
     DLOG("x = %d, width = %d\n", output->rect.x, output->rect.width);
 
+    x_mask_event_mask(~XCB_EVENT_MASK_ENTER_WINDOW);
+    xcb_flush(conn);
+
     uint32_t mask = 0;
     uint32_t values[2];
 
@@ -66,7 +69,8 @@ int resize_graphical_handler(Con *first, Con *second, orientation_t orientation,
 
     /* Open a new window, the resizebar. Grab the pointer and move the window around
        as the user moves the pointer. */
-    xcb_window_t grabwin = create_window(conn, output->rect, XCB_WINDOW_CLASS_INPUT_ONLY, XCURSOR_CURSOR_POINTER, true, mask, values);
+    xcb_window_t grabwin = create_window(conn, output->rect, XCB_COPY_FROM_PARENT, XCB_COPY_FROM_PARENT,
+            XCB_WINDOW_CLASS_INPUT_ONLY, XCURSOR_CURSOR_POINTER, true, mask, values);
 
     Rect helprect;
     if (orientation == HORIZ) {
@@ -89,8 +93,8 @@ int resize_graphical_handler(Con *first, Con *second, orientation_t orientation,
     mask |= XCB_CW_OVERRIDE_REDIRECT;
     values[1] = 1;
 
-    xcb_window_t helpwin = create_window(conn, helprect, XCB_WINDOW_CLASS_INPUT_OUTPUT,
-                                         (orientation == HORIZ ?
+    xcb_window_t helpwin = create_window(conn, helprect, XCB_COPY_FROM_PARENT, XCB_COPY_FROM_PARENT,
+            XCB_WINDOW_CLASS_INPUT_OUTPUT, (orientation == HORIZ ?
                                           XCURSOR_CURSOR_RESIZE_HORIZONTAL :
                                           XCURSOR_CURSOR_RESIZE_VERTICAL), true, mask, values);
 
@@ -98,7 +102,7 @@ int resize_graphical_handler(Con *first, Con *second, orientation_t orientation,
 
     xcb_flush(conn);
 
-    struct callback_params params = { orientation, output, helpwin, &new_position };
+    const struct callback_params params = { orientation, output, helpwin, &new_position };
 
     drag_pointer(NULL, event, grabwin, BORDER_TOP, resize_callback, &params);