Browse Source

rename flush to release

pull/3/head
Frédéric Bour 2 years ago
parent
commit
af73521473
  1. 2
      lib/lwd/lwd.ml
  2. 2
      lib/lwd/lwd.mli
  3. 33
      lib/nottui/nottui.ml

2
lib/lwd/lwd.ml

@ -421,7 +421,7 @@ let is_damaged = function
| Root { value = None ; _ } -> true
| Root { value = Some _ ; _ } -> false
let flush = function
let release = function
| Pure _ | Impure _ -> assert false
| Root t as self ->
if t.acquired then (

2
lib/lwd/lwd.mli

@ -30,7 +30,7 @@ val set_on_invalidate : 'a root -> ('a -> unit) -> unit
val sample : 'a root -> 'a
val is_damaged : 'a root -> bool
val flush : 'a root -> unit
val release : 'a root -> unit
(*val unsafe_peek : 'a t -> 'a option*)

33
lib/nottui/nottui.ml

@ -631,35 +631,6 @@ struct
else
`Unhandled
(*let rec grab_focus t dir =
match t.desc with
| Atom _ | Overlay _ -> false
| Mouse_handler (t, _) | Size_sensor (t, _)
| Scroll_area (t, _, _) | Resize (t, _, _) | Event_filter (t, _) ->
grab_focus t dir
| Focus_area (t', _) ->
grab_focus t' dir || (
match t.focus with
| Focus.Empty | Focus.Request (true, _) -> false
| Focus.Request (false, request) ->
let root = Lwd.observe request in
try
let (_, handle) = Lwd.sample root in
Focus.request handle;
prerr_endline "REQUEST!";
Lwd.flush root;
true
with exn ->
Lwd.flush root; raise exn
)
| X (a, b) | Y (a, b) ->
begin match dir with
| `Prev | `Left | `Up -> grab_focus b dir || grab_focus a dir
| _ -> grab_focus a dir || grab_focus b dir
end
| Z (a, b) ->
grab_focus b dir || grab_focus a dir*)
exception Acquired_focus
let grab_focus ui =
@ -794,8 +765,8 @@ struct
)
in
loop ();
Lwd.flush root;
Lwd.flush quit
Lwd.release root;
Lwd.release quit
let run ?tick_period ?tick ?term ?(renderer=Renderer.make ())
?quit t =

Loading…
Cancel
Save