66 int i, n, twidth, width, height;
68 unsigned int wwidth, wheight, bw, depth;
73 unsigned long nitems, bytesafter;
77 XRectangle logical_rect;
89 if(n > (INFO_LINES - 3)) { \
90 fprintf(stderr, "Overflowing Info[] on line %d\n", n); \
91 sprintf(Info[n++], "(overflow)"); \
115 &wwidth, &wheight, &
JunkBW, &depth);
117 XTranslateCoordinates(
dpy, t->
w,
Scr->Root, 0, 0,
131 "Geometry/root (UL) = %dx%d+%d+%d (Inner: %dx%d+%d+%d)",
136 wwidth, wheight,
x,
y);
139 "Geometry/root (LR) = %dx%d-%d-%d (Inner: %dx%d-%d-%d)",
145 Scr->rootw - (
x + wwidth),
Scr->rooth - (
y + wheight));
164 if(t->
icon != NULL) {
168 &wwidth, &wheight, &bw, &depth);
171 snprintf(
Info[n++],
INFO_SIZE,
"IconGeom/root = %dx%d+%d+%d",
172 wwidth, wheight, iwx, iwy);
174 snprintf(
Info[n++],
INFO_SIZE,
"IconGeom/intern = %dx%d+%d+%d",
184 if(XGetWindowProperty(
dpy, t->
w, XA_WM_CLIENT_MACHINE, 0L, 64, False,
185 XA_STRING, &actual_type, &actual_format, &nitems,
186 &bytesafter, &prop) == Success) {
208 height = n * (
Scr->DefaultFont.height + 2);
210 for(i = 0; i < n; i++) {
211 XmbTextExtents(
Scr->DefaultFont.font_set,
Info[i],
212 strlen(
Info[i]), &inc_rect, &logical_rect);
214 twidth = logical_rect.width;
221 if(
Scr->InfoWindow.mapped) {
222 XUnmapWindow(
dpy,
Scr->InfoWindow.win);
224 Scr->InfoWindow.mapped =
false;
228 Scr->InfoWindow.lines = n;
233 &dummy, &dummy, &px, &py, &udummy)) {
243 int min_x, min_y, max_bottom, max_right;
249 else if(px + width - 1 > max_right) {
250 px = max_right - width + 1;
257 else if(py + height - 1 > max_bottom) {
258 py = max_bottom - height + 1;
261 XMoveResizeWindow(
dpy,
Scr->InfoWindow.win, px, py, width, height);
262 XMapRaised(
dpy,
Scr->InfoWindow.win);
263 Scr->InfoWindow.mapped =
true;
264 Scr->InfoWindow.width = width;
265 Scr->InfoWindow.height = height;
void Draw3DBorder(Window w, int x, int y, int width, int height, int bw, ColorPair cp, ButtonState state, bool fill, bool forcebw)
RArea RAreaNew(int x, int y, int width, int height)
Construct an RArea from given components.
void RLayoutFindTopBottomEdges(const RLayout *self, const RArea *area, int *top, int *bottom)
Figure the position (or nearest practical position) of an area in our screen layout,...
void RLayoutFindLeftRightEdges(const RLayout *self, const RArea *area, int *left, int *right)
Figure the position (or nearest practical position) of an area in our screen layout,...