Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
dwm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6857120
)
floating rules trigger centering too
author
Jason Woofenden
<jason@jasonwoof.com>
Sat, 18 Apr 2015 07:47:23 +0000
(
03:47
-0400)
committer
Jason Woofenden
<jason@jasonwoof.com>
Sat, 18 Apr 2015 07:47:23 +0000
(
03:47
-0400)
dwm.c
patch
|
blob
|
history
diff --git
a/dwm.c
b/dwm.c
index
7b017cb
..
3196192
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);
@@
-1201,8
+1204,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;