From b6cc4eaded4d41f0697b37084b40c497085fce28 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sat, 11 May 1996 08:50:15 +0000 Subject: [PATCH] Finish changes stared with previous revision: must handle visibility events specially while previewing events; must also handle paint events specially. Handling of paint events is different from handling of X expose events -- this seems to mean that when a window is exposed, X sends the expose event first, but OS/2 sends something other than the paint event first. --- v7/src/edwin/os2term.scm | 42 ++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/v7/src/edwin/os2term.scm b/v7/src/edwin/os2term.scm index 839750b8a..66c1410d9 100644 --- a/v7/src/edwin/os2term.scm +++ b/v7/src/edwin/os2term.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: os2term.scm,v 1.15 1996/05/03 20:00:14 cph Exp $ +;;; $Id: os2term.scm,v 1.16 1996/05/11 08:50:15 cph Exp $ ;;; ;;; Copyright (c) 1994-96 Massachusetts Institute of Technology ;;; @@ -680,6 +680,9 @@ (let ((event (read-event block?))) (cond ((not event) (set! pending #f)) + ((input-event? event) + (set! pending event) + (set! repeat 1)) ((not (vector? event)) (let ((flag (process-change-event event))) (if flag @@ -767,22 +770,31 @@ (if (not reading-event?) (let ((event (os2win-get-event event-descriptor #f))) (if event - (if (and signal-interrupts? - (vector? event) - (fix:= event-type:key (event-type event)) - ;; This tests for CTRL on, ALT off, and - ;; not a virtual key: - (fix:= #x10 - (fix:and #x32 (key-event/flags event))) - (let ((code (key-event/code event))) - (or (fix:= code (char->integer #\G)) - (fix:= code (char->integer #\g))))) - (begin - (clean-event-queue event-queue) - (signal-interrupt!)) - (enqueue!/unsafe event-queue event)))))))) + (preview-event event))))))) unspecific) +(define (preview-event event) + (cond ((not (vector? event)) + (enqueue!/unsafe event-queue event)) + ((and signal-interrupts? + (fix:= event-type:key (event-type event)) + ;; This tests for CTRL on, ALT off, and + ;; not a virtual key: + (fix:= #x10 (fix:and #x32 (key-event/flags event))) + (let ((code (key-event/code event))) + (or (fix:= code (char->integer #\G)) + (fix:= code (char->integer #\g))))) + (clean-event-queue event-queue) + (signal-interrupt!)) + ((fix:= (event-type event) event-type:visibility) + (let ((result (process-special-event event))) + (if result + (enqueue!/unsafe event-queue result)))) + ((fix:= (event-type event) event-type:paint) + (process-paint-event event)) + (else + (enqueue!/unsafe event-queue event)))) + (define (clean-event-queue queue) ;; Flush keyboard and mouse events from the input queue. Other ;; events are harmless and must be processed regardless. -- 2.25.1