Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
dwm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove unused variable
[dwm.git]
/
dwm.c
diff --git
a/dwm.c
b/dwm.c
index
7b017cb
..
b7f5a26
100644
(file)
--- a/
dwm.c
+++ b/
dwm.c
@@
-364,6
+364,9
@@
applyrules(Client *c) {
&& (!r->instance || strstr(instance, r->instance)))
{
c->isfloating = r->isfloating;
&& (!r->instance || strstr(instance, r->instance)))
{
c->isfloating = r->isfloating;
+ if(r->isfloating) {
+ c->x = -1; c->y = -2; // secret code for centered
+ }
c->tags |= r->tags;
c->screen_hog = r->screen_hog;
for(m = mons; m && m->num != r->monitor; m = m->next);
c->tags |= r->tags;
c->screen_hog = r->screen_hog;
for(m = mons; m && m->num != r->monitor; m = m->next);
@@
-488,7
+491,7
@@
attachstack(Client *c) {
void
buttonpress(XEvent *e) {
void
buttonpress(XEvent *e) {
- unsigned int i, x, click;
+ unsigned int i, click;
Arg arg = {0};
Client *c;
Monitor *m;
Arg arg = {0};
Client *c;
Monitor *m;
@@
-502,20
+505,7
@@
buttonpress(XEvent *e) {
focus(NULL);
}
if(ev->window == selmon->barwin) {
focus(NULL);
}
if(ev->window == selmon->barwin) {
- i = x = 0;
- do
- x += TEXTW(tags[i]);
- while(ev->x >= x && ++i < LENGTH(tags));
- if(i < LENGTH(tags)) {
- click = ClkTagBar;
- arg.ui = 1 << i;
- }
- else if(ev->x < x + blw)
- click = ClkLtSymbol;
- else if(ev->x > selmon->ww - TEXTW(stext))
- click = ClkStatusText;
- else
- click = ClkWinTitle;
+ return;
}
else if((c = wintoclient(ev->window))) {
focus(c);
}
else if((c = wintoclient(ev->window))) {
focus(c);
@@
-1201,8
+1191,13
@@
manage(Window w, XWindowAttributes *wa) {
applyrules(c);
}
/* geometry */
applyrules(c);
}
/* geometry */
- c->x = c->oldx = wa->x;
- c->y = c->oldy = wa->y;
+ if(c->x == -1 && c->y == -2) { // secret code for centered
+ c->x = c->oldx = (c->mon->ww - wa->width) / 2;
+ c->y = c->oldy = (c->mon->wh - wa->height) / 2;
+ } else {
+ c->x = c->oldx = wa->x;
+ c->y = c->oldy = wa->y;
+ }
c->w = c->oldw = wa->width;
c->h = c->oldh = wa->height;
c->oldbw = wa->border_width;
c->w = c->oldw = wa->width;
c->h = c->oldh = wa->height;
c->oldbw = wa->border_width;
@@
-1243,6
+1238,7
@@
manage(Window w, XWindowAttributes *wa) {
XMapWindow(dpy, c->win);
focus(c);
if(key_buffering) {
XMapWindow(dpy, c->win);
focus(c);
if(key_buffering) {
+ // FIXME: try turning off buffering below where we send the virt keypresses
key_buffering = False;
grabkeys(); // stop grabbing typing keys
if(key_buffer_len > 0) {
key_buffering = False;
grabkeys(); // stop grabbing typing keys
if(key_buffer_len > 0) {
@@
-1251,6
+1247,7
@@
manage(Window w, XWindowAttributes *wa) {
}
}
key_buffer_len = 0;
}
}
key_buffer_len = 0;
+ // FIXME ie here
}
}
}
}