Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
spectrwm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
840cd60
)
center floaters
author
Marco Peereboom
<marco@conformal.com>
Wed, 14 Jan 2009 22:21:52 +0000
(22:21 +0000)
committer
Marco Peereboom
<marco@conformal.com>
Wed, 14 Jan 2009 22:21:52 +0000
(22:21 +0000)
scrotwm.c
patch
|
blob
|
history
diff --git
a/scrotwm.c
b/scrotwm.c
index
b8dca30
..
5890eab
100644
(file)
--- a/
scrotwm.c
+++ b/
scrotwm.c
@@
-140,6
+140,7
@@
struct ws_win {
int height;
int floating;
int transient;
int height;
int floating;
int transient;
+ XWindowAttributes wa;
};
TAILQ_HEAD(ws_win_list, ws_win);
};
TAILQ_HEAD(ws_win_list, ws_win);
@@
-540,8
+541,13
@@
stack(void)
win->height = wc.height = h;
mask = CWX | CWY | CWWidth | CWHeight | CWBorderWidth;
} else {
win->height = wc.height = h;
mask = CWX | CWY | CWWidth | CWHeight | CWBorderWidth;
} else {
- win->x = wc.x = width / 2;
- win->y = wc.y = height / 2;
+ /* make sure we don't clobber the screen */
+ if (win->wa.width > width)
+ win->wa.width = width;
+ if (win->wa.height > height)
+ win->wa.width = height;
+ win->x = wc.x = (width - win->wa.width) / 2;
+ win->y = wc.y = (height - win->wa.height) / 2;
mask = CWX | CWY | CWBorderWidth;
}
XConfigureWindow(display, win->id, mask, &wc);
mask = CWX | CWY | CWBorderWidth;
}
XConfigureWindow(display, win->id, mask, &wc);
@@
-764,6
+770,7
@@
configurerequest(XEvent *e)
DNPRINTF(SWM_D_MISC, "configurerequest: win %u transient %u\n",
(unsigned)win->id, win->transient);
}
DNPRINTF(SWM_D_MISC, "configurerequest: win %u transient %u\n",
(unsigned)win->id, win->transient);
}
+ XGetWindowAttributes(display, win->id, &win->wa);
#if 0
XClassHint ch = { 0 };
if(XGetClassHint(display, win->id, &ch)) {
#if 0
XClassHint ch = { 0 };
if(XGetClassHint(display, win->id, &ch)) {