Tk Source Code

View Ticket
Login
Ticket UUID: fe87e9af39298ccd2fce6f564a5314357783e94
Title: X-input extension events are not transfered to Tcl.
Type: Bug Version: 8.6
Submitter: JanO3ll3n Created on: 2023-04-19 14:51:31
Subsystem: 69. Events Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2023-04-20 06:55:35
Resolution: Fixed Closed By: fvogel
    Closed on: 2023-04-20 06:55:35
Description:

Since the commit 3682b41, all X-input events with a type greater than MappingNotify are ignored. However, this also ignores some/all events of the X input extension, since the extension event types are not constants as described in X Input Device Extension Library:

Extension event types are not constants. Instead, they are dynamically allocated by the extension's request to the X server when the extension is initialized.

Accordingly, the problem could be solved by removing the following lines in tk/unix/tkUnixEvent.c.

if (event.type > MappingNotify) {
    continue;
}

Thanks a lot!

User Comments: fvogel added on 2023-04-20 06:55:35:

Thanks for the explanation. For the record, the fix is [ccee45f259].


jan.nijtmans added on 2023-04-19 21:15:05:

The reason why this was done is because VirtualEvent (= MappingNotify + 1) up to MouseWheelEvent (= MappingNotify + 4) are internal Tk event-types. If someone else outside Tk sends them through X11, they - most likely - would be totally mis-interpreted and lead to crashes. If you want to hack a running Tk application, this would probably the way to do it.

But there's no reason to restrict anything above MappingNotify + 4, since Tk doesn't handle them.


fvogel added on 2023-04-19 17:34:41:

Jan, assigning to you if you don't mind, since you're the committer of [fdd06f8b195289f1]. From the commit log I'm not able to see why this commit was done.