Fixes #32 - double clicks were not handled properly in ui.backend.gtk

db4
Slava Pestov 2011-08-27 17:06:41 -07:00
parent a67a59d5a1
commit 1f4da36b4b
1 changed files with 31 additions and 24 deletions

View File

@ -160,9 +160,6 @@ CONSTANT: action-key-codes
{ $ GDK_SCROLL_RIGHT { 1 0 } }
} at ;
: mouse-event>gesture ( event -- modifiers button loc )
[ event-modifiers ] [ button>> ] [ event-loc ] tri ;
: on-motion ( win event user-data -- ? )
drop swap
[ event-loc ] dip window
@ -173,23 +170,33 @@ CONSTANT: action-key-codes
:: on-button-press ( win event user-data -- ? )
win window :> world
event mouse-event>gesture :> ( modifiers button loc )
button {
event type>> GDK_BUTTON_PRESS = [
event button>> {
{ 8 [ ] }
{ 9 [ ] }
[ modifiers swap <button-down> loc world
send-button-down ]
} case t ;
[
event event-modifiers swap <button-down>
event event-loc
world
send-button-down
]
} case
] when t ;
:: on-button-release ( win event user-data -- ? )
win window :> world
event mouse-event>gesture :> ( modifiers button loc )
button {
event type>> GDK_BUTTON_RELEASE = [
event button>> {
{ 8 [ world left-action send-action ] }
{ 9 [ world right-action send-action ] }
[ modifiers swap <button-up> loc world
send-button-up ]
} case t ;
[
event event-modifiers swap <button-up>
event event-loc
world
send-button-up
]
} case
] when t ;
: on-scroll ( win event user-data -- ? )
drop swap [