Skip to content
Tcl Source Code History Of Ticket 883155fb98a9d7a4
Login

History Of Ticket 883155fb98a9d7a4

Artifacts Associated With Ticket 883155fb98a9d7a4

  1. Ticket change [658a9961ac] (rid 136492) by anonymous on 2014-01-21 10:04:29:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      In the nextEventMatchingMask method in macosx/tkMacOSXNotify.c, the tkDisplayIfNeeded method is applied to all windows each time there is an event by calling [NSApp makeWindowsPerform:@selector(tkDisplayIfNeeded) inOrder:NO].
      
      The tkDisplayIfNeeded method is the following:
      
      @implementation NSWindow(TKNotify)
      - (id) tkDisplayIfNeeded
      {
          if (![self isAutodisplay]) {
             [self displayIfNeeded];
          }
          return nil;
      }
      @end
      
      In the code creating the window (TkMacOSXMakeRealWindowExist in tkMacOSXWm.c), we call [window setAutodisplay:NO], so [self isAutodisplay] is false, and tkDisplayIfNeeded calls [self displayIfNeeded]. Thus, in each window auto-displaying is switched off, but then on each pass through the event loop we ask the window to display itself if needed anyway.
      
      This suggests that this piece of code may not be needed, and moreover the Cocoa documentation seems to discourage the use of [NSWindow displayIfNeeded]. According to the discussion on the MacTcl mailing list starting on January 18, 2014, the [window setAutodisplay:NO] line is needed to address some issues with drawing Tk windows under Cocoa, though the details are no longer readily available.
      
      The attached patch removed the [window setAutodisplay:NO] line from tkMacOSXWm.c (by default, windows do auto-display), and removes the tkDisplayIfNeeded code. This seems to work perfectly fine; after applying this patch, the Tk test suite actually reports one test failure less. However, if it turns out that removing [window setAutodisplay:NO] causes some issues with Cocoa to reappear, then it provides us a chance to investigate the bug in detail and find an appropriate solution for it (preferably without having to tinker with the innards of the event loop).
      
      While this patch helps to keep the Tcl/Tk code clean, it is particularly relevant for people who are running Tcl/Tk using an external event loop (using the notifier approach, as explained at http://www.tcl.tk/man/tcl8.5/TclLib/Notifier.htm; see the mailing list for details).
      
    5. foundin initialized to: "trunk"
    6. is_private initialized to: "0"
    7. login: "anonymous"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "500c9a7a4e11b3ea0441850610e04006941c0cf3"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "anonymous"
    14. subsystem initialized to: "02. Event Loops"
    15. title initialized to: "tkDisplayIfNeeded is unnecessary"
    16. type initialized to: "Patch"
  2. Add attachment "tkMacOSXWm.c.patch" [2b7659fc83] (rid 136493) by anonymous on 2014-01-21 10:05:25.

  3. Add attachment "tkMacOSXNotify.c.patch" [f9748325cb] (rid 136494) by anonymous on 2014-01-21 10:05:55.

  4. Ticket change [907e726f3a] (rid 140482) by dgp on 2014-10-30 13:27:32:

    1. assignee changed to: "dgp"
    2. login: "dgp"
    3. mimetype: "text/plain"
  5. Ticket change [0a716e3abd] (rid 140485) by anonymous on 2014-10-31 00:50:18:

    1. icomment:
      I submitted this patch back in January, but since then I have been looking at the Tcl/Tk event loop code in much more detail, and it's clear to me that much more extensive changes are needed to solve the event loop issues. I would suggest to close this ticket for now, and wait for a comprehensive solution of the event loop (which may take a few more months).
      
    2. login: "anonymous"
    3. mimetype: "text/plain"
  6. Ticket change [3b1550d5cd] (rid 141717) by dgp on 2015-05-11 17:10:14:

    1. assignee changed to: "kevin_walzer"
    2. icomment:
      
      This might be out of date now, but the code is still
      in tkMacOSXNotify.c.
      
    3. login: "dgp"
    4. mimetype: "text/plain"
  7. Ticket change [4c51ff87af] (rid 141764) by dkf on 2015-05-15 13:27:16:

    1. icomment: "Belongs in Tk."
    2. login: "dkf"
    3. mimetype: "text/html"
    4. resolution changed to: "Invalid"
    5. status changed to: "Pending"
  8. Ticket change [48fca559b8] (rid 258118) by serhiy.storchaka on 2026-10-15 11:29:04:

    1. icomment: "Closing: this belongs to the Tk tracker."
    2. login: "serhiy.storchaka"
    3. mimetype: "text/x-fossil-wiki"
    4. status changed to: "Closed"
  9. Ticket change [2f67d7bceb] (rid 259922) by serhiy.storchaka on 2026-10-22 17:19:26:

    1. closedate changed to: "2461328.978527743"
    2. closer changed to: "serhiy.storchaka"
    3. login: "serhiy.storchaka"