[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#303889: xterm: missed focus event with ion3



Package: xterm
Version: 4.3.0.dfsg.1-12.0.1
Severity: minor

When starting xterm under the ion3 window manager (I'm told this also
happens with ion2), the text cursor doesn't react when the window gains
/ loses focus - it always blinks (if blinking is enabled), and is
always solid (as opposed to outline).  I've dug into this, but hit a
wall where I can't tell if it's xterm or the window manager to blame,
or even the X server itself (XFree86 4.3.0 + Debian sarge patches).

          *          *          *

Analysis: early in the life of the app, it's supposed to receive an
XFocusInEvent of detail 'NotifyPointer' followed almost immediately by
an XFocusOutEvent also of detail 'NotifyPointer'.  This according to
xev.  From a few printf statements, xterm appears to never be receiving
that particular XFocusOutEvent.  This mystifies me - where did that
extra event go?  Was it never sent?

The effect is that the 'screen->select' has the INWINDOW bit set
permanently, which causes ShowCursor() to think the cursor should never
appear unfocused (non-blinking and/or outline).

Cure: This can usually be cured by dragging the xterm window between
one ion pane and another.  For some reason the XFocusOutEvent with
detail 'NotifyPointer' suddenly appears when you do this, resetting the
INWINDOW bit of the screen->select field.  Other unknown happenings may
also trigger this same event - I'm not sure.

Workaround: #define INWINDOW 0 in xc/programs/xterm/ptyx.h.  Then xterm
effectively ignores any XFocusChangeEvent with the 'NotifyPointer'
detail.  Obviously this is only a hack - there must have been a reason
to keep track of NotifyPointer events separately from NotifyAncestor
and other sorts of XFocusChangeEvent, not that I know the reason.
(I get the idea it's one of those things buried deep in the ICCCM.)

Peter

Attachment: signature.asc
Description: Digital signature


Reply to: