]> git.mdlowis.com Git - projs/tide.git/commitdiff
minor refactoring
authorMichael D. Lowis <mike@mdlowis.com>
Mon, 9 Apr 2018 01:37:28 +0000 (21:37 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Mon, 9 Apr 2018 01:37:28 +0000 (21:37 -0400)
lib/x11.c

index 0a7354c5056317c23711016541de5709c848d5f9..cc931c723108ef808c37da9ffa03fdf9caa0220a 100644 (file)
--- a/lib/x11.c
+++ b/lib/x11.c
@@ -56,10 +56,8 @@ static void (*EventHandlers[LASTEvent])(XEvent*) = {
     [SelectionClear] = xselclear,
     [SelectionNotify] = xselnotify,
     [SelectionRequest] = xselrequest,
-    [PropertyNotify] = xpropnotify,
     [ClientMessage] = xclientmsg,
     [ConfigureNotify] = xresize,
-    [Expose] = xexpose,
 };
 
 /******************************************************************************/
@@ -432,6 +430,13 @@ bool x11_sel_set(int selid, char* str) {
     }
 }
 
+static struct XSel* selfetch(Atom atom) {
+    for (int i = 0; i < (sizeof(Selections) / sizeof(Selections[0])); i++)
+        if (atom == Selections[i].atom)
+            return &Selections[i];
+    return NULL;
+}
+
 /******************************************************************************/
 
 static WinRegion getregion(size_t x, size_t y) {
@@ -448,13 +453,6 @@ static void xftcolor(XftColor* xc, int id) {
     XftColorAllocValue(X.display, X.visual, X.colormap, &(xc->color), xc);
 }
 
-static struct XSel* selfetch(Atom atom) {
-    for (int i = 0; i < (sizeof(Selections) / sizeof(Selections[0])); i++)
-        if (atom == Selections[i].atom)
-            return &Selections[i];
-    return NULL;
-}
-
 static void get_position(WinRegion id, int x, int y, size_t* row, size_t* col) {
     int starty = (id == EDIT ? Divider+3 : 0);
     int startx = (id == EDIT ? ScrollWidth+3 : 0);
@@ -492,9 +490,6 @@ static void xupdate(Job* job) {
 static void xfocus(XEvent* e) {
     if (X.xic)
         (e->type == FocusIn ? XSetICFocus : XUnsetICFocus)(X.xic);
-//    Buf* buf = win_buf(EDIT);
-//    if (buf->path && buf->modtime != modtime(buf->path))
-//        view_append(win_view(TAGS), "File modified externally: Get {Put }");
 }
 
 static void xkeypress(XEvent* e) {
@@ -597,9 +592,6 @@ static void xselrequest(XEvent* e) {
 0, &s);
 }
 
-static void xpropnotify(XEvent* e) {
-}
-
 static void xclientmsg(XEvent* e) {
     if (e->xclient.data.l[0] == XInternAtom(X.display, "WM_DELETE_WINDOW", False))
         win_quit();
@@ -614,9 +606,6 @@ static void xresize(XEvent* e) {
     }
 }
 
-static void xexpose(XEvent* e) {
-}
-
 /******************************************************************************/
 
 static uint32_t special_keys(uint32_t key) {