🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fj.editor.emacs
Article #3353

Re: Window focus of Emacs (Re: using HAVE_X_WINDOWS .. )

#3353
From: FUKUMOTO Atsushi
Date: Fri, 10 Jan 1992 10:42
65 lines
3034 bytes
GNU Emacs $@$N(J X11$@$G$N%U%)!<%+%9=hM}$K$D$$(J$@$F!#(J

$@!!0J2<$N$h$&$J5-;v$,$"$j$^$7$?!#;d$O$^$@(J 18.55 $@$r;H$C$F$$$k$N$G$9$,!"(J 
18.57 $@$K$O0J2<$N%3!<%I$,(J$@4{$K:N$jF~$l$i$l$F$$$k$h$&$G$9!#(J


$@!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!J!K\!w0B@>E7Ln8&(J.$@7W;;5!2J3X@l96(J.$@7D(J$@1~Bg(J



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:38:47 GMT


/* 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: <FUKUMOTO.92Jan10194209@lyra.aa.cs.keio.ac.jp>
Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr!ccut!wnoc-tyo-news!sh.wide!kogwy!cs-keio!csgwy!fukumoto
References: <KASAHARA.92Jan6114301@nanotsu.csce.kyushu-u.ac.jp>

Show Full Headers
Complete Article Headers
X-Google-Language: Japanese,JIS
X-Google-Thread: ff358,31a79e702de9c1d3
X-Google-Attributes: gidff358,public
X-Google-ArrivalTime: 1992-01-10 04:43:51 PST
Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr!ccut!wnoc-tyo-news!sh.wide!kogwy!cs-keio!csgwy!fukumoto
From: fukumoto@aa.cs.keio.ac.jp (FUKUMOTO Atsushi)
Newsgroups: fj.editor.emacs
Subject: Re: Window focus of Emacs (Re: using HAVE_X_WINDOWS .. )
Message-ID: <FUKUMOTO.92Jan10194209@lyra.aa.cs.keio.ac.jp>
Date: 10 Jan 92 10:42:09 GMT
References: <KASAHARA.92Jan6114301@nanotsu.csce.kyushu-u.ac.jp>
Sender: news@cs.keio.ac.jp
Distribution: fj
Organization: Anzai Lab., Keio Univ., Yokohama, Japan.
Lines: 65
In-reply-to: kasahara@csce.kyushu-u.ac.jp's message of 6 Jan 92 02:43:01 GMT