The unified diff between revisions [7891617d..] and [78746ed3..] is displayed below. It can also be downloaded as a raw diff.

This diff has been restricted to the following files: 'view.ml'

#
#
# patch "view.ml"
#  from [85fe039f1aaf23419b2c230887c361382493c78a]
#    to [69c88b304f62c440cbc49ec4c62a89a98a42da90]
#
============================================================
--- view.ml	85fe039f1aaf23419b2c230887c361382493c78a
+++ view.ml	69c88b304f62c440cbc49ec4c62a89a98a42da90
@@ -497,6 +497,9 @@ module Canvas = struct
 
 module Canvas = struct

+  external pango_fix : unit -> unit = "ml_fix_libgnomecanvas_pango"
+  let _ = pango_fix ()
+
   let set_busy_cursor =
     let busy_cursor = Gdk.Cursor.create `WATCH in
     let normal_cursor = Gdk.Cursor.create `LEFT_PTR in
@@ -706,11 +709,7 @@ module Canvas = struct
 	else
 	  GnoCanvas.rect ~x1:(~-. x) ~y1:(~-. y) ~x2:x ~y2:y ~props g in
       if node.c_kind = DISAPPROVE
-      then
-	begin
-	  let sqrt2_2 = sqrt 2. /. 2. in
-	  rect#affine_relative [| sqrt2_2 ; sqrt2_2 ; sqrt2_2 ; ~-. sqrt2_2 ; 0. ; 0. |]
-	end ;
+      then rect#affine_relative [| 0.5 ; 0.5 ; 0.5 ; -0.5 ; 0. ; 0. |] ;
       if node.c_kind = REGULAR || node.c_kind = NEIGHBOUR then
 	begin
 	  let scaled_font_size = font_size *. v.canvas.ppu in
@@ -811,7 +810,10 @@ module Canvas = struct

     let id =
       Glib.Idle.add (fun () ->
-	try snd (PQueue.pop_maximum q) () ; true
+	try
+	  for i = 1 to 10 do
+	    snd (PQueue.pop_maximum q) ()
+	  done ; true
 	with Heap.EmptyHeap ->
 	  v.canvas.background_rendering <- None ;
 	  pr#progress_end () ;
@@ -884,13 +886,13 @@ module Find = struct
 	Canvas.center_on v n
     | _ ->
 	let candidates =
-	  if is_id q
-	  then locate_id v q
-	  else if is_date q
-	  then locate_date v q
-	  else
-	    try locate_tag v (Str.regexp q)
-	    with Failure _ -> [] in
+	  try
+	    if is_id q
+	    then locate_id v q
+	    else if is_date q
+	    then locate_date v q
+	    else locate_tag v (Str.regexp q)
+	  with Failure _ | Invalid_argument _ -> [] in
 	match candidates with
  	| [] ->
 	    v.find.last_find <- (q, [])
@@ -962,6 +964,19 @@ let make ~aa ~prefs ~packing =

   Branch_selector.connect v (handle_query v) ;

+  begin
+    let clipboard = GData.clipboard Gdk.Atom.primary in
+    ignore
+      (v.canvas.w#event#connect#button_press
+	 (function
+	   | b when GdkEvent.Button.button b = 2 ->
+	       may
+		 (Signal.emit v.find.find_signal)
+		 clipboard#text ;
+	       true
+	   | _ -> false))
+  end ;
+
   connect_event v (function
     | `NODE_SELECT id ->
 	Canvas.display_selection_marker v id ;
@@ -1056,15 +1071,13 @@ let set_prefs v p =
     v.prefs <- { v.prefs with style = p.style } ;
     need_redraw := true
   end ;
-  if v.agraph <> None
-  then begin
-    if !need_layout || !need_redraw
-    then Canvas.clear v ;
-    if !need_layout
-    then handle_query v (Agraph.get_query (some v.agraph))
-    else if !need_redraw
-    then Canvas.update_graph v
-  end
+  match v.agraph with
+  | Some g when !need_layout ->
+      handle_query v (Agraph.get_query g)
+  | Some g when !need_redraw ->
+      Canvas.clear v ;
+      Canvas.update_graph v
+  | _ -> ()

 let get_ancestors v id =
   Agraph.get_ancestors (some v.agraph) id