struct Client* col_next;
struct Client* col_prev;
char* name;
- Window frame, win;
+ Window frame, win, transient_for;
int state, flags, wspace, x, y, w, h, rel_x, rel_y;
long hint_flags, wm_flags;
XWMHints hints;
// TODO: Read the class and instance of the window
/* WM_TRANSIENT_FOR - marks the window as a pop-up for another window */
- // TODO: read the transient_for property and use ti to handle pop-ups better
+ c->transient_for = None;
+ XGetTransientForHint(X.disp, c->win, &(c->transient_for));
/* WM_CLIENT_MACHINE - */
// TODO: read client machine property
/* check if the window is a dialog */
XGetWindowProperty(
X.disp, c->win, _NET_WM_WINDOW_TYPE, 0L, -1, False, XA_ATOM, &actual_type, &format, &n, &extra, (unsigned char **)&wintype);
- if (wintype && *wintype == _NET_WM_WINDOW_TYPE_DIALOG)
+ if ((wintype && *wintype == _NET_WM_WINDOW_TYPE_DIALOG) || (c->transient_for != None))
{
c->flags |= F_DIALOG|F_FLOATING;
}
int top = max(ctop, mon->y);
int bot = min(cbot, mon->y + mon->h);
-
/* return the overlapped area */
int area = 0;
if (left < right && top < bot)