[latexila/gnome-3-14] synctex: pass correct timestamp to sync_view()
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [latexila/gnome-3-14] synctex: pass correct timestamp to sync_view()
- Date: Sun, 18 Jan 2015 18:25:35 +0000 (UTC)
commit f07c479293bd420f8eb8fdcd1972f4a28245eca4
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sun Jan 18 19:22:00 2015 +0100
synctex: pass correct timestamp to sync_view()
It's important to pass the correct timestamp, because if
GDK_CURRENT_TIME is used, sometimes Evince is not shown directly, but a
notification appears: "Document Viewer [...] is ready", so it was a bit
annoying to click on the notification to show Evince.
Now it should be fixed.
src/document_view.vala | 2 +-
src/main_window.vala | 2 +-
src/synctex.vala | 9 +++++----
3 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/document_view.vala b/src/document_view.vala
index 3da3fbc..aaafdf8 100644
--- a/src/document_view.vala
+++ b/src/document_view.vala
@@ -204,7 +204,7 @@ public class DocumentView : Gtk.SourceView
Gdk.ModifierType.CONTROL_MASK in event.state)
{
Synctex synctex = Synctex.get_default ();
- synctex.forward_search (this.buffer as Document);
+ synctex.forward_search (this.buffer as Document, event.time);
}
// propagate the event further
diff --git a/src/main_window.vala b/src/main_window.vala
index 526f0b9..4d18de0 100644
--- a/src/main_window.vala
+++ b/src/main_window.vala
@@ -1115,7 +1115,7 @@ public class MainWindow : Window
return_if_fail (active_tab != null);
Synctex synctex = Synctex.get_default ();
- synctex.forward_search (active_document);
+ synctex.forward_search (active_document, Gdk.CURRENT_TIME);
}
/* Projects */
diff --git a/src/synctex.vala b/src/synctex.vala
index eeceea5..2860f9a 100644
--- a/src/synctex.vala
+++ b/src/synctex.vala
@@ -75,7 +75,7 @@ public class Synctex : Object
return _instance;
}
- public void forward_search (Document doc)
+ public void forward_search (Document doc, uint32 timestamp)
{
string? pdf_uri = get_pdf_uri (doc);
@@ -111,7 +111,7 @@ public class Synctex : Object
string tex_path = doc.location.get_path ();
DocPosition pos = get_doc_position (doc);
- sync_view (ev_window, tex_path, pos);
+ sync_view (ev_window, tex_path, pos, timestamp);
}
private void show_warning (string message)
@@ -267,11 +267,12 @@ public class Synctex : Object
});
}
- private void sync_view (EvinceWindow window, string tex_path, DocPosition pos)
+ private void sync_view (EvinceWindow window, string tex_path, DocPosition pos,
+ uint32 timestamp)
{
try
{
- window.sync_view (tex_path, pos, Gdk.CURRENT_TIME);
+ window.sync_view (tex_path, pos, timestamp);
}
catch (IOError e)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]