summaryrefslogtreecommitdiffstats
path: root/event.c
diff options
context:
space:
mode:
authorarg@10ksloc.org <unknown>2006-08-02 16:32:05 +0200
committerarg@10ksloc.org <unknown>2006-08-02 16:32:05 +0200
commit95e8d12b7189d4cd01b8ae8ecebfa5835a1809e6 (patch)
tree98283068f4576b8b2e825dd5eff0eb6e94ddbdc0 /event.c
parentnew stuff (diff)
downloaddwm-95e8d12b7189d4cd01b8ae8ecebfa5835a1809e6.tar.gz
dwm-95e8d12b7189d4cd01b8ae8ecebfa5835a1809e6.zip
made fullscreen apps working fine in floating mode (there is no sane way to make them work in tiled mode, thus I switch to floating mode if I run such kind of app), also fixed the xterm issue reported by Sander
Diffstat (limited to 'event.c')
-rw-r--r--event.c65
1 files changed, 46 insertions, 19 deletions
diff --git a/event.c b/event.c
index faee103..0c159c7 100644
--- a/event.c
+++ b/event.c
@@ -3,7 +3,6 @@
3 * See LICENSE file for license details. 3 * See LICENSE file for license details.
4 */ 4 */
5#include "dwm.h" 5#include "dwm.h"
6
7#include <stdlib.h> 6#include <stdlib.h>
8#include <X11/keysym.h> 7#include <X11/keysym.h>
9#include <X11/Xatom.h> 8#include <X11/Xatom.h>
@@ -151,32 +150,60 @@ configurerequest(XEvent *e)
151{ 150{
152 Client *c; 151 Client *c;
153 XConfigureRequestEvent *ev = &e->xconfigurerequest; 152 XConfigureRequestEvent *ev = &e->xconfigurerequest;
153 XEvent synev;
154 XWindowChanges wc; 154 XWindowChanges wc;
155 unsigned long newmask;
155 156
156 ev->value_mask &= ~CWSibling;
157 if((c = getclient(ev->window))) { 157 if((c = getclient(ev->window))) {
158 gravitate(c, True); 158 gravitate(c, True);
159 if(ev->value_mask & CWX) 159 if(c->isfloat) {
160 c->x = ev->x; 160 if(ev->value_mask & CWX)
161 if(ev->value_mask & CWY) 161 c->x = ev->x;
162 c->y = ev->y; 162 if(ev->value_mask & CWY)
163 if(ev->value_mask & CWWidth) 163 c->y = ev->y;
164 c->w = ev->width; 164 if(ev->value_mask & CWWidth)
165 if(ev->value_mask & CWHeight) 165 c->w = ev->width;
166 c->h = ev->height; 166 if(ev->value_mask & CWHeight)
167 c->h = ev->height;
168 }
167 if(ev->value_mask & CWBorderWidth) 169 if(ev->value_mask & CWBorderWidth)
168 c->border = 1; 170 c->border = ev->border_width;
169 gravitate(c, False); 171 gravitate(c, False);
172
170 resize(c, True, TopLeft); 173 resize(c, True, TopLeft);
171 }
172 174
173 wc.x = ev->x; 175 wc.x = c->x;
174 wc.y = ev->y; 176 wc.y = c->y;
175 wc.width = ev->width; 177 wc.width = c->w;
176 wc.height = ev->height; 178 wc.height = c->h;
177 wc.border_width = 1; 179 newmask = ev->value_mask & (~(CWSibling | CWStackMode | CWBorderWidth));
178 XConfigureWindow(dpy, ev->window, 180 if(newmask)
179 CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc); 181 XConfigureWindow(dpy, c->win, newmask, &wc);
182 else {
183 synev.type = ConfigureNotify;
184 synev.xconfigure.display = dpy;
185 synev.xconfigure.event = c->win;
186 synev.xconfigure.window = c->win;
187 synev.xconfigure.x = c->x;
188 synev.xconfigure.y = c->y;
189 synev.xconfigure.width = c->w;
190 synev.xconfigure.height = c->h;
191 synev.xconfigure.border_width = c->border;
192 synev.xconfigure.above = None;
193 /* Send synthetic ConfigureNotify */
194 XSendEvent(dpy, c->win, True, NoEventMask, &synev);
195 }
196 }
197 else {
198 wc.x = ev->x;
199 wc.y = ev->y;
200 wc.width = ev->width;
201 wc.height = ev->height;
202 wc.border_width = ev->border_width;
203 wc.sibling = ev->above;
204 wc.stack_mode = ev->detail;
205 XConfigureWindow(dpy, ev->window, ev->value_mask, &wc);
206 }
180 XSync(dpy, False); 207 XSync(dpy, False);
181} 208}
182 209