summaryrefslogtreecommitdiffstats
path: root/event.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--event.c87
1 files changed, 10 insertions, 77 deletions
diff --git a/event.c b/event.c
index b31c94f..909012d 100644
--- a/event.c
+++ b/event.c
@@ -16,7 +16,6 @@ static void destroynotify(XEvent *e);
16static void enternotify(XEvent *e); 16static void enternotify(XEvent *e);
17static void leavenotify(XEvent *e); 17static void leavenotify(XEvent *e);
18static void expose(XEvent *e); 18static void expose(XEvent *e);
19static void keypress(XEvent *e);
20static void keymapnotify(XEvent *e); 19static void keymapnotify(XEvent *e);
21static void maprequest(XEvent *e); 20static void maprequest(XEvent *e);
22static void propertynotify(XEvent *e); 21static void propertynotify(XEvent *e);
@@ -47,80 +46,36 @@ flush_masked_events(long even_mask)
47static void 46static void
48configurerequest(XEvent *e) 47configurerequest(XEvent *e)
49{ 48{
50#if 0
51 XConfigureRequestEvent *ev = &e->xconfigurerequest; 49 XConfigureRequestEvent *ev = &e->xconfigurerequest;
52 XWindowChanges wc; 50 XWindowChanges wc;
53 XRectangle *frect;
54 Client *c; 51 Client *c;
55 52
56 c = client_of_win(ev->window); 53 c = getclient(ev->window);
57 ev->value_mask &= ~CWSibling; 54 ev->value_mask &= ~CWSibling;
58 if(c) { 55 if(c) {
59 gravitate_client(c, True);
60
61 if(ev->value_mask & CWX) 56 if(ev->value_mask & CWX)
62 c->rect.x = ev->x; 57 c->r[RFloat].x = ev->x;
63 if(ev->value_mask & CWY) 58 if(ev->value_mask & CWY)
64 c->rect.y = ev->y; 59 c->r[RFloat].y = ev->y;
65 if(ev->value_mask & CWWidth) 60 if(ev->value_mask & CWWidth)
66 c->rect.width = ev->width; 61 c->r[RFloat].width = ev->width;
67 if(ev->value_mask & CWHeight) 62 if(ev->value_mask & CWHeight)
68 c->rect.height = ev->height; 63 c->r[RFloat].height = ev->height;
69 if(ev->value_mask & CWBorderWidth) 64 if(ev->value_mask & CWBorderWidth)
70 c->border = ev->border_width; 65 c->border = ev->border_width;
71
72 gravitate_client(c, False);
73
74 if(c->frame) {
75 if(c->sel->area->floating)
76 frect=&c->sel->rect;
77 else
78 frect=&c->sel->revert;
79
80 if(c->rect.width >= screen->rect.width && c->rect.height >= screen->rect.height) {
81 frect->y = wc.y = -height_of_bar();
82 frect->x = wc.x = -def.border;
83 }
84 else {
85 frect->y = wc.y = c->rect.y - height_of_bar();
86 frect->x = wc.x = c->rect.x - def.border;
87 }
88 frect->width = wc.width = c->rect.width + 2 * def.border;
89 frect->height = wc.height = c->rect.height + def.border
90 + height_of_bar();
91 wc.border_width = 1;
92 wc.sibling = None;
93 wc.stack_mode = ev->detail;
94 if(c->sel->area->view != screen->sel)
95 wc.x += 2 * screen->rect.width;
96 if(c->sel->area->floating) {
97 XConfigureWindow(dpy, c->framewin, ev->value_mask, &wc);
98 configure_client(c);
99 }
100 }
101 } 66 }
102 67
103 wc.x = ev->x; 68 wc.x = ev->x;
104 wc.y = ev->y; 69 wc.y = ev->y;
105 wc.width = ev->width; 70 wc.width = ev->width;
106 wc.height = ev->height; 71 wc.height = ev->height;
107
108 if(c && c->frame) {
109 wc.x = def.border;
110 wc.y = height_of_bar();
111 wc.width = c->sel->rect.width - 2 * def.border;
112 wc.height = c->sel->rect.height - def.border - height_of_bar();
113 }
114
115 wc.border_width = 0; 72 wc.border_width = 0;
116 wc.sibling = None; 73 wc.sibling = None;
117 wc.stack_mode = Above; 74 wc.stack_mode = Above;
118 ev->value_mask &= ~CWStackMode; 75 ev->value_mask &= ~CWStackMode;
119 ev->value_mask |= CWBorderWidth; 76 ev->value_mask |= CWBorderWidth;
120 XConfigureWindow(dpy, ev->window, ev->value_mask, &wc); 77 XConfigureWindow(dpy, ev->window, ev->value_mask, &wc);
121
122 XFlush(dpy); 78 XFlush(dpy);
123#endif
124} 79}
125 80
126static void 81static void
@@ -182,32 +137,6 @@ expose(XEvent *e)
182} 137}
183 138
184static void 139static void
185keypress(XEvent *e)
186{
187#if 0
188 XKeyEvent *ev = &e->xkey;
189 KeySym k = 0;
190 char buf[32];
191 int n;
192 static Frame *f;
193
194
195 ev->state &= valid_mask;
196 if((f = frame_of_win(ev->window))) {
197 buf[0] = 0;
198 n = XLookupString(ev, buf, sizeof(buf), &k, 0);
199 if(IsFunctionKey(k) || IsKeypadKey(k) || IsMiscFunctionKey(k)
200 || IsPFKey(k) || IsPrivateKeypadKey(k))
201 return;
202 buf[n] = 0;
203 blitz_kpress_input(&f->tagbar, ev->state, k, buf);
204 }
205 else
206 key(root, ev->state, (KeyCode) ev->keycode);
207#endif
208}
209
210static void
211keymapnotify(XEvent *e) 140keymapnotify(XEvent *e)
212{ 141{
213#if 0 142#if 0
@@ -231,7 +160,11 @@ maprequest(XEvent *e)
231 } 160 }
232 161
233 /*if(!client_of_win(ev->window))*/ 162 /*if(!client_of_win(ev->window))*/
234 manage(create_client(ev->window, &wa)); 163 /*manage(create_client(ev->window, &wa));*/
164 XMapRaised(dpy, ev->window);
165 XMoveResizeWindow(dpy, ev->window, rect.x, rect.y, rect.width, rect.height - barrect.height);
166 XSetInputFocus(dpy, ev->window, RevertToPointerRoot, CurrentTime);
167 XFlush(dpy);
235} 168}
236 169
237static void 170static void