aboutsummaryrefslogtreecommitdiff
path: root/dminiwm.c
diff options
context:
space:
mode:
authorIvan Kanakarakis <ivan.kanak@gmail.com>2011-12-11 00:36:32 +0200
committerIvan Kanakarakis <ivan.kanak@gmail.com>2011-12-11 00:36:32 +0200
commitc39514d9d22870775c15270569156b15da869a19 (patch)
treef257d5fbac96256d0560106ef630882e550cd584 /dminiwm.c
parentea2c3a0eb42558b5bd7e5ab709039904ab372aa9 (diff)
minor changes - comments formatting naming - on maprequest() function
Diffstat (limited to 'dminiwm.c')
-rw-r--r--dminiwm.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/dminiwm.c b/dminiwm.c
index b99540b..fdfbf4f 100644
--- a/dminiwm.c
+++ b/dminiwm.c
@@ -571,33 +571,30 @@ void maprequest(XEvent *e) {
}
/* window type is not normal (_NET_WM_WINDOW_TYPE_NORMAL) */
- unsigned long count, j, extra;
+ Atom realType, *wintype;
int realFormat;
- unsigned char *temp;
- Atom realType, *type;
+ unsigned long count, extra;
+ unsigned char *data;
if(XGetWindowProperty(dis, ev->window, atoms[_NET_WM_WINDOW_TYPE], 0, 32, False,
- XA_ATOM, &realType, &realFormat, &count, &extra, &temp) == Success) {
- if(count > 0) {
- type = (unsigned long*)temp;
- for(j=0; j<count; j++) {
- if( type[j] == atoms[_NET_WM_WINDOW_TYPE_UTILITY] ||
- type[j] == atoms[_NET_WM_WINDOW_TYPE_NOTIFICATION] ||
- type[j] == atoms[_NET_WM_WINDOW_TYPE_SPLASH] ||
- type[j] == atoms[_NET_WM_WINDOW_TYPE_DIALOG] ||
- type[j] == atoms[_NET_WM_WINDOW_TYPE_DOCK] ){
+ XA_ATOM, &realType, &realFormat, &count, &extra, &data) == Success)
+ if(realType == XA_ATOM && count) {
+ wintype = (unsigned long *)data;
+ if(data) XFree(data);
+ for(int i=0; i<count; i++)
+ if(wintype[i] == atoms[_NET_WM_WINDOW_TYPE_UTILITY] ||
+ wintype[i] == atoms[_NET_WM_WINDOW_TYPE_NOTIFICATION] ||
+ wintype[i] == atoms[_NET_WM_WINDOW_TYPE_SPLASH] ||
+ wintype[i] == atoms[_NET_WM_WINDOW_TYPE_DIALOG] ||
+ wintype[i] == atoms[_NET_WM_WINDOW_TYPE_DOCK] ){
add_window(ev->window);
XMapWindow(dis, ev->window);
XSetInputFocus(dis, ev->window, RevertToParent, CurrentTime);
XRaiseWindow(dis, ev->window);
- if(temp)
- XFree(temp);
return;
}
- }
}
- }
- /* rule has been set for window */
+ /* window is normal and has a rule set */
XClassHint ch = {0};
int cd = current_desktop;
if(XGetClassHint(dis, ev->window, &ch))
@@ -616,6 +613,7 @@ void maprequest(XEvent *e) {
return;
}
+ /* window is normal and has no rule set */
add_window(ev->window);
XMapWindow(dis, ev->window);
tile();