Overview
| Artifact ID: | fe96ef944999b90e3e9d926598bf3c0f0da86263acc44c0d3375a9eb03ad4413 |
|---|---|
| Ticket: | 0221b993a19fd8d1b72db4e79286c0861e7eb83c
Tcl command [update idletasks] doesn't skip main loop in Tcl_DoOneEvent |
| User & Date: | erikleunissen on 2021-03-15 19:09:33 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
Nonwithstanding the intention in the comment, the following code snippet from Tcl_DoOneEvent(): /* * If idle events are the only things to service, skip the main part * of the loop and go directly to handle idle events (i.e. don't wait * even if TCL_DONT_WAIT isn't set). */ if ((flags & TCL_ALL_EVENTS) == TCL_IDLE_EVENTS) { flags = flags | TCL_DONT_WAIT; goto idleEvents; } is bypassed for [update idletasks] because of the presence of the TCL_WINDOW_EVENTS bit in the flags argument, which Tcl_DoOneEvent() receives from Tcl_UpdateObjCmd(): switch ((enum updateOptions) optionIndex) { case OPT_IDLETASKS: flags = TCL_WINDOW_EVENTS|TCL_IDLE_EVENTS|TCL_DONT_WAIT; <=== *** break; default: Tcl_Panic("Tcl_UpdateObjCmd: bad option index to UpdateOptions"); } I find the presence of TCL_WINDOW_EVENTS in that flags variable suspect. What window events anyway? Especially when comparing with the Tk counterpart Tk_UpdateObjCmd(). In Tk, windows do play a role, but even here the TCL_WINDOW_EVENTS bit is not passed when "update idletasks" is invoked: if (objc == 1) { flags = TCL_DONT_WAIT; } else if (objc == 2) { if (Tcl_GetIndexFromObj(interp, objv[1], updateOptions, "option", 0, &index) != TCL_OK) { return TCL_ERROR; } flags = TCL_IDLE_EVENTS; <=== *** } else { Tcl_WrongNumArgs(interp, 1, objv, "?idletasks?"); return TCL_ERROR; } - foundin changed to: "8.6.11"
- is_private changed to: "0"
- login: "erikleunissen"
- priority changed to: "5 Medium"
- private_contact changed to: "609f4c7ecf7dbb7a46acdc7eb164753d196088a6"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "erikleunissen"
- subsystem changed to: "02. Event Loops"
- title changed to:
Tcl command [update idletasks] doesn't skip main loop in Tcl_DoOneEvent
- type changed to: "Bug"