x11misc.c splitted to x11init.c and x11misc.c
[k8sterm.git] / src / x11misc.c
blob9732325b8c7078668e8afdf3ae05de795240f503
1 ////////////////////////////////////////////////////////////////////////////////
2 // x11 drawing and utils
3 static void changeXCursor (int intabbar) {
4 Cursor newcur = (intabbar ? xw.defcursor : xw.cursor);
5 //
6 if (xw.lastcursor != newcur) {
7 xw.lastcursor = newcur;
8 if (!ptrBlanked) {
9 XDefineCursor(xw.dpy, xw.win, xw.lastcursor);
10 XFlush(xw.dpy);
16 static void xblankPointer (void) {
17 if (!ptrBlanked && xw.blankPtr != None) {
18 ptrBlanked = 1;
19 XDefineCursor(xw.dpy, xw.win, xw.blankPtr);
20 XFlush(xw.dpy);
25 static void xunblankPointer (void) {
26 if (ptrBlanked && xw.cursor != None) {
27 ptrBlanked = 0;
28 XDefineCursor(xw.dpy, xw.win, xw.lastcursor);
29 XFlush(xw.dpy);
30 ptrLastMove = mclock_ticks();
35 static void xclearunused (void) {
36 if (xw.tabheight > 0 && curterm != NULL) {
37 int unh = xw.h-(curterm->row*xw.ch)-xw.tabheight;
39 if (unh > 0) {
40 switch (opt_tabposition) {
41 case 0: // bottom
42 XClearArea(xw.dpy, xw.win, 0, xw.h-xw.tabheight-unh, xw.w, unh, False);
43 break;
44 case 1: // top
45 XClearArea(xw.dpy, xw.win, 0, xw.tabheight+(curterm->row*xw.ch), xw.w, unh, False);
46 break;
54 static int xisyinunused (int y) {
55 if (xw.tabheight > 0 && curterm != NULL) {
56 int unh = xw.h-(curterm->row*xw.ch)-xw.tabheight;
58 if (unh > 0) {
59 switch (opt_tabposition) {
60 case 0: // bottom
61 return (y >= xw.h-xw.tabheight-unh && y < xw.h-xw.tabheight);
62 break;
63 case 1: // top
64 return (y >= xw.tabheight+(curterm->row*xw.ch)t);
65 break;
69 return 0;