+static void prompt_resize(ObPrompt *self, gint w, gint h)
+{
+ XConfigureRequestEvent req;
+ XSizeHints hints;
+
+ self->width = w;
+ self->height = h;
+
+ /* the user can't resize the prompt */
+ hints.flags = PMinSize | PMaxSize;
+ hints.min_width = hints.max_width = w;
+ hints.min_height = hints.max_height = h;
+ XSetWMNormalHints(obt_display, self->super.window, &hints);
+
+ if (self->mapped) {
+ /* send a configure request like a normal client would */
+ req.type = ConfigureRequest;
+ req.display = obt_display;
+ req.parent = obt_root(ob_screen);
+ req.window = self->super.window;
+ req.width = w;
+ req.height = h;
+ req.value_mask = CWWidth | CWHeight;
+ XSendEvent(req.display, req.window, FALSE, StructureNotifyMask,
+ (XEvent*)&req);
+ }
+ else
+ XResizeWindow(obt_display, self->super.window, w, h);
+}
+
+static void setup_button_focus_tex(ObPromptElement *e, RrAppearance *a,
+ gboolean on)
+{
+ gint i, l, r, t, b;
+
+ for (i = 1; i < 5; ++i)
+ a->texture[i].type = on ? RR_TEXTURE_LINE_ART : RR_TEXTURE_NONE;
+
+ if (!on) return;
+
+ RrMargins(a, &l, &t, &r, &b);
+ l += MIN(BUTTON_HMARGIN, BUTTON_VMARGIN) / 2;
+ r += MIN(BUTTON_HMARGIN, BUTTON_VMARGIN) / 2;
+ t += MIN(BUTTON_HMARGIN, BUTTON_VMARGIN) / 2;
+ b += MIN(BUTTON_HMARGIN, BUTTON_VMARGIN) / 2;
+
+ /* top line */
+ a->texture[1].data.lineart.x1 = l;
+ a->texture[1].data.lineart.x2 = e->width - r - 1;
+ a->texture[1].data.lineart.y1 = t;
+ a->texture[1].data.lineart.y2 = t;
+
+ /* bottom line */
+ a->texture[2].data.lineart.x1 = l;
+ a->texture[2].data.lineart.x2 = e->width - r - 1;
+ a->texture[2].data.lineart.y1 = e->height - b - 1;
+ a->texture[2].data.lineart.y2 = e->height - b - 1;
+
+ /* left line */
+ a->texture[3].data.lineart.x1 = l;
+ a->texture[3].data.lineart.x2 = l;
+ a->texture[3].data.lineart.y1 = t;
+ a->texture[3].data.lineart.y2 = e->height - b - 1;
+
+ /* right line */
+ a->texture[4].data.lineart.x1 = e->width - r - 1;
+ a->texture[4].data.lineart.x2 = e->width - r - 1;
+ a->texture[4].data.lineart.y1 = t;
+ a->texture[4].data.lineart.y2 = e->height - b - 1;
+}
+