From 272e1bcdaf90bed4149385e40c0985219bbfdd8c Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Sun, 8 Apr 2018 21:37:28 -0400 Subject: [PATCH] minor refactoring --- lib/x11.c | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/lib/x11.c b/lib/x11.c index 0a7354c..cc931c7 100644 --- 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) { -- 2.54.0