EditBg, EditFg, EditSel,
TagsBg, TagsFg, TagsSel,
ScrollBg, ScrollFg,
- VerBdr, HorBdr,
+ VerBdr, HorBdr, WinBdr,
ClrCount
};
[ScrollFg] = 0xF0F0E5, /* Scroll region foreground */
[VerBdr] = 0x909047, /* Vertical border */
[HorBdr] = 0x000000, /* Horizontal border */
+ [WinBdr] = 0x000000, /* Window border */
};
#ifdef FETCH_RULES
case OUTDATED: draw_rect(x, Orange, 0, 0, ScrollWidth, x->height/4); break;
case ERRORED: draw_rect(x, Red, 0, 0, ScrollWidth, x->height/4); break;
}
+ draw_rect(x, WinBdr, 0, 0, 1, x->height/4);
}
int draw_hrule(XConf* x, drawcsr* csr) {
draw_rect(x, VerBdr, ScrollWidth, divider + 2, 1, thumbreg);
draw_rect(x, ScrollBg, 0, divider + 2, ScrollWidth, thumbreg);
draw_rect(x, ScrollFg, 0, thumboff + 2, ScrollWidth, thumbsz);
+ draw_rect(x, WinBdr, 0, divider + 2, 1, thumbreg);
}
}
static void xkeypress(XConf* x, XEvent* e) {
- KeySym key = x11_getkey(x, e);
+ char buf[8];
+ KeySym key;
+ Status status;
+ if (x->xic)
+ Xutf8LookupString(x->xic, &(e->xkey), buf, sizeof(buf), &key, &status);
+ else
+ XLookupString(&(e->xkey), buf, sizeof(buf), &key, 0);
if (key == XK_Return) {
x->running = false;
} else if (key == XK_Escape) {
return extents.xOff;
}
+static Child_T* win_delete(Child_T* child, Window id) {
+ if (!child) return NULL;
+ if (child->wid == id) {
+ Child_T* next = child->next;
+ free(child);
+ return next;
+ } else {
+ child->next = win_delete(child->next, id);
+ return child;
+ }
+}
+
+static void get_position(int x, int y, size_t* row, size_t* col) {
+ int startx = ScrollWidth+3;
+ int maxy = Divider - 4;
+ x = (x < 0 ? 0 : (x > X.width ? X.width : x));
+ y = (y < 0 ? 0 : (y > maxy ? maxy : y));
+ *row = y / X.font->height;
+ *col = (startx <= x ? x - startx : 0);
+}
+
/* X11 Event Code
******************************************************************************/
static void xmaprequest(XConf* x, XEvent* e) {
retile = 1;
}
-static Child_T* win_delete(Child_T* child, Window id) {
- if (!child) return NULL;
- if (child->wid == id) {
- Child_T* next = child->next;
- free(child);
- return next;
- } else {
- child->next = win_delete(child->next, id);
- return child;
- }
-}
-
static void xdestroy(XConf* x, XEvent* e) {
(void)x;
NChildren--;
view_insert(&Tags, key);
}
-static void get_position(int x, int y, size_t* row, size_t* col) {
- int startx = ScrollWidth+3;
- int maxy = Divider - 4;
- x = (x < 0 ? 0 : (x > X.width ? X.width : x));
- y = (y < 0 ? 0 : (y > maxy ? maxy : y));
- *row = y / X.font->height;
- *col = (startx <= x ? x - startx : 0);
-}
-
static void xmousebtn(XConf* x, XEvent* e) {
(void)x;
size_t row, col;
Divider = draw_hrule(x, &csr);
draw_view(x, &Regions[EDIT], x->font, editrows, &csr, EditBg, EditFg, EditSel, SyncMouse);
draw_scroll(x, &csr, win_view(EDIT), Divider);
+ draw_rect(x, WinBdr, 0, x->height-1, x->width, 1);
XCopyArea(x->display, x->pixmap, x->self, x->gc, 0, 0, x->width, x->height, 0, 0);
SyncMouse = false;
XFlush(x->display);