summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixEvent.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-02-05 13:45:27 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-02-05 13:45:27 (GMT)
commite9bfc5a20ff253e4a7c23f86ca1656f8981d081c (patch)
treef75006937dbfe4ebdc6967c22afe0fb7133018ab /unix/tkUnixEvent.c
parentbf8f5544fe873145780724a6fa9eda883487b3f8 (diff)
downloadtk-e9bfc5a20ff253e4a7c23f86ca1656f8981d081c.zip
tk-e9bfc5a20ff253e4a7c23f86ca1656f8981d081c.tar.gz
tk-e9bfc5a20ff253e4a7c23f86ca1656f8981d081c.tar.bz2
(cherry-pick): Don't panic for "Wild GenericEvent"'s: Just filter out all events Tk doesn't know about.
(cherry-pick): Protect better against possible confusion between XGenericEvent's and (Tcl-specific) XVirtualEvent's: If "name" == NULL, assume it's a XGenericEvent, so don't crash on that just ignore. Also don't use "virtual" as variable name.
Diffstat (limited to 'unix/tkUnixEvent.c')
-rw-r--r--unix/tkUnixEvent.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/unix/tkUnixEvent.c b/unix/tkUnixEvent.c
index 496a72d..bd55195 100644
--- a/unix/tkUnixEvent.c
+++ b/unix/tkUnixEvent.c
@@ -360,9 +360,6 @@ TransferXEventsToTcl(
int type;
XEvent x;
TkKeyEvent k;
-#ifdef GenericEvent
- XGenericEvent xge;
-#endif
} event;
Window w;
TkDisplay *dispPtr = NULL;
@@ -380,12 +377,9 @@ TransferXEventsToTcl(
while (QLength(display) > 0) {
XNextEvent(display, &event.x);
-#ifdef GenericEvent
- if (event.type == GenericEvent) {
- Tcl_Panic("Wild GenericEvent; panic! (extension=%d,evtype=%d)",
- event.xge.extension, event.xge.evtype);
+ if (event.type > MappingNotify) {
+ continue;
}
-#endif
w = None;
if (event.type == KeyPress || event.type == KeyRelease) {
for (dispPtr = TkGetDisplayList(); ; dispPtr = dispPtr->nextPtr) {