Tk Source Code

View Ticket
Login
Ticket UUID: 451cb358d90069fd264953e431eedb896035a480
Title: Aqua: LastKnownRequestProcessed() assigned to unsigned int
Type: Bug Version: 9.0
Submitter: chrstphrchvz Created on: 2026-10-10 04:25:23
Subsystem: 81. Portability Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2026-10-16 09:46:33
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2026-10-16 09:46:33
Description:

LastKnownRequestProcessed() has type unsigned long (i.e. that of request in _XPrivDisplay). So in generateExposeEvents:, serial should be declared unsigned long rather than unsigned int.

--- macosx/tkMacOSXWindowEvent.c
+++ macosx/tkMacOSXWindowEvent.c
@@ -1191,7 +1191,7 @@
         * generated.  This will create idle drawing tasks, which we handle
         * before we return in the case of a live resize.
         */
-       unsigned int serial = LastKnownRequestProcessed(Tk_Display(winPtr));
+       unsigned long serial = LastKnownRequestProcessed(Tk_Display(winPtr));
        oldProc = Tk_RestrictEvents(ExposeRestrictProc, UINT2PTR(serial), &oldArg);
        while (Tcl_ServiceEvent(TCL_WINDOW_EVENTS|TCL_DONT_WAIT)) {};
        Tk_RestrictEvents(oldProc, NULL, &oldArg);
User Comments: jan.nijtmans added on 2026-10-16 09:46:33:

Now also backported to core-8-6-branch


jan.nijtmans added on 2026-10-15 16:22:56:

Same in EatGrabEvents() function, so not only on Aqua

The "nab-expose-restrict" branch is merged too. Well-noted!

Fixed in [e0fcdf0c728b0036|trunk] and core-9-0-branch


chrstphrchvz added on 2026-10-13 00:55:08:

Assigning this to Marc if that is okay.

A more important nearby issue is that the second call to Tk_RestrictEvents() needs to be passed oldArg instead of NULL, so that oldProc() gets called with oldArg instead of NULL which lead to crashing or other misbehavior. I notice that Nicolas already pushed the nab-expose-restrict branch which fixes this.