misc fixes, especially cocoa
original commit: bffff78aad36699025d498442f38214f0727ad5b
This commit is contained in:
parent
a8ff7273c0
commit
04623979f5
|
@ -12,6 +12,7 @@
|
|||
"cursor.rkt"
|
||||
"../../syntax.rkt"
|
||||
"../common/queue.rkt"
|
||||
"../common/freeze.rkt"
|
||||
"../../lock.rkt")
|
||||
|
||||
(provide frame%
|
||||
|
@ -55,9 +56,17 @@
|
|||
#f]
|
||||
[-a _void (windowDidResize: [_id notification])
|
||||
(when wxb
|
||||
(queue-window*-event wxb (lambda (wx)
|
||||
(send wx on-size 0 0)
|
||||
(send wx clean-up))))]
|
||||
(let ([wx (->wx wxb)])
|
||||
(when wx
|
||||
(queue-window-event wx (lambda ()
|
||||
(send wx on-size 0 0)
|
||||
(send wx clean-up)))
|
||||
;; Live resize:
|
||||
(constrained-reply (send wx get-eventspace)
|
||||
(lambda ()
|
||||
(pre-event-sync #t)
|
||||
(let loop () (when (yield) (loop))))
|
||||
(void)))))]
|
||||
[-a _void (windowDidMove: [_id notification])
|
||||
(when wxb
|
||||
(queue-window*-event wxb (lambda (wx)
|
||||
|
@ -248,6 +257,8 @@
|
|||
(for/or ([i (in-range (tell #:type _NSUInteger wins count))])
|
||||
(let ([win (tell wins objectAtIndex: #:type _NSUInteger i)])
|
||||
(and (tell #:type _BOOL win isVisible)
|
||||
(or (not root-fake-frame)
|
||||
(not (ptr-equal? win (send root-fake-frame get-cocoa))))
|
||||
win)))))))])
|
||||
(cond
|
||||
[next (tellv next makeKeyWindow)]
|
||||
|
|
|
@ -47,7 +47,10 @@
|
|||
(not (eq? (application-pref-handler) nothing-application-pref-handler))
|
||||
(super-tell #:type _BOOL validateMenuItem: menuItem))]
|
||||
[-a _BOOL (application: [_id theApplication] openFile: [_NSString filename])
|
||||
(queue-file-event (string->path filename))])
|
||||
(queue-file-event (string->path filename))]
|
||||
[-a _void (applicationDidChangeScreenParameters: notification)
|
||||
;; Need to reset blit windows, since OS may move them incorrectly
|
||||
(void)])
|
||||
|
||||
(tellv app finishLaunching)
|
||||
|
||||
|
@ -55,16 +58,6 @@
|
|||
(tellv app setDelegate: app-delegate)
|
||||
(tellv app activateIgnoringOtherApps: #:type _BOOL #t)
|
||||
|
||||
#|
|
||||
(import-class NSNotificationCenter)
|
||||
(define-cocoa NSMenuDidBeginTrackingNotification _id)
|
||||
(tellv (tell NSNotificationCenter defaultCenter)
|
||||
addObserver: app-delegate
|
||||
selector: #:type _SEL (selector trackingMenuNow:)
|
||||
name: NSMenuDidBeginTrackingNotification
|
||||
object: #f)
|
||||
|#
|
||||
|
||||
;; ------------------------------------------------------------
|
||||
;; Create an event to post when MzScheme has been sleeping but is
|
||||
;; ready to wake up
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
"utils.rkt"
|
||||
"window.rkt"
|
||||
"panel.rkt"
|
||||
"queue.rkt"
|
||||
"../common/event.rkt"
|
||||
"../common/procs.rkt"
|
||||
(for-syntax racket/base))
|
||||
|
|
|
@ -512,6 +512,7 @@
|
|||
(define/public (set-size x y w h)
|
||||
(let ([x (if (= x -11111) (get-x) x)]
|
||||
[y (if (= y -11111) (get-y) y)])
|
||||
(tellv cocoa setNeedsDisplay: #:type _BOOL #t)
|
||||
(tellv cocoa setFrame: #:type _NSRect (make-NSRect (make-NSPoint x (flip y h))
|
||||
(make-NSSize w h)))))
|
||||
(define/public (move x y)
|
||||
|
|
|
@ -27,6 +27,14 @@
|
|||
(void))
|
||||
(super-new))
|
||||
|
||||
(define string-clipboard-client%
|
||||
(class clipboard-client%
|
||||
(init-field the-bytes)
|
||||
(super-new)
|
||||
(define/override (get-types) (list "TEXT"))
|
||||
(define/override (get-data s)
|
||||
(and (equal? s "TEXT") the-bytes))))
|
||||
|
||||
(defclass clipboard% object%
|
||||
(init x-selection?)
|
||||
|
||||
|
@ -44,12 +52,15 @@
|
|||
(send driver get-data type))
|
||||
(def/public (get-clipboard-string [exact-integer? timestamp])
|
||||
(send driver get-text-data))
|
||||
(def/public-unimplemented set-clipboard-string)
|
||||
|
||||
(def/public (set-clipboard-client [clipboard-client% c]
|
||||
[exact-integer? timestamp])
|
||||
(send c set-client-eventspace (current-eventspace))
|
||||
(send driver set-client c (send c get-types)))
|
||||
(def/public (set-clipboard-string [string? str]
|
||||
[exact-integer? timestamp])
|
||||
(set-clipboard-client (make-object string-clipboard-client%
|
||||
(string->bytes/utf-8 str))
|
||||
timestamp))
|
||||
|
||||
(super-new))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user