aboutsummaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
authorokan2011-09-13 08:41:57 +0000
committerokan2011-09-13 08:41:57 +0000
commit49ed7ec7f6a405208cc11e0f98a4455df6707d13 (patch)
tree0f7d22da581d049aebc24feffae8c53e739487e5 /client.c
parentdb10c1c1a927983fc1a37dff141f42fb0a3cbad6 (diff)
downloadcwm-49ed7ec7f6a405208cc11e0f98a4455df6707d13.tar.gz
add WM_TRANSIENT_FOR event support: moves dialogs, toolbars and such to
the group of the main application window; based on a diff from Alexander Polakov with CLIENT_IGNORE flag suggestion from oga@. ok oga@
Diffstat (limited to '')
-rw-r--r--client.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/client.c b/client.c
index 327f966..2cb0b1e 100644
--- a/client.c
+++ b/client.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: client.c,v 1.90 2011/09/05 07:37:55 okan Exp $
+ * $OpenBSD: client.c,v 1.91 2011/09/13 08:41:57 okan Exp $
*/
#include <sys/param.h>
@@ -113,6 +113,8 @@ client_new(Window win, struct screen_ctx *sc, int mapped)
XAddToSaveSet(X_Dpy, cc->win);
+ client_transient(cc);
+
/* Notify client of its configuration. */
xu_configure(cc);
@@ -869,6 +871,21 @@ client_freehints(struct client_ctx *cc)
XFree(cc->app_class);
}
+void
+client_transient(struct client_ctx *cc)
+{
+ struct client_ctx *tc;
+ Window trans;
+
+ if (XGetTransientForHint(X_Dpy, cc->win, &trans)) {
+ if ((tc = client_find(trans)) && tc->group) {
+ group_movetogroup(cc, tc->group->shortcut - 1);
+ if (tc->flags & CLIENT_IGNORE)
+ cc->flags |= CLIENT_IGNORE;
+ }
+ }
+}
+
static int
client_inbound(struct client_ctx *cc, int x, int y)
{