summaryrefslogtreecommitdiffstats
path: root/generic/tkText.c
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2016-04-21 22:03:01 (GMT)
committerfvogel <fvogelnew1@free.fr>2016-04-21 22:03:01 (GMT)
commit00604f72c60af9ed0748c955048a446f7e5f7b9c (patch)
tree5deeaa223aed9f5fa42e43c83865f4287756eab3 /generic/tkText.c
parentfa289415c7aaacc173ab97665af201a54eae611a (diff)
downloadtk-00604f72c60af9ed0748c955048a446f7e5f7b9c.zip
tk-00604f72c60af9ed0748c955048a446f7e5f7b9c.tar.gz
tk-00604f72c60af9ed0748c955048a446f7e5f7b9c.tar.bz2
Fixed [b362182e45] - Generation of virtual events through Tk_HandleEvent is unsafe
Diffstat (limited to 'generic/tkText.c')
-rw-r--r--generic/tkText.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/generic/tkText.c b/generic/tkText.c
index 506075d..b17a425 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);
}
/*
@@ -5361,21 +5352,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);
}
/*