dwm-meillo
diff event.c @ 9:d567f430a81d
fixed several stuff (gridwm gets better and better)
author | Anselm R. Garbe <garbeam@wmii.de> |
---|---|
date | Tue, 11 Jul 2006 12:52:57 +0200 |
parents | e0cefb3981c8 |
children | 703255003abb |
line diff
1.1 --- a/event.c Tue Jul 11 11:50:18 2006 +0200 1.2 +++ b/event.c Tue Jul 11 12:52:57 2006 +0200 1.3 @@ -16,7 +16,6 @@ 1.4 static void enternotify(XEvent *e); 1.5 static void leavenotify(XEvent *e); 1.6 static void expose(XEvent *e); 1.7 -static void keypress(XEvent *e); 1.8 static void keymapnotify(XEvent *e); 1.9 static void maprequest(XEvent *e); 1.10 static void propertynotify(XEvent *e); 1.11 @@ -47,80 +46,36 @@ 1.12 static void 1.13 configurerequest(XEvent *e) 1.14 { 1.15 -#if 0 1.16 XConfigureRequestEvent *ev = &e->xconfigurerequest; 1.17 XWindowChanges wc; 1.18 - XRectangle *frect; 1.19 Client *c; 1.20 1.21 - c = client_of_win(ev->window); 1.22 + c = getclient(ev->window); 1.23 ev->value_mask &= ~CWSibling; 1.24 if(c) { 1.25 - gravitate_client(c, True); 1.26 - 1.27 if(ev->value_mask & CWX) 1.28 - c->rect.x = ev->x; 1.29 + c->r[RFloat].x = ev->x; 1.30 if(ev->value_mask & CWY) 1.31 - c->rect.y = ev->y; 1.32 + c->r[RFloat].y = ev->y; 1.33 if(ev->value_mask & CWWidth) 1.34 - c->rect.width = ev->width; 1.35 + c->r[RFloat].width = ev->width; 1.36 if(ev->value_mask & CWHeight) 1.37 - c->rect.height = ev->height; 1.38 + c->r[RFloat].height = ev->height; 1.39 if(ev->value_mask & CWBorderWidth) 1.40 c->border = ev->border_width; 1.41 - 1.42 - gravitate_client(c, False); 1.43 - 1.44 - if(c->frame) { 1.45 - if(c->sel->area->floating) 1.46 - frect=&c->sel->rect; 1.47 - else 1.48 - frect=&c->sel->revert; 1.49 - 1.50 - if(c->rect.width >= screen->rect.width && c->rect.height >= screen->rect.height) { 1.51 - frect->y = wc.y = -height_of_bar(); 1.52 - frect->x = wc.x = -def.border; 1.53 - } 1.54 - else { 1.55 - frect->y = wc.y = c->rect.y - height_of_bar(); 1.56 - frect->x = wc.x = c->rect.x - def.border; 1.57 - } 1.58 - frect->width = wc.width = c->rect.width + 2 * def.border; 1.59 - frect->height = wc.height = c->rect.height + def.border 1.60 - + height_of_bar(); 1.61 - wc.border_width = 1; 1.62 - wc.sibling = None; 1.63 - wc.stack_mode = ev->detail; 1.64 - if(c->sel->area->view != screen->sel) 1.65 - wc.x += 2 * screen->rect.width; 1.66 - if(c->sel->area->floating) { 1.67 - XConfigureWindow(dpy, c->framewin, ev->value_mask, &wc); 1.68 - configure_client(c); 1.69 - } 1.70 - } 1.71 } 1.72 1.73 wc.x = ev->x; 1.74 wc.y = ev->y; 1.75 wc.width = ev->width; 1.76 wc.height = ev->height; 1.77 - 1.78 - if(c && c->frame) { 1.79 - wc.x = def.border; 1.80 - wc.y = height_of_bar(); 1.81 - wc.width = c->sel->rect.width - 2 * def.border; 1.82 - wc.height = c->sel->rect.height - def.border - height_of_bar(); 1.83 - } 1.84 - 1.85 wc.border_width = 0; 1.86 wc.sibling = None; 1.87 wc.stack_mode = Above; 1.88 ev->value_mask &= ~CWStackMode; 1.89 ev->value_mask |= CWBorderWidth; 1.90 XConfigureWindow(dpy, ev->window, ev->value_mask, &wc); 1.91 - 1.92 XFlush(dpy); 1.93 -#endif 1.94 } 1.95 1.96 static void 1.97 @@ -182,32 +137,6 @@ 1.98 } 1.99 1.100 static void 1.101 -keypress(XEvent *e) 1.102 -{ 1.103 -#if 0 1.104 - XKeyEvent *ev = &e->xkey; 1.105 - KeySym k = 0; 1.106 - char buf[32]; 1.107 - int n; 1.108 - static Frame *f; 1.109 - 1.110 - 1.111 - ev->state &= valid_mask; 1.112 - if((f = frame_of_win(ev->window))) { 1.113 - buf[0] = 0; 1.114 - n = XLookupString(ev, buf, sizeof(buf), &k, 0); 1.115 - if(IsFunctionKey(k) || IsKeypadKey(k) || IsMiscFunctionKey(k) 1.116 - || IsPFKey(k) || IsPrivateKeypadKey(k)) 1.117 - return; 1.118 - buf[n] = 0; 1.119 - blitz_kpress_input(&f->tagbar, ev->state, k, buf); 1.120 - } 1.121 - else 1.122 - key(root, ev->state, (KeyCode) ev->keycode); 1.123 -#endif 1.124 -} 1.125 - 1.126 -static void 1.127 keymapnotify(XEvent *e) 1.128 { 1.129 #if 0 1.130 @@ -231,7 +160,11 @@ 1.131 } 1.132 1.133 /*if(!client_of_win(ev->window))*/ 1.134 - manage(create_client(ev->window, &wa)); 1.135 + /*manage(create_client(ev->window, &wa));*/ 1.136 + XMapRaised(dpy, ev->window); 1.137 + XMoveResizeWindow(dpy, ev->window, rect.x, rect.y, rect.width, rect.height - barrect.height); 1.138 + XSetInputFocus(dpy, ev->window, RevertToPointerRoot, CurrentTime); 1.139 + XFlush(dpy); 1.140 } 1.141 1.142 static void