Fix dragging floating containers / click handling

This commit is contained in:
Michael Stapelberg
2010-12-31 01:38:17 +01:00
parent daf00a932f
commit 2d05c3a37d
5 changed files with 90 additions and 26 deletions

View File

@ -157,6 +157,7 @@ void con_detach(Con *con) {
*/
void con_focus(Con *con) {
assert(con != NULL);
DLOG("con_focus = %p\n", con);
/* 1: set focused-pointer to the new con */
/* 2: exchange the position of the container in focus stack of the parent all the way up */
@ -170,6 +171,7 @@ void con_focus(Con *con) {
con->urgent = false;
workspace_update_urgent_flag(con_get_workspace(con));
}
DLOG("con_focus done = %p\n", con);
}
/*
@ -287,6 +289,25 @@ bool con_is_floating(Con *con) {
return (con->floating >= FLOATING_AUTO_ON);
}
/*
* Checks if the given container is either floating or inside some floating
* container. It returns the FLOATING_CON container.
*
*/
Con *con_inside_floating(Con *con) {
assert(con != NULL);
if (con->type == CT_FLOATING_CON)
return con;
if (con->floating >= FLOATING_AUTO_ON)
return con->parent;
if (con->type == CT_WORKSPACE)
return NULL;
return con_inside_floating(con->parent);
}
/*
* Returns the container with the given client window ID or NULL if no such
* container exists.