Merge pull request #1698 from Airblader/feature-1696
Added 'move position mouse'
This commit is contained in:
@ -1833,6 +1833,30 @@ void cmd_move_window_to_center(I3_CMD, char *method) {
|
||||
ysuccess(true);
|
||||
}
|
||||
|
||||
/*
|
||||
* Implementation of 'move [window|container] [to] position mouse'
|
||||
*
|
||||
*/
|
||||
void cmd_move_window_to_mouse(I3_CMD) {
|
||||
HANDLE_EMPTY_MATCH;
|
||||
|
||||
owindow *current;
|
||||
TAILQ_FOREACH(current, &owindows, owindows) {
|
||||
Con *floating_con = con_inside_floating(current->con);
|
||||
if (floating_con == NULL) {
|
||||
DLOG("con %p / %s is not floating, cannot move it to the mouse position.\n",
|
||||
current->con, current->con->name);
|
||||
continue;
|
||||
}
|
||||
|
||||
DLOG("moving floating container %p / %s to cursor position\n", floating_con, floating_con->name);
|
||||
floating_move_to_pointer(floating_con);
|
||||
}
|
||||
|
||||
cmd_output->needs_tree_render = true;
|
||||
ysuccess(true);
|
||||
}
|
||||
|
||||
/*
|
||||
* Implementation of 'move scratchpad'.
|
||||
*
|
||||
|
Reference in New Issue
Block a user