From 1e9c90abd77610fff95c9e7c19348dedd6591041 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Mon, 26 Sep 2016 16:10:36 -0400 Subject: [PATCH] Clean up raise protocol --- gui.rkt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gui.rkt b/gui.rkt index 20de493..553f0c0 100644 --- a/gui.rkt +++ b/gui.rkt @@ -73,14 +73,14 @@ )) (render-children))))) -(define (draggable-mixin touching? x y z) +(define (draggable-mixin touching? x y id-to-raise) (define (idle) (react (stop-when #:when (touching?) (message (inbound (mouse-event 'left-down (mouse-state $mx $my _ _ _)))) (dragging (- mx (x)) (- my (y)))))) (define (dragging dx dy) - (z (- (current-inexact-milliseconds))) + (when id-to-raise (send! (raise-widget id-to-raise))) (react (on (message (inbound (mouse-event 'motion (mouse-state $mx $my _ _ _)))) (x (- mx dx)) (y (- my dy))) @@ -348,12 +348,12 @@ (field [z (- (current-inexact-milliseconds))]) (define/query-value touching-title-bar? #f (inbound (touching `(,window-id title-bar))) #t) - (on-start (draggable-mixin touching-title-bar? x y z)) + (on-start (draggable-mixin touching-title-bar? x y window-id)) (when resizable? (define/query-value touching-resize-corner? #f (inbound (touching `(,window-id resize-corner))) #t) - (on-start (draggable-mixin touching-resize-corner? width height z))) + (on-start (draggable-mixin touching-resize-corner? width height window-id))) (define/query-value touching-close-icon? #f (inbound (touching `(,window-id close-icon))) #t)