From 15838abf569f8558a2527e9a1d5b61ec59e00f3b Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 24 Oct 2014 19:44:20 +0200 Subject: [PATCH] Only enable reparent if we have X11 Signed-off-by: Sebastian Ramacher --- main.c | 6 ++++++ zathura.c | 2 ++ zathura.h | 2 ++ 3 files changed, 10 insertions(+) diff --git a/main.c b/main.c index 839ff5c..6f9bea0 100644 --- a/main.c +++ b/main.c @@ -47,10 +47,14 @@ main(int argc, char* argv[]) bool print_version = false; int page_number = ZATHURA_PAGE_NUMBER_UNSPECIFIED; int synctex_pid = -1; +#ifdef GDK_WINDOWING_X11 Window embed = 0; +#endif GOptionEntry entries[] = { +#ifdef GDK_WINDOWING_X11 { "reparent", 'e', 0, G_OPTION_ARG_INT, &embed, _("Reparents to window specified by xid"), "xid" }, +#endif { "config-dir", 'c', 0, G_OPTION_ARG_FILENAME, &config_dir, _("Path to the config directory"), "path" }, { "data-dir", 'd', 0, G_OPTION_ARG_FILENAME, &data_dir, _("Path to the data directory"), "path" }, { "cache-dir", '\0', 0, G_OPTION_ARG_FILENAME, &cache_dir, _("Path to the cache directory"), "path"}, @@ -163,7 +167,9 @@ main(int argc, char* argv[]) return -1; } +#ifdef GDK_WINDOWING_X11 zathura_set_xid(zathura, embed); +#endif zathura_set_config_dir(zathura, config_dir); zathura_set_data_dir(zathura, data_dir); zathura_set_cache_dir(zathura, cache_dir); diff --git a/zathura.c b/zathura.c index 966a045..1e3a533 100644 --- a/zathura.c +++ b/zathura.c @@ -355,6 +355,7 @@ zathura_free(zathura_t* zathura) g_free(zathura); } +#ifdef GDK_WINDOWING_X11 void zathura_set_xid(zathura_t* zathura, Window xid) { @@ -362,6 +363,7 @@ zathura_set_xid(zathura_t* zathura, Window xid) zathura->ui.session->gtk.embed = xid; } +#endif void zathura_set_config_dir(zathura_t* zathura, const char* dir) diff --git a/zathura.h b/zathura.h index b79f2e7..66b5664 100644 --- a/zathura.h +++ b/zathura.h @@ -227,6 +227,7 @@ bool zathura_init(zathura_t* zathura); */ void zathura_free(zathura_t* zathura); +#ifdef GDK_WINDOWING_X11 /** * Set parent window id * @@ -234,6 +235,7 @@ void zathura_free(zathura_t* zathura); * @param xid The window id */ void zathura_set_xid(zathura_t* zathura, Window xid); +#endif /** * Set the path to the configuration directory