🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #98501

Re: hollow cursor (input focus) bug in xemacs?

#98501
From: Barry A. Warsaw
Date: Thu, 27 Jun 1991 17:26
88 lines
3286 bytes
>>>>> "Bill" == Bill Janssen <janssen@parc.xerox.COM> writes:

	Bill> When running emacs 18.57 on an X display (MIT X11R4.18 on a
	Bill> Sun, SunOS 4.1.1), I keep getting into a mode where the
	Bill> emacs starts drawing a hollow cursor (the same cursor you
	Bill> see when the input focus is not on the emacs window.)  It
	Bill> doesn't seem to recover from this state -- that is, the
	Bill> cursor remains hollow for the rest of the emacs session, and
	Bill> will not become filled even when input focus is explicitly
	Bill> given to the window.

	Bill> Any suggestions?

Yes. Apply the following patch. It will fix this problem for almost
all situations.  The recently released X program "unclutter" will
break this, though unclutter works fine with xterm.  I'm working on a
better patch to emacs -- one which emulates xterm more closely.  Near
as I can tell, xterm is unbreakable :-).  I'll post that patch when I
finish.

-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.91Jun27132601@warsaw.nlm.nih.gov>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cis.ohio-state.edu!nlm.NIh.GOV!warsaw
References: warsaw@nlm.NIh.GOV (Barry A. Warsaw)

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,8542ea41633dc4ec
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1991-06-27 10:26:01 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cis.ohio-state.edu!nlm.NIh.GOV!warsaw
From: warsaw@nlm.NIh.GOV (Barry A. Warsaw)
Newsgroups: gnu.emacs.bug
Subject: Re: hollow cursor (input focus) bug in xemacs?
Message-ID: <WARSAW.91Jun27132601@warsaw.nlm.nih.gov>
Date: 27 Jun 91 17:26:01 GMT
References: warsaw@nlm.NIh.GOV (Barry A. Warsaw)
Sender: gnulists@ai.mit.edu
Reply-To: warsaw@nlm.nih.gov
Distribution: gnu
Organization: Century Computing, Inc.
Lines: 88
Approved: bug-gnu-emacs@prep.ai.mit.edu