summaryrefslogtreecommitdiffstats
path: root/generic/tkUtil.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 /generic/tkUtil.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 'generic/tkUtil.c')
-rw-r--r--generic/tkUtil.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/generic/tkUtil.c b/generic/tkUtil.c
index 1a1efa1..e32fdf3 100644
--- a/generic/tkUtil.c
+++ b/generic/tkUtil.c
@@ -1177,7 +1177,7 @@ TkSendVirtualEvent(
const char *eventName,
Tcl_Obj *detail)
{
- union {XEvent general; XVirtualEvent virtual;} event;
+ union {XEvent general; XVirtualEvent virt;} event;
memset(&event, 0, sizeof(event));
event.general.xany.type = VirtualEvent;
@@ -1185,10 +1185,8 @@ TkSendVirtualEvent(
event.general.xany.send_event = False;
event.general.xany.window = Tk_WindowId(target);
event.general.xany.display = Tk_Display(target);
- event.virtual.name = Tk_GetUid(eventName);
- if (detail != NULL) {
- event.virtual.user_data = detail;
- }
+ event.virt.name = Tk_GetUid(eventName);
+ event.virt.user_data = detail;
Tk_QueueWindowEvent(&event.general, TCL_QUEUE_TAIL);
}