From 7d1870c6f1c1dd14fe9fe13885021970f0cbdbe8 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Sat, 3 Mar 2018 17:03:19 +0100 Subject: [PATCH] move xwm.h out of include/wlr xwm.h was meant to be private, so move it to include/xwayland/xwm.h We had an ifdef WLR_HAS_XCB_ICCCM in xwayland.h which was easy to move to xwm, it is not safe to use the WLR_HAS_* in the public headers. I checked a few of our current users and none rely on xwm.h being public as expected (rootston, sway, hsroots) --- include/wlr/xwayland.h | 4 ---- include/{wlr => xwayland}/xwm.h | 7 +++++++ meson.build | 1 - xwayland/selection.c | 2 +- xwayland/xwayland.c | 2 +- xwayland/xwm.c | 9 +-------- 6 files changed, 10 insertions(+), 15 deletions(-) rename include/{wlr => xwayland}/xwm.h (95%) diff --git a/include/wlr/xwayland.h b/include/wlr/xwayland.h index 0d4b91ed..f34860aa 100644 --- a/include/wlr/xwayland.h +++ b/include/wlr/xwayland.h @@ -8,10 +8,6 @@ #include #include -#ifdef WLR_HAS_XCB_ICCCM - #include -#endif - struct wlr_xwm; struct wlr_xwayland_cursor; diff --git a/include/wlr/xwm.h b/include/xwayland/xwm.h similarity index 95% rename from include/wlr/xwm.h rename to include/xwayland/xwm.h index 7d518f7e..0ed61d37 100644 --- a/include/wlr/xwm.h +++ b/include/xwayland/xwm.h @@ -5,6 +5,13 @@ #include #include +#ifdef WLR_HAS_XCB_ICCCM + #include +#endif +#ifdef WLR_HAS_XCB_ERRORS + #include +#endif + enum atom_name { WL_SURFACE_ID, WM_DELETE_WINDOW, diff --git a/meson.build b/meson.build index 1188f318..553d2b88 100644 --- a/meson.build +++ b/meson.build @@ -103,7 +103,6 @@ if get_option('enable_xwayland') conf_data.set('WLR_HAS_XWAYLAND', true) else exclude_headers += 'xwayland.h' - exclude_headers += 'xwm.h' endif exclude_headers += 'meson.build' install_subdir('include/wlr', install_dir: 'include', exclude_files: exclude_headers) diff --git a/xwayland/selection.c b/xwayland/selection.c index ffcde4d0..1d390026 100644 --- a/xwayland/selection.c +++ b/xwayland/selection.c @@ -7,8 +7,8 @@ #include #include #include -#include #include +#include "xwayland/xwm.h" static const size_t incr_chunk_size = 64 * 1024; diff --git a/xwayland/xwayland.c b/xwayland/xwayland.c index 8dffd040..d49dd718 100644 --- a/xwayland/xwayland.c +++ b/xwayland/xwayland.c @@ -18,9 +18,9 @@ #include #include #include -#include #include "sockets.h" #include "util/signal.h" +#include "xwayland/xwm.h" #ifdef __FreeBSD__ static inline int clearenv(void) { diff --git a/xwayland/xwm.c b/xwayland/xwm.c index ca6786db..b4042ad6 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -9,19 +9,12 @@ #include #include #include -#include #include #include #include #include #include "util/signal.h" - -#ifdef WLR_HAS_XCB_ICCCM - #include -#endif -#ifdef WLR_HAS_XCB_ERRORS - #include -#endif +#include "xwayland/xwm.h" const char *atom_map[ATOM_LAST] = { "WL_SURFACE_ID",