mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
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@
This commit is contained in:
parent
b96caa16e6
commit
796b32123d
1
calmwm.h
1
calmwm.h
@ -328,6 +328,7 @@ void client_send_delete(struct client_ctx *);
|
||||
void client_setactive(struct client_ctx *, int);
|
||||
void client_setname(struct client_ctx *);
|
||||
int client_snapcalc(int, int, int, int, int);
|
||||
void client_transient(struct client_ctx *);
|
||||
void client_unhide(struct client_ctx *);
|
||||
void client_vertmaximize(struct client_ctx *);
|
||||
void client_warp(struct client_ctx *);
|
||||
|
17
client.c
17
client.c
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user