mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-29 13:26:00 +01:00
Only enable reparent if we have X11
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
1acb8ceb53
commit
15838abf56
3 changed files with 10 additions and 0 deletions
6
main.c
6
main.c
|
@ -47,10 +47,14 @@ main(int argc, char* argv[])
|
||||||
bool print_version = false;
|
bool print_version = false;
|
||||||
int page_number = ZATHURA_PAGE_NUMBER_UNSPECIFIED;
|
int page_number = ZATHURA_PAGE_NUMBER_UNSPECIFIED;
|
||||||
int synctex_pid = -1;
|
int synctex_pid = -1;
|
||||||
|
#ifdef GDK_WINDOWING_X11
|
||||||
Window embed = 0;
|
Window embed = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
GOptionEntry entries[] = {
|
GOptionEntry entries[] = {
|
||||||
|
#ifdef GDK_WINDOWING_X11
|
||||||
{ "reparent", 'e', 0, G_OPTION_ARG_INT, &embed, _("Reparents to window specified by xid"), "xid" },
|
{ "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" },
|
{ "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" },
|
{ "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"},
|
{ "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;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef GDK_WINDOWING_X11
|
||||||
zathura_set_xid(zathura, embed);
|
zathura_set_xid(zathura, embed);
|
||||||
|
#endif
|
||||||
zathura_set_config_dir(zathura, config_dir);
|
zathura_set_config_dir(zathura, config_dir);
|
||||||
zathura_set_data_dir(zathura, data_dir);
|
zathura_set_data_dir(zathura, data_dir);
|
||||||
zathura_set_cache_dir(zathura, cache_dir);
|
zathura_set_cache_dir(zathura, cache_dir);
|
||||||
|
|
|
@ -355,6 +355,7 @@ zathura_free(zathura_t* zathura)
|
||||||
g_free(zathura);
|
g_free(zathura);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef GDK_WINDOWING_X11
|
||||||
void
|
void
|
||||||
zathura_set_xid(zathura_t* zathura, Window xid)
|
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;
|
zathura->ui.session->gtk.embed = xid;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
zathura_set_config_dir(zathura_t* zathura, const char* dir)
|
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);
|
void zathura_free(zathura_t* zathura);
|
||||||
|
|
||||||
|
#ifdef GDK_WINDOWING_X11
|
||||||
/**
|
/**
|
||||||
* Set parent window id
|
* Set parent window id
|
||||||
*
|
*
|
||||||
|
@ -234,6 +235,7 @@ void zathura_free(zathura_t* zathura);
|
||||||
* @param xid The window id
|
* @param xid The window id
|
||||||
*/
|
*/
|
||||||
void zathura_set_xid(zathura_t* zathura, Window xid);
|
void zathura_set_xid(zathura_t* zathura, Window xid);
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the path to the configuration directory
|
* Set the path to the configuration directory
|
||||||
|
|
Loading…
Reference in a new issue