diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/globals.c | 2 | ||||
-rw-r--r-- | src/globals.h | 6 | ||||
-rw-r--r-- | src/main.c | 2 | ||||
-rw-r--r-- | src/manage.c | 29 |
4 files changed, 37 insertions, 2 deletions
diff --git a/src/globals.c b/src/globals.c index 91467c3..5f21148 100644 --- a/src/globals.c +++ b/src/globals.c @@ -50,6 +50,8 @@ Atom rp_selection; /* netwm atoms */ Atom _net_wm_pid; Atom _net_supported; +Atom _net_wm_window_type; +Atom _net_wm_window_type_dialog; int rp_current_screen; rp_screen *screens; diff --git a/src/globals.h b/src/globals.h index 2f0126f..b7aaa00 100644 --- a/src/globals.h +++ b/src/globals.h @@ -114,8 +114,10 @@ extern Atom wm_take_focus; extern Atom wm_colormaps; /* netwm atoms. */ -Atom _net_wm_pid; -Atom _net_supported; +extern Atom _net_wm_pid; +extern Atom _net_supported; +extern Atom _net_wm_window_type; +extern Atom _net_wm_window_type_dialog; /* mouse properties */ extern int rat_x; @@ -685,6 +685,8 @@ main (int argc, char *argv[]) PRINT_DEBUG (("_NET_WM_PID = %ld\n", _net_wm_pid)); _net_supported = XInternAtom(dpy, "_NET_SUPPORTED", False); PRINT_DEBUG (("_NET_SUPPORTED = %ld\n", _net_supported)); + _net_wm_window_type = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE", False); + _net_wm_window_type_dialog = XInternAtom(dpy, "_NET_WM_WINDOW_TYPE_DIALOG", False); /* Setup signal handlers. */ XSetErrorHandler(handler); diff --git a/src/manage.c b/src/manage.c index 1b12c58..8bad332 100644 --- a/src/manage.c +++ b/src/manage.c @@ -317,6 +317,32 @@ window_is_transient (rp_window *win) ; } +static Atom +get_net_wm_window_type (rp_window *win) +{ + Atom type, window_type = None; + int format; + unsigned long nitems; + unsigned long bytes_left; + unsigned char *data; + + if (win == NULL) + return None; + + if (XGetWindowProperty (dpy, win->w, _net_wm_window_type, 0, 1L, + False, XA_ATOM, &type, &format, + &nitems, &bytes_left, + &data) == Success && nitems > 0) + { + window_type = *(Atom *)data; + PRINT_DEBUG(("hey ya %ld %ld\n", window_type, _net_wm_window_type_dialog)); + } + XFree (data); + + return window_type; +} + + void update_window_information (rp_window *win) { @@ -339,6 +365,9 @@ update_window_information (rp_window *win) /* Transient status */ win->transient = XGetTransientForHint (dpy, win->w, &win->transient_for); + if (get_net_wm_window_type(win) == _net_wm_window_type_dialog) + win->transient = 1; + update_window_gravity (win); } |