[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get the current screen

    Date: Tue, 20 Nov 1990 15:44-0500
    From: Moon@STONY-BROOK.SCRC.Symbolics.COM (David A. Moon)

    Calling tv:mouse-default-superior is a good answer.  Note that it takes a window as
    an optional argument, defaulting to the value of *TERMINAL-IO*.

    Another possibility is to send the :SCREEN message to a window to get the screen that
    that window is on.  Both of these techniques assume that you want to put a window on
    the same screen as another window, which is the normal case.  Using tv:mouse-default-superior
    gives more robustness in the face of various unusual situations, for example if you have
    a color screen and a monochrome screen sharing the same mouse, it will use the screen
    the mouse is on even if the window you give is on the other screen; for menus you
    generally would rather have them appear next to the mouse.


I will point out that David's "good answer" might be an appropriate
answer for pop up menus.  As his second paragraph indicates, there are
other possibilities which in some cases may be better.  

Drawing on a bug (IMHO) in Genera as an example:

The Color Image-Calc system uses a style of interaction where
*TERMINAL-IO* is a window on the B&W screen while the mouse is on the
color screen where the images are displayed.  (The user typically
manipulates things via mouse interactions but sometimes needs to type
things in.  The input goes to the listener on the B&W.  There are shared
I/O buffers.)  Obviously if we want a pop-up menu to be displayed, we
want that on the color screen.  TV:MOUSE-DEFAULT-SUPERIOR would work for
that.  (Actually, we don't use TV:MOUSE-DEFAULT-SUPERIOR.  The IC menus
are always displayed on the screen that the images are drawn on.)

However, if Image-Calc breaks and we ask to go into the Display Debugger
(note that the Window Debugger doesn't have this problem), then, if the
Display Debugger hasn't been used before, the Display Debugger appears
on the color screen (on top of the images) rather than on the B&W where the
textual interaction (echoing and text output) is going on.

The problem is that the display debugger frames are created through a
TV:DEFWINDOW-RESOURCE which gives a default superior from 
(TV:MOUSE-DEFAULT-SUPERIOR).  The Display Debugger resource definition
doesn't override this so we lose.

[I've just reported this to Customer-Reports, along with the (I guess related)
problem that if you later go into the Display Debugger from a state in
which both *TERMINAL-IO* and the mouse are on the B&W screen, the Display
Debugger on the color screen is reused (and so you go into the debugger on
the color screen).    In my bug report, I suggested that the Display Debugger
use a :SUPERIOR (TV:CONSOLE-DEFAULT-SUPERIOR) but I am not sure that works
for X screens.]