diff --git a/src/config.c b/src/config.c index 5a857920..452ab3ec 100644 --- a/src/config.c +++ b/src/config.c @@ -27,6 +27,7 @@ #include "borders.h" #include "buttons.h" #include "conf.h" +#include "cursors.h" #include "file.h" #include "iclass.h" #include "menus.h" @@ -337,6 +338,11 @@ ConfigFileRead(FILE * fs) case CONFIG_CLOSE: goto done; + case CONFIG_CURSOR: + err = ECursorConfigLoad(fs); + if (err) + ConfigAlertLoad("Cursor"); + break; case CONFIG_IMAGECLASS: err = ImageclassConfigLoad(fs); if (err) @@ -545,6 +551,7 @@ ThemeConfigLoad(void) { static const char *const config_files[] = { "init.cfg", + "cursors.cfg", "textclasses.cfg", "imageclasses.cfg", "desktops.cfg", diff --git a/src/cursors.c b/src/cursors.c index 88a1cebd..5ed63df4 100644 --- a/src/cursors.c +++ b/src/cursors.c @@ -244,7 +244,7 @@ ECursorFree(ECursor * ec) ec->ref_count--; } -static int +int ECursorConfigLoad(FILE * fs) { int err = 0; @@ -362,7 +362,9 @@ static const ECDataRec ECData[ECSR_COUNT] = { {"RESIZE_BR", "RESIZE_TL", XC_bottom_right_corner}, }; -static Cursor ECsrs[ECSR_COUNT]; +static Cursor ECsrs[ECSR_COUNT] = { + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 +}; Cursor ECsrGet(int which) @@ -382,34 +384,6 @@ ECsrApply(int which, Window win) XDefineCursor(disp, win, ECsrGet(which)); } -/* - * Set up some basic cursors - */ -static void -CursorsInit(void) -{ - int i; - - for (i = 0; i < ECSR_COUNT; i++) - ECsrs[i] = 1; -} - -/* - * Cursor module - */ - -static void -CursorSighan(int sig, void *prm __UNUSED__) -{ - switch (sig) - { - case ESIGNAL_INIT: - ConfigFileLoad("cursors.cfg", Mode.theme.path, ECursorConfigLoad, 1); - CursorsInit(); - break; - } -} - static void CursorsIpc(const char *params) { @@ -448,7 +422,7 @@ static const IpcItem CursorIpcArray[] = { extern const EModule ModCursors; const EModule ModCursors = { "cursor", "csr", - CursorSighan, + NULL, {N_IPC_FUNCS, CursorIpcArray} , {0, NULL} diff --git a/src/cursors.h b/src/cursors.h index e49b851d..edb75c15 100644 --- a/src/cursors.h +++ b/src/cursors.h @@ -46,4 +46,6 @@ void ECursorApply(ECursor * ec, Win win); Cursor ECsrGet(int which); void ECsrApply(int which, Window win); +int ECursorConfigLoad(FILE * fs); + #endif /* _CURSORS_H_ */