Xref: utzoo comp.sys.amiga:20570 comp.sys.amiga.tech:1136 Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!quintus!pds From: pds@quintus.uucp (Peter Schachte) Newsgroups: comp.sys.amiga,comp.sys.amiga.tech Subject: Re: Active Window (Re: An annoying feature of 1.1,1.2, etc that I want gone) Keywords: Suggestion Message-ID: <145@quintus.UUCP> Date: 28 Jun 88 22:30:05 GMT References: <4023@pasteur.Berkeley.Edu> <135@quintus.UUCP> <2166@sugar.UUCP> <339@boing.UUCP> <137@quintus.UUCP> <341@boing.UUCP> <4120@cbmvax.UUCP> Sender: news@quintus.UUCP Reply-To: pds@quintus.UUCP (Peter Schachte) Organization: Quintus Computer Systems, Inc. Lines: 37 In article <4120@cbmvax.UUCP> joe@cbmvax.UUCP (Joe O'Hara) writes: >Another approach would be two pointers in the window structure, PREV_Window >and NEXT_Window. When a window in the middle of the chain closes, it's a >simple matter to update the pointers in the affected windows. This seems like the most efficient (and simple) approach. There's one detail that needs to be considered, though: these chains can easily be circular. Click in one window, then a second, then back in the first. Now both pointers of each window point to the other. Now close one window. The other becomes the active one, and has both pointers pointing to itself. Now when you close THIS window, you have to be careful you don't find yourself in GURU-land. Also, there could be other windows on the screen, one of which SHOULD be given the focus. A small modification to this algorithm could fix this problem. Here's a rough code fragment: new_focus_window->PREV_Window->NEXT_Window = new_focus_window->NEXT_Window; new_focus_window->NEXT_Window->PREV_Window = new_focus_window->PREV_Window; new_focus_window->NEXT_Window = current_focus_window; new_focus_window->PREV_Window = NULL; current_focus_window = new_focus_window; This way, you avoid cycles, and keep all the windows in this "focus stack." An interesting, and I believe positive, side-effect of this is that there would ALWAYS be a focus window as long as there are ANY windows on the current screen. I think I would find this the best possible focus management scheme, much better than the real-estate (sun) approach. So how about it? Doesn't seem like it would be too difficult to implement. -Peter Schachte pds@quintus.uucp ..!sun!quintus!pds