Tcl Source Code

Artifact [658a9961ac]
Login

Artifact 658a9961acd9bcf047dafec226d8a2d52364c031:

Ticket change [658a9961ac] - New ticket [883155fb98] tkDisplayIfNeeded is unnecessary. by anonymous 2014-01-21 10:04:29.
D 2014-01-21T10:04:29.576
J assignee nobody
J closer nobody
J cmimetype text/plain
J comment In\sthe\snextEventMatchingMask\smethod\sin\smacosx/tkMacOSXNotify.c,\sthe\stkDisplayIfNeeded\smethod\sis\sapplied\sto\sall\swindows\seach\stime\sthere\sis\san\sevent\sby\scalling\s[NSApp\smakeWindowsPerform:@selector(tkDisplayIfNeeded)\sinOrder:NO].\r\n\r\nThe\stkDisplayIfNeeded\smethod\sis\sthe\sfollowing:\r\n\r\n@implementation\sNSWindow(TKNotify)\r\n-\s(id)\stkDisplayIfNeeded\r\n{\r\n\s\s\s\sif\s(![self\sisAutodisplay])\s{\r\n\s\s\s\s\s\s\s[self\sdisplayIfNeeded];\r\n\s\s\s\s}\r\n\s\s\s\sreturn\snil;\r\n}\r\n@end\r\n\r\nIn\sthe\scode\screating\sthe\swindow\s(TkMacOSXMakeRealWindowExist\sin\stkMacOSXWm.c),\swe\scall\s[window\ssetAutodisplay:NO],\sso\s[self\sisAutodisplay]\sis\sfalse,\sand\stkDisplayIfNeeded\scalls\s[self\sdisplayIfNeeded].\sThus,\sin\seach\swindow\sauto-displaying\sis\sswitched\soff,\sbut\sthen\son\seach\spass\sthrough\sthe\sevent\sloop\swe\sask\sthe\swindow\sto\sdisplay\sitself\sif\sneeded\sanyway.\r\n\r\nThis\ssuggests\sthat\sthis\spiece\sof\scode\smay\snot\sbe\sneeded,\sand\smoreover\sthe\sCocoa\sdocumentation\sseems\sto\sdiscourage\sthe\suse\sof\s[NSWindow\sdisplayIfNeeded].\sAccording\sto\sthe\sdiscussion\son\sthe\sMacTcl\smailing\slist\sstarting\son\sJanuary\s18,\s2014,\sthe\s[window\ssetAutodisplay:NO]\sline\sis\sneeded\sto\saddress\ssome\sissues\swith\sdrawing\sTk\swindows\sunder\sCocoa,\sthough\sthe\sdetails\sare\sno\slonger\sreadily\savailable.\r\n\r\nThe\sattached\spatch\sremoved\sthe\s[window\ssetAutodisplay:NO]\sline\sfrom\stkMacOSXWm.c\s(by\sdefault,\swindows\sdo\sauto-display),\sand\sremoves\sthe\stkDisplayIfNeeded\scode.\sThis\sseems\sto\swork\sperfectly\sfine;\safter\sapplying\sthis\spatch,\sthe\sTk\stest\ssuite\sactually\sreports\sone\stest\sfailure\sless.\sHowever,\sif\sit\sturns\sout\sthat\sremoving\s[window\ssetAutodisplay:NO]\scauses\ssome\sissues\swith\sCocoa\sto\sreappear,\sthen\sit\sprovides\sus\sa\schance\sto\sinvestigate\sthe\sbug\sin\sdetail\sand\sfind\san\sappropriate\ssolution\sfor\sit\s(preferably\swithout\shaving\sto\stinker\swith\sthe\sinnards\sof\sthe\sevent\sloop).\r\n\r\nWhile\sthis\spatch\shelps\sto\skeep\sthe\sTcl/Tk\scode\sclean,\sit\sis\sparticularly\srelevant\sfor\speople\swho\sare\srunning\sTcl/Tk\susing\san\sexternal\sevent\sloop\s(using\sthe\snotifier\sapproach,\sas\sexplained\sat\shttp://www.tcl.tk/man/tcl8.5/TclLib/Notifier.htm;\ssee\sthe\smailing\slist\sfor\sdetails).
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 02.\sEvent\sLoops
J title tkDisplayIfNeeded\sis\sunnecessary
J type Patch
K 883155fb98a9d7a426f24cac27c71a9b353a3f7f
U anonymous
Z eccdbd7b2cd2bc9787c44f199e9a7cdc