X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;ds=sidebyside;f=shell%2Fev-window.c;h=b13e7a35551d83f30300809945a39b4f9ca732a9;hb=04766ed2f064192b4a8eb3fb6a81a1bd020a139f;hp=01c5e9f75e4bcd5117231f78e94993a6243a1e78;hpb=bcb6b9fe2668c0ac479d9ed6bffac393943986c4;p=evince.git
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 01c5e9f7..b13e7a35 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -4211,9 +4211,6 @@ ev_window_cmd_edit_toolbar (GtkAction *action, EvWindow *ev_window)
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE);
gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)), 5);
gtk_box_set_spacing (GTK_BOX (content_area), 2);
-#if !GTK_CHECK_VERSION (2, 90, 7)
- gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
-#endif
gtk_window_set_default_size (GTK_WINDOW (dialog), 500, 400);
toolbar = EGG_EDITABLE_TOOLBAR (ev_window->priv->toolbar);
@@ -6598,6 +6595,9 @@ ev_window_sync_source (EvWindow *window,
{
GDBusConnection *connection;
GError *error = NULL;
+ guint32 timestamp;
+ gchar *uri_input;
+ GFile *input_gfile;
if (window->priv->dbus_object_id <= 0)
return;
@@ -6606,16 +6606,41 @@ ev_window_sync_source (EvWindow *window,
if (!connection)
return;
+ timestamp = gtk_get_current_event_time ();
+ if (g_path_is_absolute (link->filename)) {
+ input_gfile = g_file_new_for_path (link->filename);
+ } else {
+ GFile *gfile, *parent_gfile;
+
+ gfile = g_file_new_for_uri (window->priv->uri);
+ parent_gfile = g_file_get_parent (gfile);
+
+ /* parent_gfile should never be NULL */
+ if (parent_gfile == NULL) {
+ g_printerr ("Document URI is '/'\n");
+ return;
+ }
+
+ input_gfile = g_file_get_child (parent_gfile, link->filename);
+ g_object_unref (parent_gfile);
+ g_object_unref (gfile);
+ }
+
+ uri_input = g_file_get_uri (input_gfile);
+ g_object_unref (input_gfile);
+
g_dbus_connection_emit_signal (connection,
NULL,
window->priv->dbus_object_path,
EV_WINDOW_DBUS_INTERFACE,
"SyncSource",
- g_variant_new ("(s(ii))",
- link->filename,
+ g_variant_new ("(s(ii)u)",
+ uri_input,
link->line,
- link->col),
+ link->col,
+ timestamp),
&error);
+ g_free (uri_input);
if (error) {
g_printerr ("Failed to emit DBus signal SyncSource: %s\n",
error->message);
@@ -6704,10 +6729,11 @@ method_call_cb (GDBusConnection *connection,
if (window->priv->document && ev_document_has_synctex (window->priv->document)) {
EvSourceLink link;
+ guint32 timestamp;
- g_variant_get (parameters, "(&s(ii))", &link.filename, &link.line, &link.col);
+ g_variant_get (parameters, "(&s(ii)u)", &link.filename, &link.line, &link.col, ×tamp);
ev_view_highlight_forward_search (EV_VIEW (window->priv->view), &link);
- gtk_window_present (GTK_WINDOW (window));
+ gtk_window_present_with_time (GTK_WINDOW (window), timestamp);
}
g_dbus_method_invocation_return_value (invocation, g_variant_new ("()"));
@@ -6719,10 +6745,12 @@ static const char introspection_xml[] =
""
""
""
+ ""
""
""
""
""
+ ""
""
""
""
@@ -6888,7 +6916,7 @@ ev_window_init (EvWindow *ev_window)
gtk_widget_show (ev_window->priv->toolbar);
/* Add the main area */
- ev_window->priv->hpaned = gtk_hpaned_new ();
+ ev_window->priv->hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
g_signal_connect (ev_window->priv->hpaned,
"notify::position",
G_CALLBACK (ev_window_sidebar_position_change_cb),