diff options
author | fvogel <fvogelnew1@free.fr> | 2016-05-01 19:51:15 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2016-05-01 19:51:15 (GMT) |
commit | ede13558f13645c01b9dff12f05b15d6e0435995 (patch) | |
tree | b4628d9dc96cf310e71ee2510074a7e570cd805b /generic/tkText.c | |
parent | caca7822e575fd0943b0e41f85ffccfa37f02690 (diff) | |
parent | d9629dd3f036632bf29ca7792d85a0fd346e8cb9 (diff) | |
download | tk-ede13558f13645c01b9dff12f05b15d6e0435995.zip tk-ede13558f13645c01b9dff12f05b15d6e0435995.tar.gz tk-ede13558f13645c01b9dff12f05b15d6e0435995.tar.bz2 |
Fixed [b362182e45] - Generation of virtual events through Tk_HandleEvent is unsafe
Diffstat (limited to 'generic/tkText.c')
-rw-r--r-- | generic/tkText.c | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/generic/tkText.c b/generic/tkText.c index e6cb96d..3e8d625 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -3554,16 +3554,7 @@ TkTextSelectionEvent( * event generate $textWidget <<Selection>> */ - union {XEvent general; XVirtualEvent virtual;} event; - - memset(&event, 0, sizeof(event)); - event.general.xany.type = VirtualEvent; - event.general.xany.serial = NextRequest(Tk_Display(textPtr->tkwin)); - event.general.xany.send_event = False; - event.general.xany.window = Tk_WindowId(textPtr->tkwin); - event.general.xany.display = Tk_Display(textPtr->tkwin); - event.virtual.name = Tk_GetUid("Selection"); - Tk_HandleEvent(&event.general); + TkSendVirtualEvent(textPtr->tkwin, "Selection", NULL); } /* @@ -5364,21 +5355,8 @@ static void GenerateModifiedEvent( TkText *textPtr) /* Information about text widget. */ { - union { - XEvent general; - XVirtualEvent virtual; - } event; - Tk_MakeWindowExist(textPtr->tkwin); - - memset(&event, 0, sizeof(event)); - event.general.xany.type = VirtualEvent; - event.general.xany.serial = NextRequest(Tk_Display(textPtr->tkwin)); - event.general.xany.send_event = False; - event.general.xany.window = Tk_WindowId(textPtr->tkwin); - event.general.xany.display = Tk_Display(textPtr->tkwin); - event.virtual.name = Tk_GetUid("Modified"); - Tk_HandleEvent(&event.general); + TkSendVirtualEvent(textPtr->tkwin, "Modified", NULL); } /* |