mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 05:56:01 +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;
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue