diff --git a/Makefile.am b/Makefile.am index 089c4a227..e52fe2cb5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -379,7 +379,6 @@ i3_nagbar_i3_nagbar_LDADD = \ i3_nagbar_i3_nagbar_SOURCES = \ i3-nagbar/atoms.xmacro \ - i3-nagbar/i3-nagbar.h \ i3-nagbar/main.c i3bar_i3bar_CPPFLAGS = \ diff --git a/i3-config-wizard/main.c b/i3-config-wizard/main.c index 9e07d1f7d..e857f1b4c 100644 --- a/i3-config-wizard/main.c +++ b/i3-config-wizard/main.c @@ -9,6 +9,7 @@ * */ #include +#include "libi3.h" #include "libi3.h" diff --git a/i3-nagbar/i3-nagbar.h b/i3-nagbar/i3-nagbar.h deleted file mode 100644 index cb672bead..000000000 --- a/i3-nagbar/i3-nagbar.h +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - -#include - -#include - -#define die(...) errx(EXIT_FAILURE, __VA_ARGS__); -#define FREE(pointer) \ - do { \ - free(pointer); \ - pointer = NULL; \ - } while (0) - -#define xmacro(atom) xcb_atom_t A_##atom; -#include "atoms.xmacro" -#undef xmacro - -extern xcb_window_t root; diff --git a/i3-nagbar/main.c b/i3-nagbar/main.c index 5558865b3..be29aa0f1 100644 --- a/i3-nagbar/main.c +++ b/i3-nagbar/main.c @@ -8,15 +8,15 @@ * when the user has an error in their configuration file. * */ +#include +#include "libi3.h" + #include -#include #include #include #include #include -#include #include -#include #include #include #include @@ -28,14 +28,10 @@ #include #include #include -#include xcb_visualtype_t *visual_type = NULL; -#include "libi3.h" #define SN_API_NOT_YET_FROZEN 1 -#include "i3-nagbar.h" - #include #define MSG_PADDING logical_px(8) @@ -45,6 +41,12 @@ xcb_visualtype_t *visual_type = NULL; #define CLOSE_BTN_GAP logical_px(15) #define BAR_BORDER logical_px(2) +#define xmacro(atom) xcb_atom_t A_##atom; +#include "atoms.xmacro" +#undef xmacro + +#define die(...) errx(EXIT_FAILURE, __VA_ARGS__); + static char *argv0 = NULL; typedef struct { @@ -314,8 +316,8 @@ static xcb_rectangle_t get_window_position(void) { goto free_resources; free_resources: - FREE(res); - FREE(primary); + free(res); + free(primary); return result; } @@ -598,7 +600,7 @@ int main(int argc, char *argv[]) { free(event); } - FREE(pattern); + free(pattern); draw_util_surface_free(conn, &bar); return 0;