From xemacs-m  Fri Feb 21 04:07:19 1997
Received: from frege.math.ethz.ch (root@frege-d-math-north-g-west.math.ethz.ch [129.132.145.3])
	by xemacs.org (8.8.5/8.8.5) with SMTP id EAA28725
	for <xemacs-beta@xemacs.org>; Fri, 21 Feb 1997 04:07:09 -0600 (CST)
From: vroonhof@math.ethz.ch
Received: from loewner.math.ethz.ch (loewner [129.132.145.82]) by frege.math.ethz.ch (8.6.12/Main-STAT-mailer) with ESMTP id LAA10289; Fri, 21 Feb 1997 11:06:58 +0100
Received: (vroonhof@localhost) by loewner.math.ethz.ch (8.6.12/D-MATH-client) id LAA25829; Fri, 21 Feb 1997 11:07:07 +0100
Message-Id: <199702211007.LAA25829@loewner.math.ethz.ch>
Subject: Re: Minor 19.15-b94 ./configure problem on Solaris 2.x
To: steve@miranova.com (Steven L Baur)
Date: Fri, 21 Feb 1997 11:07:06 +0100 (MET)
Cc: xemacs-beta@xemacs.org
In-Reply-To: <m2sp2qykzn.fsf@altair.xemacs.org> from "Steven L Baur" at Feb 20, 97 06:02:36 pm
X-Mailer: ELM [version 2.4 PL24 PGP2]
Content-Type: text


[Note: extensive quoting left on for the people on xemacs-beta]

> This steps right on the patch David Moore supplied earlier to deal
> with this problem so you're in the right place.

I have tested it now. This patch solves it for me.
I had thought David's patch had already been aplied and I was seeing
something else :-(.

[late addition: I have now noticed you added David's patch. I looked
at it. It _does_ do something different. The problem here is that the
window manager Frvm+pagers implements the virtual page stuff by
changing the visibility and sends VisibilityNotify notify messages.
XEmacs is not prepared and thinks the visibility only changes on
Map/UnMap events.
We wouldn't have noticed this (Xemacs simply would
have thought they were still visible) if it weren't for the fact that
frame-visisble-p checks the visibility explicitly and sets f->visible
accordingly. We could disable the check but I think it is nicer to
just cooperate with the window mamager and handle the events. I don't
know the X protocol enough to now who is right or wrong but this even
should make XEmacs faster when there are a lot windows on other pages
]

N.B. Do we have to more than just toggle f->visisble? Set some flags etc?

> 
> vroonhof  writes:
> 
> > P.S. I think I found my frame freezing bug. It is because XEmacs
> > forgets to update the f->invisble when an VisibilityNotify messages
> > comes. (The fvwm pager sends those when changing pages) I don't know
> > the X protocol enough to know which is correct. I am recompiling
> > overnight with the following patch
> 
> > --- event-Xt.c.orig     Tue Feb 11 23:03:31 1997
> > +++ event-Xt.c  Thu Feb 20 23:31:54 1997
> > @@ -1222,8 +1222,14 @@
>        
> >      case VisibilityNotify: /* window visiblity has changed */
> >        if (event->xvisibility.window == XtWindow (FRAME_X_SHELL_WIDGET (f)))
> > -       FRAME_X_TOTALLY_VISIBLE_P (f) =
> > -         (event->xvisibility.state == VisibilityUnobscured);
> > +       {
> > +         /* Note that the fvwm pager only sends VisibilityNotify when
> > +            changing pages. Is this all we need to do ? JV */
> > +         FRAME_VISIBLE_P (f) =
> > +           ( event->xvisibility.state != VisibilityFullyObscured);
> > +         FRAME_X_TOTALLY_VISIBLE_P (f) =
> > +           (event->xvisibility.state == VisibilityUnobscured);
> > +       }
> >        break;
>        
> >      case ConfigureNotify:
> 
> 
> > I have now found a sure fire way to reproduce the freeze. Run Emacs
> > under a debugger in an xterm and fvwm with different pages. Put the
> > debugger xterm in another fvwm page as the XEmacs frames. Set a brake point
> > Fframe_visible_p. Then execute
> 
> > (frame-visible-p (nth 0 (frame-list)))
> 
> > This will trigger the breakpoint. Switch to the page with the debugger
> > and step trhough Fframe_visible_p. Because the frame window is now in
> > an  VisibilityFullyObscured state f->invisible will get set to 0.
> > Then continue execution and switch back to the Emacs frames. One of
> > them is now frozen. The only way to reset f->visible is by
> > De-iconfiying or calling frame-visible-p again (This is how I found
> > the bug).
> 
> > I'll let you know.
> 
> O.K.
> 
> Mail-Copies-To: never
> From: David Moore <dmoore@UCSD.EDU>
> Date: 20 Jan 1997 21:27:16 -0800
> In-Reply-To: David Moore's message of 20 Jan 1997 21:00:44 -0800
> Message-ID: <rv680rlhsb.fsf@sdnp5.ucsd.edu>

> 	Patch to event-Xt.c.  Don't update the visibility parameter when
> it's for a different window than the frame.
> 
> --- event-Xt.c.orig	Mon Jan 20 20:21:11 1997
> +++ event-Xt.c	Mon Jan 20 21:23:42 1997
> @@ -1261,10 +1261,13 @@
>        break;
>        
>      case VisibilityNotify: /* window visiblity has changed */
> -      if (event->xvisibility.state == VisibilityUnobscured)
> -	FRAME_X_TOTALLY_VISIBLE_P (f) = 1;
> -      else
> -	FRAME_X_TOTALLY_VISIBLE_P (f) = 0;
> +      if (event->xvisibility.window == XtWindow (FRAME_X_SHELL_WIDGET (f)))
> +	{
> +          if (event->xvisibility.state == VisibilityUnobscured)
> +	    FRAME_X_TOTALLY_VISIBLE_P (f) = 1;
> +          else
> +	    FRAME_X_TOTALLY_VISIBLE_P (f) = 0;
> +	}
>        break;
>        
>      case ConfigureNotify:
> 
> -- 
> David Moore <dmoore@ucsd.edu>       | Computer Systems Lab      __o
> UCSD Dept. Computer Science - 0114  | Work: (619) 534-8604    _ \<,_
> La Jolla, CA 92093-0114             | Fax:  (619) 534-1445   (_)/ (_)
> <URL:http://oj.egbt.org/dmoore/>    | In a cloud bones of steel.
> 
> 
> -- 
> steve@miranova.com baur
> Unsolicited commercial e-mail will be billed at $250/message.
> 
> --Multipart_Thu_Feb_20_18:02:35_1997-1--
> 


-- 
Jan Vroonhof                    http://www.math.ethz.ch/~vroonhof/
Mathematik,                                  vroonhof@math.ethz.ch
HG E16, ETH-Zentrum,                      Tel: +41-1-6325456/25154
Raemistrasse 101, CH-8092 Zuerich.              Fax: +41-1-6321085

