Skip to content

Commit

Permalink
Don't use the <<EnteredChild>> event anymore internally in Tk. Eradic…
Browse files Browse the repository at this point in the history
…ate the <<NOTE-PW-LEAVE-NOTIFYINFERIOR>>.
  • Loading branch information
fvogelnew1 committed Mar 13, 2024
1 parent ab88534 commit 4a474d3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
4 changes: 1 addition & 3 deletions doc/ttk_panedwindow.n
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,7 @@ widget subcommands (see \fIttk::widget(n)\fR for details):
.SH "VIRTUAL EVENTS"
.PP
The panedwindow widget generates an \fB<<EnteredChild>>\fR virtual event on
LeaveNotify/NotifyInferior events, because Tk does not execute binding scripts
for <Leave> events when the pointer crosses from a parent to a child. The
panedwindow widget needs to know when that happens.
LeaveNotify/NotifyInferior events.
.SH "STYLING OPTIONS"
.PP
The class name for a \fBttk::panedwindow\fP is \fBTPanedwindow\fP. The
Expand Down
14 changes: 8 additions & 6 deletions generic/ttk/ttkPanedwindow.c
Original file line number Diff line number Diff line change
Expand Up @@ -469,14 +469,16 @@ static Ttk_ManagerSpec PanedManagerSpec = {
/*------------------------------------------------------------------------
* +++ Event handler.
*
* <<NOTE-PW-LEAVE-NOTIFYINFERIOR>>
* Tk does not execute binding scripts for <Leave> events when
* the pointer crosses from a parent to a child. This widget
* needs to know when that happens, though, so it can reset
* the cursor.
*
* This event handler generates an <<EnteredChild>> virtual event
* on LeaveNotify/NotifyInferior.
* This was originally introduced because Tk used to discard events with
* detail field NotifyInferior. The <<EnteredChild>> event was then used
* to reset the cursor when the pointer crosses from a parent to a child.
* Since ticket #47d4f29159, LeaveNotify/NotifyInferior are no longer
* discarded: the <Leave> event will trigger even with NotifyInferior
* detail field. The generated <<EnteredChild>> is nevertheless kept for
* backwards compatibility purpose since it is publicly documented,
* meaning that someone could bind to it.
*/

static const unsigned PanedEventMask = LeaveWindowMask;
Expand Down
2 changes: 0 additions & 2 deletions library/ttk/panedwindow.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ bind TPanedwindow <ButtonRelease-1> { ttk::panedwindow::Release %W %x %y }
bind TPanedwindow <Motion> { ttk::panedwindow::SetCursor %W %x %y }
bind TPanedwindow <Enter> { ttk::panedwindow::SetCursor %W %x %y }
bind TPanedwindow <Leave> { ttk::panedwindow::ResetCursor %W }
# See <<NOTE-PW-LEAVE-NOTIFYINFERIOR>>
bind TPanedwindow <<EnteredChild>> { ttk::panedwindow::ResetCursor %W }

## Sash movement:
#
Expand Down

0 comments on commit 4a474d3

Please sign in to comment.