ui.backend.cocoa.views: use queued-gesture for touchbar commands.

factor-shell
John Benediktsson 2018-01-18 22:20:27 -08:00
parent b0ded020ea
commit f33bf70ad6
1 changed files with 10 additions and 2 deletions

View File

@ -169,9 +169,17 @@ CONSTANT: selector>action H{
] map-find
] [ f f ] if* ;
TUPLE: send-touchbar-command target command ;
M: send-touchbar-command send-queued-gesture
[ target>> ] [ command>> ] bi invoke-command ;
: touchbar-invoke-command ( n -- )
[ touchbar-commands ] dip over
[ rot nth second invoke-command ] [ 3drop ] if ;
[ touchbar-commands ] dip over [
rot nth second
send-touchbar-command queue-gesture notify-ui-thread
yield
] [ 3drop ] if ;
<CLASS: FactorView < NSOpenGLView
COCOA-PROTOCOL: NSTextInput