Merge branch 'master' into next
This commit is contained in:
commit
75c11cb894
|
@ -131,10 +131,14 @@ void con_toggle_fullscreen(Con *con, int fullscreen_mode);
|
||||||
/**
|
/**
|
||||||
* Moves the given container to the currently focused container on the given
|
* Moves the given container to the currently focused container on the given
|
||||||
* workspace.
|
* workspace.
|
||||||
|
*
|
||||||
|
* The dont_warp flag disables pointer warping and will be set when this
|
||||||
|
* function is called while dragging a floating window.
|
||||||
|
*
|
||||||
* TODO: is there a better place for this function?
|
* TODO: is there a better place for this function?
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void con_move_to_workspace(Con *con, Con *workspace);
|
void con_move_to_workspace(Con *con, Con *workspace, bool dont_warp);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the orientation of the given container (for stacked containers,
|
* Returns the orientation of the given container (for stacked containers,
|
||||||
|
|
|
@ -700,7 +700,7 @@ move:
|
||||||
|
|
||||||
TAILQ_FOREACH(current, &owindows, owindows) {
|
TAILQ_FOREACH(current, &owindows, owindows) {
|
||||||
printf("matching: %p / %s\n", current->con, current->con->name);
|
printf("matching: %p / %s\n", current->con, current->con->name);
|
||||||
con_move_to_workspace(current->con, ws);
|
con_move_to_workspace(current->con, ws, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
tree_render();
|
tree_render();
|
||||||
|
|
24
src/con.c
24
src/con.c
|
@ -540,10 +540,14 @@ update_netwm_state:
|
||||||
/*
|
/*
|
||||||
* Moves the given container to the currently focused container on the given
|
* Moves the given container to the currently focused container on the given
|
||||||
* workspace.
|
* workspace.
|
||||||
|
*
|
||||||
|
* The dont_warp flag disables pointer warping and will be set when this
|
||||||
|
* function is called while dragging a floating window.
|
||||||
|
*
|
||||||
* TODO: is there a better place for this function?
|
* TODO: is there a better place for this function?
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void con_move_to_workspace(Con *con, Con *workspace) {
|
void con_move_to_workspace(Con *con, Con *workspace, bool dont_warp) {
|
||||||
if (con->type == CT_WORKSPACE) {
|
if (con->type == CT_WORKSPACE) {
|
||||||
DLOG("Moving workspaces is not yet implemented.\n");
|
DLOG("Moving workspaces is not yet implemented.\n");
|
||||||
return;
|
return;
|
||||||
|
@ -592,9 +596,19 @@ void con_move_to_workspace(Con *con, Con *workspace) {
|
||||||
workspace_is_visible(workspace)) {
|
workspace_is_visible(workspace)) {
|
||||||
workspace_show(workspace->name);
|
workspace_show(workspace->name);
|
||||||
|
|
||||||
/* Unset warp_to if target con is floating. Otherwise, set warp_to to
|
if (con->type == CT_FLOATING_CON) {
|
||||||
* current target container. */
|
DLOG("Floating window, fixing coordinates\n");
|
||||||
if (con->type == CT_FLOATING_CON)
|
/* Take the relative coordinates of the current output, then add them
|
||||||
|
* to the coordinate space of the correct output */
|
||||||
|
uint32_t rel_x = (con->rect.x - source_output->rect.x);
|
||||||
|
uint32_t rel_y = (con->rect.y - source_output->rect.y);
|
||||||
|
con->rect.x = dest_output->rect.x + rel_x;
|
||||||
|
con->rect.y = dest_output->rect.y + rel_y;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Don’t warp if told so (when dragging floating windows with the
|
||||||
|
* mouse for example) */
|
||||||
|
if (dont_warp)
|
||||||
x_set_warp_to(NULL);
|
x_set_warp_to(NULL);
|
||||||
else
|
else
|
||||||
x_set_warp_to(&(con->rect));
|
x_set_warp_to(&(con->rect));
|
||||||
|
@ -613,7 +627,7 @@ void con_move_to_workspace(Con *con, Con *workspace) {
|
||||||
|
|
||||||
/* 7: focus the con on the target workspace (the X focus is only updated by
|
/* 7: focus the con on the target workspace (the X focus is only updated by
|
||||||
* calling tree_render(), so for the "real" focus this is a no-op). */
|
* calling tree_render(), so for the "real" focus this is a no-op). */
|
||||||
con_focus(con);
|
con_focus(con_descend_focused(con));
|
||||||
|
|
||||||
/* 8: when moving to a visible workspace on a different output, we keep the
|
/* 8: when moving to a visible workspace on a different output, we keep the
|
||||||
* con focused. Otherwise, we leave the focus on the current workspace as we
|
* con focused. Otherwise, we leave the focus on the current workspace as we
|
||||||
|
|
|
@ -286,7 +286,7 @@ bool floating_maybe_reassign_ws(Con *con) {
|
||||||
Con *content = output_get_content(output->con);
|
Con *content = output_get_content(output->con);
|
||||||
Con *ws = TAILQ_FIRST(&(content->focus_head));
|
Con *ws = TAILQ_FIRST(&(content->focus_head));
|
||||||
DLOG("Moving con %p / %s to workspace %p / %s\n", con, con->name, ws, ws->name);
|
DLOG("Moving con %p / %s to workspace %p / %s\n", con, con->name, ws, ws->name);
|
||||||
con_move_to_workspace(con, ws);
|
con_move_to_workspace(con, ws, true);
|
||||||
con_focus(con_descend_focused(con));
|
con_focus(con_descend_focused(con));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue