From e15649fb9883b13f55e0a98640a1632bcde0c782 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 1 Dec 2000 06:07:43 +0000 Subject: [PATCH] Change arguments to OTHER-SCREEN so that only first is required. Eliminate OTHER-SCREEN?, replacing occurrences with OTHER-SCREEN. Change meaning of SCREEN-VISIBLE? to mean "not unmapped"; this is almost always what was meant. Fix bug in SELECT-WINDOW: when selecting the selected window of another frame, must select the frame. Fix SELECT-BUFFER-OTHER-SCREEN to select the frame as well as the buffer if reusing an existing frame. --- v7/src/edwin/curren.scm | 35 ++++++++++++++++++----------------- v7/src/edwin/debug.scm | 4 ++-- v7/src/edwin/edwin.pkg | 5 +---- v7/src/edwin/os2term.scm | 6 +++--- v7/src/edwin/scrcom.scm | 4 ++-- v7/src/edwin/screen.scm | 15 +++++++++------ v7/src/edwin/win32.scm | 4 ++-- v7/src/edwin/wincom.scm | 15 ++++++++------- 8 files changed, 45 insertions(+), 43 deletions(-) diff --git a/v7/src/edwin/curren.scm b/v7/src/edwin/curren.scm index 6a4240e11..eef866749 100644 --- a/v7/src/edwin/curren.scm +++ b/v7/src/edwin/curren.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: curren.scm,v 1.141 2000/10/30 19:53:23 cph Exp $ +;;; $Id: curren.scm,v 1.142 2000/12/01 06:06:54 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-2000 Massachusetts Institute of Technology ;;; @@ -75,7 +75,7 @@ The frame is guaranteed to be deselected at that time." (if other (begin (if (selected-screen? screen) - (select-screen (or (other-screen screen 1 #f) other))) + (select-screen (or (other-screen screen) other))) (screen-discard! screen) (set-editor-screens! current-editor (delq! screen @@ -156,20 +156,19 @@ The frame is guaranteed to be deselected at that time." (else screen))) -(define (other-screen screen n invisible-ok?) - (let ((next-screen (if (> n 0) screen1+ screen-1+))) - (let loop ((screen* screen) (n (abs n))) - (if (= n 0) - screen* - (let ((screen* (next-screen screen*))) - (and (not (eq? screen* screen)) - (loop screen* - (if (or invisible-ok? (screen-visible? screen*)) - (- n 1) - n)))))))) - -(define (other-screen? screen) - (other-screen screen 1 #t)) +(define (other-screen screen #!optional n invisible-ok?) + (let ((n (if (default-object? n) 1 n)) + (invisible-ok? (if (default-object? invisible-ok?) #f invisible-ok?))) + (let ((next-screen (if (> n 0) screen1+ screen-1+))) + (let loop ((screen* screen) (n (abs n))) + (if (= n 0) + screen* + (let ((screen* (next-screen screen*))) + (and (not (eq? screen* screen)) + (loop screen* + (if (or invisible-ok? (screen-visible? screen)) + (- n 1) + n))))))))) ;;;; Windows @@ -193,7 +192,9 @@ The frame is guaranteed to be deselected at that time." (lambda () (let* ((screen (window-screen window)) (window* (screen-selected-window screen))) - (if (not (eq? window window*)) + (if (eq? window window*) + (if (not (selected-screen? screen)) + (select-screen screen)) (begin (undo-leave-window! window*) (if (selected-screen? screen) diff --git a/v7/src/edwin/debug.scm b/v7/src/edwin/debug.scm index a96b97f44..29ae49798 100644 --- a/v7/src/edwin/debug.scm +++ b/v7/src/edwin/debug.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: debug.scm,v 1.53 2000/10/30 15:43:28 cph Exp $ +;;; $Id: debug.scm,v 1.54 2000/12/01 06:07:13 cph Exp $ ;;; ;;; Copyright (c) 1992-2000 Massachusetts Institute of Technology ;;; @@ -378,7 +378,7 @@ ;; screen is the current screen, delete it too. (let ((new-screen (browser/new-screen browser))) (if (and (eq? new-screen screen) - (other-screen? screen)) + (other-screen screen 1 #t)) (delete-screen! screen)))) ;; Kill the buffer, then maybe select another browser. (let ((browser (get-buffer-browser buffer 'ASSOCIATED-WITH-BROWSER))) diff --git a/v7/src/edwin/edwin.pkg b/v7/src/edwin/edwin.pkg index 7729ba809..bf4c4602a 100644 --- a/v7/src/edwin/edwin.pkg +++ b/v7/src/edwin/edwin.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: edwin.pkg,v 1.264 2000/10/26 02:28:10 cph Exp $ +$Id: edwin.pkg,v 1.265 2000/12/01 06:07:21 cph Exp $ Copyright (c) 1989-2000 Massachusetts Institute of Technology @@ -995,7 +995,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. os/interprogram-cut os/interprogram-paste x-root-window-size - x-screen-auto-raise x-screen-ignore-focus-button? x-selection-timeout xterm-screen/flush! @@ -1016,7 +1015,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (files "xcom") (parent (edwin)) (export (edwin) - edwin-command$auto-raise-mode edwin-command$lower-frame edwin-command$raise-frame edwin-command$set-background-color @@ -1034,7 +1032,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. edwin-command$set-mouse-shape edwin-command$show-frame-position edwin-command$show-frame-size - edwin-command$x-auto-raise-mode edwin-command$x-lower-screen edwin-command$x-mouse-ignore edwin-command$x-mouse-keep-one-window diff --git a/v7/src/edwin/os2term.scm b/v7/src/edwin/os2term.scm index eb50da2b3..23cae831c 100644 --- a/v7/src/edwin/os2term.scm +++ b/v7/src/edwin/os2term.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: os2term.scm,v 1.21 1999/01/02 06:11:34 cph Exp $ +;;; $Id: os2term.scm,v 1.22 2000/12/01 06:07:26 cph Exp $ ;;; -;;; Copyright (c) 1994-1999 Massachusetts Institute of Technology +;;; Copyright (c) 1994-2000 Massachusetts Institute of Technology ;;; ;;; This program is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License as @@ -950,7 +950,7 @@ (begin (set-screen-visibility! screen 'UNMAPPED) (and (selected-screen? screen) - (let ((screen (other-screen screen 1 #f))) + (let ((screen (other-screen screen))) (and screen (make-input-event 'SELECT-SCREEN select-screen diff --git a/v7/src/edwin/scrcom.scm b/v7/src/edwin/scrcom.scm index 54da998d2..0377c1550 100644 --- a/v7/src/edwin/scrcom.scm +++ b/v7/src/edwin/scrcom.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: scrcom.scm,v 1.7 2000/12/01 05:24:42 cph Exp $ +;;; $Id: scrcom.scm,v 1.8 2000/12/01 06:07:30 cph Exp $ ;;; ;;; Copyright (c) 1990-2000 Massachusetts Institute of Technology ;;; @@ -42,7 +42,7 @@ This command selects the frame ARG steps away in that order. A negative ARG moves in the opposite order." "p" (lambda (arg) - (let ((screen (other-screen (selected-screen) arg #f))) + (let ((screen (other-screen (selected-screen) arg))) (if (not screen) (editor-error "No other visible frame.")) (select-screen screen)))) diff --git a/v7/src/edwin/screen.scm b/v7/src/edwin/screen.scm index df63837cf..3831e9ee9 100644 --- a/v7/src/edwin/screen.scm +++ b/v7/src/edwin/screen.scm @@ -1,8 +1,8 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: screen.scm,v 1.117 1999/05/08 19:22:54 cph Exp $ +;;; $Id: screen.scm,v 1.118 2000/12/01 06:07:35 cph Exp $ ;;; -;;; Copyright (c) 1989-1999 Massachusetts Institute of Technology +;;; Copyright (c) 1989-2000 Massachusetts Institute of Technology ;;; ;;; This program is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License as @@ -63,6 +63,8 @@ (operation/write-substring! false read-only true) (preemption-modulus false read-only true) (root-window false) + ;; Visibility is one of the following: + ;; VISIBLE PARTIALLY-OBSCURED OBSCURED UNMAPPED DELETED (visibility 'VISIBLE) (needs-update? false) (in-update? false) @@ -108,7 +110,7 @@ 'DESELECT-SCREEN)) (define (screen-discard! screen) - (if (not (eq? (screen-visibility screen) 'DELETED)) + (if (not (screen-deleted? screen)) (begin (set-screen-visibility! screen 'DELETED) (for-each (lambda (window) (send window ':kill!)) @@ -141,8 +143,8 @@ (editor-frame-screen (window-root-window window))) (define (screen-visible? screen) - (or (eq? 'VISIBLE (screen-visibility screen)) - (eq? 'PARTIALLY-OBSCURED (screen-visibility screen)))) + (not (or (screen-deleted? screen) + (eq? 'UNMAPPED (screen-visibility screen))))) (define-integrable (screen-deleted? screen) (eq? 'DELETED (screen-visibility screen))) @@ -655,7 +657,8 @@ screen (lambda () (and (thunk) - (if (screen-visible? screen) + (if (memq (screen-visibility screen) + '(VISIBLE PARTIALLY-OBSCURED)) (and (or (not (screen-needs-update? screen)) (and (not (display-style/no-screen-output? display-style)) diff --git a/v7/src/edwin/win32.scm b/v7/src/edwin/win32.scm index 70aa3b919..06624fec3 100644 --- a/v7/src/edwin/win32.scm +++ b/v7/src/edwin/win32.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: win32.scm,v 1.13 2000/05/01 03:01:39 cph Exp $ +;;; $Id: win32.scm,v 1.14 2000/12/01 06:07:39 cph Exp $ ;;; ;;; Copyright (c) 1994-2000 Massachusetts Institute of Technology ;;; @@ -666,7 +666,7 @@ (screen-force-update screen) (make-input-event 'UPDATE update-screen! screen #f)) (and (selected-screen? screen) - (let ((screen (other-screen screen 1 #f))) + (let ((screen (other-screen screen))) (and screen (make-input-event 'SELECT-SCREEN select-screen diff --git a/v7/src/edwin/wincom.scm b/v7/src/edwin/wincom.scm index d7ed9c194..41b382ae9 100644 --- a/v7/src/edwin/wincom.scm +++ b/v7/src/edwin/wincom.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: wincom.scm,v 1.130 2000/10/27 04:01:16 cph Exp $ +;;; $Id: wincom.scm,v 1.131 2000/12/01 06:07:43 cph Exp $ ;;; ;;; Copyright (c) 1987, 1989-2000 Massachusetts Institute of Technology ;;; @@ -321,7 +321,7 @@ or if the window is the only window of its frame." (let ((window (selected-window))) (if (and (window-has-no-neighbors? window) (use-multiple-screens?) - (other-screen? (selected-screen))) + (other-screen (selected-screen) 1 #t)) (delete-screen! (selected-screen)) (window-delete! window))))) @@ -340,7 +340,7 @@ or if the window is the only window of its frame." (let ((window (other-window n))) (if (selected-window? window) (and (use-multiple-screens?) - (let ((screen (other-screen (selected-screen) 1 #f))) + (let ((screen (other-screen (selected-screen)))) (and screen (screen-selected-window screen)))) window)))) @@ -382,10 +382,11 @@ or if the window is the only window of its frame." (let ((screen (other-screen (if (or (default-object? screen) (not screen)) (selected-screen) - screen) - 1 #t))) + screen)))) (if screen - (select-buffer buffer (screen-selected-window screen)) + (let ((window (screen-selected-window screen))) + (select-window window) + (select-buffer buffer window)) (make-screen buffer))) (editor-error "Display doesn't support multiple screens"))) @@ -545,7 +546,7 @@ Also kills any pop up window it may have created." (set-variable! split-height-threshold limit)) (maybe-deselect-buffer-layout screen) (cond ((and (use-multiple-screens?) - (other-screen screen 1 #t)) + (other-screen screen)) => (lambda (screen) (pop-into-window (screen-selected-window screen)))) ((ref-variable preserve-window-arrangement) -- 2.25.1