Article View: gnu.emacs.bug
Article #98617Re: X Focus problem, vers 18.57
From: Barry A. Warsaw
Date: Fri, 10 May 1991 19:38
Date: Fri, 10 May 1991 19:38
72 lines
2469 bytes
2469 bytes
Oops, I just looked a little closer at the logic. Try this patch
instead, it removes a server roundtrip (call to XGetInputFocus) from
the two cases where that info isn't used.
-Barry
--------------------cut here--------------------
*** x11term.c.orig Wed Mar 6 13:45:49 1991
--- x11term.c Fri May 10 15:08:44 1991
***************
*** 161,167 ****
int XXfontw, XXfonth, XXbase, XXisColor;
- /* Nonzero means Emacs has explicit keyboard focus. */
- int x_focus_flag;
-
Colormap XXColorMap;
char *default_window;
--- 161,164 ----
***************
*** 1377,1400 ****
break;
case FocusIn:
- x_focus_flag = 1;
- case EnterNotify:
- if (event.type == FocusIn || (!x_focus_flag && event.xcrossing.focus))
- {
- CursorToggle ();
- CursorOutline = 0;
- CursorToggle ();
- }
- break;
-
case FocusOut:
! x_focus_flag = 0;
case LeaveNotify:
! if (event.type == FocusOut || (!x_focus_flag && event.xcrossing.focus))
! {
! CursorToggle ();
! CursorOutline = 1;
! CursorToggle ();
! }
break;
--- 1374,1399 ----
break;
+ /* focus logic rewritten 8-Mar-1991 bwarsaw@cen.com */
case FocusIn:
case FocusOut:
! case EnterNotify:
case LeaveNotify:
! {
! int cursor = -1; /* 0=on, 1=off, -1=no change */
!
! if( event.type == FocusIn ) cursor = 0;
! else if( event.type == FocusOut ) cursor = 1;
! else {
! Window focus;
! int revert_to; /* dummy return val */
! XGetInputFocus( XXdisplay, &focus, &revert_to );
! if( focus == PointerRoot )
! cursor = (event.type == LeaveNotify) ? 1 : 0;
! }
! if( cursor == -1 ) break;
! CursorToggle();
! CursorOutline = cursor;
! CursorToggle();
! }
break;
Technical Details
Message-ID:
<WARSAW.91May10153816@warsaw.nlm.nih.gov>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!unreplyable!garbageShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,5a57a096ee6d8757 X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1991-05-10 12:38:16 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!unreplyable!garbage From: warsaw@nlm.nih.gov (Barry A. Warsaw) Newsgroups: gnu.emacs.bug Subject: Re: X Focus problem, vers 18.57 Message-ID: <WARSAW.91May10153816@warsaw.nlm.nih.gov> Date: 10 May 91 19:38:16 GMT Sender: daemon@tut.cis.ohio-state.edu Reply-To: warsaw@nlm.nih.gov Distribution: gnu Organization: Century Computing, Inc. Lines: 72 Approved: bug-gnu-emacs@prep.ai.mit.edu