Merge branch 'fix-floating-confreq'
This commit is contained in:
commit
1e18952d09
|
@ -138,13 +138,20 @@ 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 fix_coordinates flag will translate the current coordinates (offset from
|
||||||
|
* the monitor position basically) to appropriate coordinates on the
|
||||||
|
* destination workspace.
|
||||||
|
* Not enabling this behaviour comes in handy when this function gets called by
|
||||||
|
* floating_maybe_reassign_ws, which will only "move" a floating window when it
|
||||||
|
* *already* changed its coordinates to a different output.
|
||||||
|
*
|
||||||
* The dont_warp flag disables pointer warping and will be set when this
|
* The dont_warp flag disables pointer warping and will be set when this
|
||||||
* function is called while dragging a floating window.
|
* 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, bool dont_warp);
|
void con_move_to_workspace(Con *con, Con *workspace, bool fix_coordinates, bool dont_warp);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the orientation of the given container (for stacked containers,
|
* Returns the orientation of the given container (for stacked containers,
|
||||||
|
|
|
@ -699,7 +699,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, false);
|
con_move_to_workspace(current->con, ws, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
tree_render();
|
tree_render();
|
||||||
|
|
13
src/con.c
13
src/con.c
|
@ -553,13 +553,20 @@ 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 fix_coordinates flag will translate the current coordinates (offset from
|
||||||
|
* the monitor position basically) to appropriate coordinates on the
|
||||||
|
* destination workspace.
|
||||||
|
* Not enabling this behaviour comes in handy when this function gets called by
|
||||||
|
* floating_maybe_reassign_ws, which will only "move" a floating window when it
|
||||||
|
* *already* changed its coordinates to a different output.
|
||||||
|
*
|
||||||
* The dont_warp flag disables pointer warping and will be set when this
|
* The dont_warp flag disables pointer warping and will be set when this
|
||||||
* function is called while dragging a floating window.
|
* 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, bool dont_warp) {
|
void con_move_to_workspace(Con *con, Con *workspace, bool fix_coordinates, 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;
|
||||||
|
@ -608,7 +615,7 @@ void con_move_to_workspace(Con *con, Con *workspace, bool dont_warp) {
|
||||||
workspace_is_visible(workspace)) {
|
workspace_is_visible(workspace)) {
|
||||||
workspace_show(workspace->name);
|
workspace_show(workspace->name);
|
||||||
|
|
||||||
if (con->type == CT_FLOATING_CON) {
|
if (fix_coordinates && con->type == CT_FLOATING_CON) {
|
||||||
DLOG("Floating window, fixing coordinates\n");
|
DLOG("Floating window, fixing coordinates\n");
|
||||||
/* Take the relative coordinates of the current output, then add them
|
/* Take the relative coordinates of the current output, then add them
|
||||||
* to the coordinate space of the correct output */
|
* to the coordinate space of the correct output */
|
||||||
|
@ -616,7 +623,7 @@ void con_move_to_workspace(Con *con, Con *workspace, bool dont_warp) {
|
||||||
uint32_t rel_y = (con->rect.y - source_output->rect.y);
|
uint32_t rel_y = (con->rect.y - source_output->rect.y);
|
||||||
con->rect.x = dest_output->rect.x + rel_x;
|
con->rect.x = dest_output->rect.x + rel_x;
|
||||||
con->rect.y = dest_output->rect.y + rel_y;
|
con->rect.y = dest_output->rect.y + rel_y;
|
||||||
}
|
} else DLOG("Not fixing coordinates, fix_coordinates flag = %d\n", fix_coordinates);
|
||||||
|
|
||||||
/* Don’t warp if told so (when dragging floating windows with the
|
/* Don’t warp if told so (when dragging floating windows with the
|
||||||
* mouse for example) */
|
* mouse for example) */
|
||||||
|
|
|
@ -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, true);
|
con_move_to_workspace(con, ws, false, true);
|
||||||
con_focus(con_descend_focused(con));
|
con_focus(con_descend_focused(con));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -371,6 +371,7 @@ static int handle_configure_request(xcb_configure_request_event_t *event) {
|
||||||
con->rect.height = event->height + (-1) * bsr.height;
|
con->rect.height = event->height + (-1) * bsr.height;
|
||||||
DLOG("proposed height = %d, new height is %d\n", event->height, con->rect.height);
|
DLOG("proposed height = %d, new height is %d\n", event->height, con->rect.height);
|
||||||
}
|
}
|
||||||
|
floating_maybe_reassign_ws(con);
|
||||||
tree_render();
|
tree_render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue