]> git.sur5r.net Git - i3/i3/blobdiff - src/floating.c
cmd_move_window_to_position: improve error message
[i3/i3] / src / floating.c
index 14988818418c972e70a9d1181cf10d990c886256..2130d6732278fbea5e8570a465d101939ed65b14 100644 (file)
@@ -318,7 +318,7 @@ void floating_enable(Con *con, bool automatic) {
     render_con(con, false);
 
     if (set_focus)
-        con_focus(con);
+        con_activate(con);
 
     /* Check if we need to re-assign it to a different workspace because of its
      * coordinates and exit if that was done successfully. */
@@ -382,7 +382,7 @@ void floating_disable(Con *con, bool automatic) {
     con_fix_percent(con->parent);
 
     if (set_focus)
-        con_focus(con);
+        con_activate(con);
 
     floating_set_hint_atom(con, false);
     ipc_send_window_event("floating", con);
@@ -449,7 +449,8 @@ bool floating_maybe_reassign_ws(Con *con) {
     Con *ws = TAILQ_FIRST(&(content->focus_head));
     DLOG("Moving con %p / %s to workspace %p / %s\n", con, con->name, ws, ws->name);
     con_move_to_workspace(con, ws, false, true, false);
-    con_focus(con_descend_focused(con));
+    workspace_show(ws);
+    con_activate(con_descend_focused(con));
     return true;
 }
 
@@ -746,8 +747,10 @@ static void xcb_drag_prepare_cb(EV_P_ ev_prepare *w, int revents) {
         if (last_motion_notify != (xcb_motion_notify_event_t *)event)
             free(event);
 
-        if (dragloop->result != DRAGGING)
+        if (dragloop->result != DRAGGING) {
+            free(last_motion_notify);
             return;
+        }
     }
 
     if (last_motion_notify == NULL)
@@ -861,12 +864,12 @@ drag_result_t drag_pointer(Con *con, const xcb_button_press_event_t *event, xcb_
  * outputs.
  *
  */
-void floating_reposition(Con *con, Rect newrect) {
+bool floating_reposition(Con *con, Rect newrect) {
     /* Sanity check: Are the new coordinates on any output? If not, we
      * ignore that request. */
     if (!contained_by_output(newrect)) {
         ELOG("No output found at destination coordinates. Not repositioning.\n");
-        return;
+        return false;
     }
 
     con->rect = newrect;
@@ -878,6 +881,7 @@ void floating_reposition(Con *con, Rect newrect) {
         con->scratchpad_state = SCRATCHPAD_CHANGED;
 
     tree_render();
+    return true;
 }
 
 /*