Commit 15838abf authored by Sebastian Ramacher's avatar Sebastian Ramacher

Only enable reparent if we have X11

Signed-off-by: Sebastian Ramacher's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent 1acb8ceb
......@@ -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);
......
......@@ -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)
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment