X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Ffloating.c;h=643f204b64110a12aede45c4bf4b6ee9e4851f86;hb=78e99440f6ff144bb6842f3fb33c1f65faadc4df;hp=4dd44f574d98699cf896294643543d3761623c5b;hpb=d5358a749e3f4eed45144a2c78032c4163ea2367;p=i3%2Fi3 diff --git a/src/floating.c b/src/floating.c index 4dd44f57..643f204b 100644 --- a/src/floating.c +++ b/src/floating.c @@ -315,6 +315,8 @@ void floating_disable(Con *con, bool automatic) { return; } + const bool set_focus = (con == focused); + Con *ws = con_get_workspace(con); /* 1: detach from parent container */ @@ -344,8 +346,9 @@ void floating_disable(Con *con, bool automatic) { con_attach(con, con->parent, false); con_fix_percent(con->parent); - // TODO: don’t influence focus handling when Con was not focused before. - con_focus(con); + + if (set_focus) + con_focus(con); } /* @@ -421,6 +424,8 @@ DRAGGING_CB(drag_window_callback) { /* Check if we cross workspace boundaries while moving */ if (!floating_maybe_reassign_ws(con)) return; + /* Ensure not to warp the pointer while dragging */ + x_set_warp_to(NULL); tree_render(); } @@ -657,11 +662,7 @@ void drag_pointer(Con *con, const xcb_button_press_event_t *event, xcb_window_t void floating_reposition(Con *con, Rect newrect) { /* 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) { + if (!contained_by_output(newrect)) { ELOG("No output found at destination coordinates. Not repositioning.\n"); return; }