X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Ffloating.c;h=fac14a7a8a9bf0bec8ce4833902b9877df81c041;hb=ede954128afca118025db6a04d4d9d259473c70f;hp=279d4c997178680ca78fab5aa064802479afcc06;hpb=6d3fc089f921ea33a1b3ec085849d1c218256ccc;p=i3%2Fi3 diff --git a/src/floating.c b/src/floating.c index 279d4c99..fac14a7a 100644 --- a/src/floating.c +++ b/src/floating.c @@ -246,7 +246,7 @@ void floating_enable(Con *con, bool automatic) { Con *parent = con->parent; /* clear the pointer before calling tree_close_internal in which the memory is freed */ con->parent = NULL; - tree_close_internal(parent, DONT_KILL_WINDOW, false, false); + tree_close_internal(parent, DONT_KILL_WINDOW, false); } char *name; @@ -366,13 +366,17 @@ void floating_disable(Con *con, bool automatic) { } Con *ws = con_get_workspace(con); + if (con_is_internal(ws)) { + LOG("Can't disable floating for container in internal workspace.\n"); + return; + } Con *tiling_focused = con_descend_tiling_focused(ws); if (tiling_focused->type == CT_WORKSPACE) { Con *parent = con->parent; con_detach(con); con->parent = NULL; - tree_close_internal(parent, DONT_KILL_WINDOW, true, false); + tree_close_internal(parent, DONT_KILL_WINDOW, true); con_attach(con, tiling_focused, false); con->percent = 0.0; con_fix_percent(con->parent); @@ -537,8 +541,10 @@ void floating_drag_window(Con *con, const xcb_button_press_event_t *event) { } /* If the user cancelled, undo the changes. */ - if (drag_result == DRAG_REVERT) + if (drag_result == DRAG_REVERT) { floating_reposition(con, initial_rect); + return; + } /* If this is a scratchpad window, don't auto center it from now on. */ if (con->scratchpad_state == SCRATCHPAD_FRESH) @@ -789,8 +795,7 @@ static void xcb_drag_prepare_cb(EV_P_ ev_prepare *w, int revents) { * rect of the client, the event and the new coordinates (x, y). * */ -drag_result_t drag_pointer(Con *con, const xcb_button_press_event_t *event, xcb_window_t - confine_to, +drag_result_t drag_pointer(Con *con, const xcb_button_press_event_t *event, xcb_window_t confine_to, border_t border, int cursor, callback_t callback, const void *extra) { xcb_cursor_t xcursor = (cursor && xcursor_supported) ? xcursor_get_cursor(cursor) : XCB_NONE;