From c7dd9b7ee11d95598e3c0414439b95bd220f7466 Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sat, 10 Jul 2010 17:17:12 +0300 Subject: [PATCH] XCB/window: allow compilation without xcb-keysyms --- configure.ac | 5 +++-- modules/video_output/xcb/keys.c | 32 ++++++++++++++++++++++++++++---- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 1e70c1bece..8e57a00926 100644 --- a/configure.ac +++ b/configure.ac @@ -3314,7 +3314,7 @@ AS_IF([test "${enable_xcb}" != "no"], [ dnl libxcb PKG_CHECK_MODULES(XCB, [xcb]) PKG_CHECK_MODULES(XCB_SHM, [xcb-shm]) - VLC_ADD_PLUGIN([screensaver xcb_x11 xcb_screen xcb_apps]) + VLC_ADD_PLUGIN([screensaver xcb_x11 xcb_window xcb_screen xcb_apps]) AS_IF([test "${enable_xvideo}" != "no"], [ PKG_CHECK_MODULES(XCB_XV, [xcb-xv >= 1.1.90.1], [ @@ -3348,9 +3348,10 @@ AS_IF([test "${enable_xcb}" != "no"], [ AS_IF([test "${have_xcb_keysyms}" = "yes"], [ PKG_CHECK_MODULES(XPROTO, [xproto]) - VLC_ADD_PLUGIN([xcb_window globalhotkeys]) + VLC_ADD_PLUGIN([globalhotkeys]) VLC_ADD_CFLAGS([globalhotkeys], [${XCB_KEYSYMS_CFLAGS} ${XCB_CFLAGS}]) VLC_ADD_LIBS([globalhotkeys], [${XCB_KEYSYMS_LIBS} ${XCB_LIBS}]) + VLC_ADD_CFLAGS([xcb_window], [-DHAVE_XCB_KEYSYMS]) ]) VLC_ADD_PLUGIN([xdg_screensaver]) ]) diff --git a/modules/video_output/xcb/keys.c b/modules/video_output/xcb/keys.c index 855b149bdc..4dcfe999ca 100644 --- a/modules/video_output/xcb/keys.c +++ b/modules/video_output/xcb/keys.c @@ -29,15 +29,15 @@ #include #include +#include +#include "xcb_vlc.h" + +#ifdef HAVE_XCB_KEYSYMS #include #include #include - -#include #include -#include "xcb_vlc.h" - struct key_handler_t { vlc_object_t *obj; @@ -164,3 +164,27 @@ int ProcessKeyEvent (key_handler_t *ctx, xcb_generic_event_t *ev) free (ev); return 0; } + +#else /* HAVE_XCB_KEYSYMS */ + +key_handler_t *CreateKeyHandler (vlc_object_t *obj, xcb_connection_t *conn) +{ + msg_Err (obj, "X11 key press support not compiled-in"); + (void) conn; + return NULL; +} + +void DestroyKeyHandler (key_handler_t *ctx) +{ + (void) ctx; + abort (); +} + +int ProcessKeyEvent (key_handler_t *ctx, xcb_generic_event_t *ev) +{ + (void) ctx; + (void) ev; + abort (); +} + +#endif /* HAVE_XCB_KEYSYMS */ -- 2.39.5