From 2e719a603fcaf004e15519076fec6b244ddca44b Mon Sep 17 00:00:00 2001 From: speedie Date: Mon, 7 Aug 2023 06:23:56 +0200 Subject: [PATCH] Rename more X11 functions --- libs/x11/event.c | 4 ++-- libs/x11/init.c | 2 +- spmenu.c | 37 ++++++++----------------------------- 3 files changed, 11 insertions(+), 32 deletions(-) diff --git a/libs/x11/event.c b/libs/x11/event.c index 5cdbae6..cc52ce8 100644 --- a/libs/x11/event.c +++ b/libs/x11/event.c @@ -24,14 +24,14 @@ void eventloop_x11(void) { case FocusIn: // regrab focus from parent window if (ev.xfocus.window != win) - grabfocus(); + grabfocus_x11(); break; case KeyPress: // read key array and call functions keypress_x11(&ev); break; case SelectionNotify: // paste selection if (ev.xselection.property == utf8) - pastesel(); + pastesel_x11(); break; case VisibilityNotify: if (ev.xvisibility.state != VisibilityUnobscured) diff --git a/libs/x11/init.c b/libs/x11/init.c index 26416cb..4445625 100644 --- a/libs/x11/init.c +++ b/libs/x11/init.c @@ -112,7 +112,7 @@ void setupdisplay_x11(void) { XFree(dws); } - grabfocus(); + grabfocus_x11(); } // resize window and draw diff --git a/spmenu.c b/spmenu.c index 2605e8b..3ff3778 100644 --- a/spmenu.c +++ b/spmenu.c @@ -180,15 +180,6 @@ static struct item *nextitem; // next item static struct item *selecteditem; // selected item static struct item *mouseitem; // clicked item -// various headers -#include "libs/draw.h" -#include "libs/stream.h" -#include "libs/arg.h" -#include "libs/x11/inc.h" -#include "libs/wl/inc.h" -#include "libs/sort.h" -#include "libs/history.h" - static Draw_t *draw; // Draw_t type, see libs/draw/draw.c // high priority @@ -230,16 +221,18 @@ static char * cistrstr(const char *s, const char *sub); static int (*fstrncmp)(const char *, const char *, size_t) = strncasecmp; static char *(*fstrstr)(const char *, const char *) = cistrstr; -#if USEX -static void pastesel(void); -static void grabfocus(void); -#endif - static char **list; static size_t listsize; -// user configuration +// various headers #include "libs/options.h" +#include "libs/draw.h" +#include "libs/stream.h" +#include "libs/arg.h" +#include "libs/x11/inc.h" +#include "libs/wl/inc.h" +#include "libs/sort.h" +#include "libs/history.h" static char *fonts[] = { font }; @@ -482,12 +475,6 @@ char * cistrstr(const char *h, const char *n) { return NULL; } -#if USEX -void grabfocus(void) { - grabfocus_x11(); -} -#endif - void insert(const char *str, ssize_t n) { if (strlen(tx.text) + n > sizeof tx.text - 1) return; // length of text should not exceed size @@ -537,14 +524,6 @@ size_t nextrune(int inc) { return rune; } -#if USEX -void pastesel(void) { - if (!protocol) { - pastesel_x11(); - } -} -#endif - void resizeclient(void) { #if USEWAYLAND if (protocol) {