mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-28 07:26:01 +01:00
Raise window on SyncteX actions (fixes pwmt/zathura#97)
This commit is contained in:
parent
45ebce689b
commit
e90755f06c
1 changed files with 11 additions and 5 deletions
|
@ -396,12 +396,13 @@ handle_method_call(GDBusConnection* UNUSED(connection),
|
||||||
const char* method;
|
const char* method;
|
||||||
void (*handler)(zathura_t*, GVariant*, GDBusMethodInvocation*);
|
void (*handler)(zathura_t*, GVariant*, GDBusMethodInvocation*);
|
||||||
bool needs_document;
|
bool needs_document;
|
||||||
|
bool present_window;
|
||||||
} handlers[] = {
|
} handlers[] = {
|
||||||
{ "OpenDocument", handle_open_document, false },
|
{ "OpenDocument", handle_open_document, false, true },
|
||||||
{ "CloseDocument", handle_close_document, false },
|
{ "CloseDocument", handle_close_document, false, false },
|
||||||
{ "GotoPage", handle_goto_page, true },
|
{ "GotoPage", handle_goto_page, true, true },
|
||||||
{ "HighlightRects", handle_highlight_rects, true },
|
{ "HighlightRects", handle_highlight_rects, true, true },
|
||||||
{ "SynctexView", handle_synctex_view, true }
|
{ "SynctexView", handle_synctex_view, true, true }
|
||||||
};
|
};
|
||||||
|
|
||||||
for (size_t idx = 0; idx != sizeof(handlers) / sizeof(handlers[0]); ++idx) {
|
for (size_t idx = 0; idx != sizeof(handlers) / sizeof(handlers[0]); ++idx) {
|
||||||
|
@ -417,6 +418,11 @@ handle_method_call(GDBusConnection* UNUSED(connection),
|
||||||
}
|
}
|
||||||
|
|
||||||
(*handlers[idx].handler)(priv->zathura, parameters, invocation);
|
(*handlers[idx].handler)(priv->zathura, parameters, invocation);
|
||||||
|
|
||||||
|
if (handlers[idx].present_window == true && priv->zathura->ui.session->gtk.embed == 0) {
|
||||||
|
gtk_window_present(GTK_WINDOW(priv->zathura->ui.session->gtk.window));
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue