Xinqi Bao's Git
projects
/
dwm.git
/ commitdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
|
inline
| side by side (parent:
67bc08d
)
added configure(), but this doesn't really fix those frking broken SDL apps
author
arg@mmvi <unknown>
Tue, 26 Sep 2006 05:40:19 +0000
(07:40 +0200)
committer
arg@mmvi <unknown>
Tue, 26 Sep 2006 05:40:19 +0000
(07:40 +0200)
client.c
patch
|
blob
|
history
dwm.h
patch
|
blob
|
history
event.c
patch
|
blob
|
history
diff --git
a/client.c
b/client.c
index
d5bc30e
..
87c2f76
100644
(file)
--- a/
client.c
+++ b/
client.c
@@
-80,6
+80,23
@@
ban(Client *c) {
XMoveWindow(dpy, c->twin, c->tx + 2 * sw, c->ty);
}
XMoveWindow(dpy, c->twin, c->tx + 2 * sw, c->ty);
}
+void
+configure(Client *c) {
+ XEvent synev;
+
+ synev.type = ConfigureNotify;
+ synev.xconfigure.display = dpy;
+ synev.xconfigure.event = c->win;
+ synev.xconfigure.window = c->win;
+ synev.xconfigure.x = c->x;
+ synev.xconfigure.y = c->y;
+ synev.xconfigure.width = c->w;
+ synev.xconfigure.height = c->h;
+ synev.xconfigure.border_width = c->border;
+ synev.xconfigure.above = None;
+ XSendEvent(dpy, c->win, True, NoEventMask, &synev);
+}
+
void
focus(Client *c) {
Client *old;
void
focus(Client *c) {
Client *old;
@@
-299,6
+316,7
@@
resize(Client *c, Bool sizehints, Corner sticky) {
else
wc.border_width = 1;
XConfigureWindow(dpy, c->win, CWX | CWY | CWWidth | CWHeight | CWBorderWidth, &wc);
else
wc.border_width = 1;
XConfigureWindow(dpy, c->win, CWX | CWY | CWWidth | CWHeight | CWBorderWidth, &wc);
+ configure(c);
XSync(dpy, False);
}
XSync(dpy, False);
}
diff --git
a/dwm.h
b/dwm.h
index
c30f2b3
..
269c78e
100644
(file)
--- a/
dwm.h
+++ b/
dwm.h
@@
-109,6
+109,7
@@
extern Window root, barwin;
/* client.c */
extern void ban(Client *c); /* ban c from screen */
/* client.c */
extern void ban(Client *c); /* ban c from screen */
+extern void configure(Client *c); /* send synthetic configure event */
extern void focus(Client *c); /* focus c, c may be NULL */
extern Client *getclient(Window w); /* return client of w */
extern Client *getctitle(Window w); /* return client of title window */
extern void focus(Client *c); /* focus c, c may be NULL */
extern Client *getclient(Window w); /* return client of w */
extern Client *getctitle(Window w); /* return client of title window */
diff --git
a/event.c
b/event.c
index
cf89428
..
50c59a0
100644
(file)
--- a/
event.c
+++ b/
event.c
@@
-1,3
+1,4
@@
+#include <stdio.h>
/*
* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
* See LICENSE file for license details.
/*
* (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
* See LICENSE file for license details.
@@
-38,6
+39,7
@@
movemouse(Client *c) {
XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev);
switch (ev.type) {
case ButtonRelease:
XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev);
switch (ev.type) {
case ButtonRelease:
+ resize(c, True, TopLeft);
XUngrabPointer(dpy, CurrentTime);
return;
case Expose:
XUngrabPointer(dpy, CurrentTime);
return;
case Expose:
@@
-71,6
+73,7
@@
resizemouse(Client *c) {
XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev);
switch(ev.type) {
case ButtonRelease:
XMaskEvent(dpy, MOUSEMASK | ExposureMask, &ev);
switch(ev.type) {
case ButtonRelease:
+ resize(c, True, TopLeft);
XUngrabPointer(dpy, CurrentTime);
return;
case Expose:
XUngrabPointer(dpy, CurrentTime);
return;
case Expose:
@@
-151,6
+154,7
@@
configurerequest(XEvent *e) {
XEvent synev;
XWindowChanges wc;
XEvent synev;
XWindowChanges wc;
+ fputs("configurerequest\n", stderr);
if((c = getclient(ev->window))) {
c->ismax = False;
gravitate(c, True);
if((c = getclient(ev->window))) {
c->ismax = False;
gravitate(c, True);
@@
-172,19
+176,8
@@
configurerequest(XEvent *e) {
newmask = ev->value_mask & (~(CWSibling | CWStackMode | CWBorderWidth));
if(newmask)
XConfigureWindow(dpy, c->win, newmask, &wc);
newmask = ev->value_mask & (~(CWSibling | CWStackMode | CWBorderWidth));
if(newmask)
XConfigureWindow(dpy, c->win, newmask, &wc);
- else {
- synev.type = ConfigureNotify;
- synev.xconfigure.display = dpy;
- synev.xconfigure.event = c->win;
- synev.xconfigure.window = c->win;
- synev.xconfigure.x = c->x;
- synev.xconfigure.y = c->y;
- synev.xconfigure.width = c->w;
- synev.xconfigure.height = c->h;
- synev.xconfigure.border_width = c->border;
- synev.xconfigure.above = None;
- XSendEvent(dpy, c->win, True, NoEventMask, &synev);
- }
+ else
+ configure(c);
XSync(dpy, False);
if(c->isfloat)
resize(c, False, TopLeft);
XSync(dpy, False);
if(c->isfloat)
resize(c, False, TopLeft);
@@
-218,6
+211,7
@@
enternotify(XEvent *e) {
Client *c;
XCrossingEvent *ev = &e->xcrossing;
Client *c;
XCrossingEvent *ev = &e->xcrossing;
+ fputs("enternotify\n", stderr);
if(ev->mode != NotifyNormal || ev->detail == NotifyInferior)
return;
if(ev->mode != NotifyNormal || ev->detail == NotifyInferior)
return;
@@
-305,6
+299,7
@@
propertynotify(XEvent *e) {
Window trans;
XPropertyEvent *ev = &e->xproperty;
Window trans;
XPropertyEvent *ev = &e->xproperty;
+ fputs("propertynotify\n", stderr);
if(ev->state == PropertyDelete)
return; /* ignore */
if(ev->state == PropertyDelete)
return; /* ignore */