Tk Source Code

Artifact [61082efd]
Login

Artifact 61082efdcf028914b0dcb3bbbc19f3549143732a:

Ticket change [61082efd] - New ticket [bc4552d0] Tcl_SetServiceMode in nextEventMatchingMask can be removed. by anonymous 2014-01-23 14:08:43.
D 2014-01-23T14:08:43.618
J assignee nobody
J closer nobody
J cmimetype text/plain
J comment In\sthe\snextEventMatchingMask\smethod\sin\smacosx/tkMacOSXNotify.c,\sin\sthis\ssection:\r\n\r\n@implementation\sTKApplication(TKNotify)\r\n-\s(NSEvent\s*)\snextEventMatchingMask:\s(NSUInteger)\smask\r\n\s\s\s\s\s\s\s\suntilDate:\s(NSDate\s*)\sexpiration\sinMode:\s(NSString\s*)\smode\r\n\s\s\s\s\s\s\s\sdequeue:\s(BOOL)\sdeqFlag\r\n{\r\n...\r\n\s\s\s\sint\soldMode\s=\sTcl_SetServiceMode(TCL_SERVICE_ALL);\r\n\s\s\s\sNSEvent\s*event\s=\s[[super\snextEventMatchingMask:mask\suntilDate:expiration\r\n\s\s\s\s\s\s\s\s\s\s\s\sinMode:mode\sdequeue:deqFlag]\sretain];\r\n\s\s\s\sTcl_SetServiceMode(oldMode);\r\n...\r\n}\r\n\r\nwe\sfirst\sset\sthe\sservice\smode\susing\sTcl_SetServiceMode,\sthen\swe\scall\sthe\snextEventMatchingMask\smethod\sof\sthe\ssuperclass,\sand\sthen\swe\srestore\sthe\soriginal\sservice\smode.\r\n\r\nThe\sTcl_SetServiceMode\sfunction\s(in\sgeneric/tclNotify.c)\sis\sthe\sfollowing:\r\n\r\nint\sTcl_SetServiceMode(int\smode)\r\n{\r\n\s\s\s\sint\soldMode;\r\n\s\s\s\sThreadSpecificData\s*tsdPtr\s=\sTCL_TSD_INIT(&dataKey);\r\n\s\s\s\soldMode\s=\stsdPtr->serviceMode;\r\n\s\s\s\stsdPtr->serviceMode\s=\smode;\r\n\s\s\s\sTcl_ServiceModeHook(mode);\r\n\s\s\s\sreturn\soldMode;\r\n}\r\n\r\nNow\sthe\ssuperclass\snextEventMatchingMask\smethod\ssimply\sgets\sthe\snext\savailable\sevent,\sbut\sdoes\snot\sinvoke\sany\sTcl/Tk\scode.\sSo\ssetting\stsdPtr->serviceMode\shas\sno\sconsequences.\r\n\r\nThe\sTcl_ServiceModeHook\sfunction\s(in\smacosx/tclMacOSXNotify.c)\screates\sthe\srunloop\stimer\sif\sit\sdoesn’t\salready\sexist.\sBut\ssince\swe\salso\scall\sTcl_SetServiceMode\sfrom\sTk_MacOSXSetupTkNotifier\sduring\sTk\sinitialization,\sthe\srunloop\stimer\salready\sexist\sby\sthe\stime\swe\scall\snextEventMatchingMask.\r\n\r\nSo\sI\sthink\sthe\stwo\scalls\sto\sTcl_SetServiceMode\sin\sthe\snextEventMatchingMask\smethod\scan\sbe\sremoved.\sThe\spatch\sdoes\sjust\sthat.\sThis\spatch\swas\smade\srelative\sto\sthis\spatch\swhich\sI\ssubmitted\spreviously:\r\n\r\nhttps://core.tcl.tk/tcl/tktview?name=883155fb98\r\n\r\nHowever,\sthese\stwo\spatches\scan\sbe\sapplied\sindependently\sof\seach\sother.
J foundin trunk
J is_private 0
J login anonymous
J priority 5\sMedium
J private_contact 500c9a7a4e11b3ea0441850610e04006941c0cf3
J resolution None
J severity Minor
J status Open
J submitter anonymous
J subsystem 70.\sEvent\sLoop
J title Tcl_SetServiceMode\sin\snextEventMatchingMask\scan\sbe\sremoved
J type Patch
K bc4552d0bb8d4489b1d9675bbf7e0873d32bdb0c
U anonymous
Z 59e234fa07288711d979978831bf8b8b