🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #1773

Re: X11 focus management

#1773
From: carroll
Date: Sat, 16 Dec 1989 17:39
48 lines
2245 bytes
/* Written 11:48 am  Dec 14, 1989 by victor@MIZAR.DOCS.UU.SE in s.cs.uiuc.edu:gnu.emacs.bug */
/* ---------- "X11 focus management" ---------- */
>In GNU Emacs 18.55.5 of Thu Dec  7 1989 on mizar (berkeley-unix)

>Emacs doesn't do focus management (for highlighting the cursor), as
>src/x11term.c states in function internal_socket_read().  Instead it
>does Enter/Leave window management, which is not really relevant.
It's sort of relevant, see below

>I'm no Xpert, but it seems to work if you simply change the case
>EnterNotify/LeaveNotify pair with FocusIn/FocusOut, and change the
>XSelectInput call in XInitWindow to use FocusChangeMask instead of
>EnterWindowMask | LeaveWindowMask.
No, that doesn't work. I tried it. The problem is that if the focus is not
explicitly set, then Emacs never thinks it has the focus (which it does if
the cursor is in the window). I've fixed this problem in Epoch, but the
code should still work in 18.55: (The if statements are the key difference
between your version and mine)

    case EnterNotify :
    case FocusIn :
	if (event.type == FocusIn || event.xcrossing.focus)
	    {
	    CursorToggle ();
	    CursorOutline = 0;
	    CursorToggle ();
	    }
	break;

    case LeaveNotify :
    case FocusOut :
	if (event.type == FocusOut || event.xcrossing.focus)
	    {
	    CursorToggle ();
	    CursorOutline = 1;
	    CursorToggle ();
	    }
	break;

The XSelectInput call must still be modified to accept Focus events _in
addition to_ Enter and Leave events.

/* End of text from s.cs.uiuc.edu:gnu.emacs.bug */

Alan M. Carroll                "Oh goody, the Illudium Q-36 Explosive
carroll@s.cs.uiuc.edu           Space Modulator!"
CS Grad / U of Ill @ Urbana    ...{ucbvax,pur-ee,convex}!s.cs.uiuc.edu!carroll
Technical Details
Message-ID: <223400004@s.cs.uiuc.edu>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!wuarchive!brutus.cs.uiuc.edu!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!m.cs.uiuc.edu!s.cs.uiuc.edu!carroll

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!uunet!wuarchive!brutus.cs.uiuc.edu!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!m.cs.uiuc.edu!s.cs.uiuc.edu!carroll
From: carroll@s.cs.uiuc.edu
Newsgroups: gnu.emacs.bug
Subject: Re: X11 focus management
Message-ID: <223400004@s.cs.uiuc.edu>
Date: 16 Dec 89 17:39:08 GMT
Lines: 48
Nf-ID: #R:<8912141748.AAmizar10997@mizar.D:-42:s.cs.uiuc.edu:223400004:000:1755
Nf-From: s.cs.uiuc.edu!carroll    Dec 15 19:37:00 1989