Tk Source Code

Changes On Branch bug-fab5fed65e
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Changes In Branch OSX_redraw_artifacts Through [26302191] Excluding Merge-Ins

This is equivalent to a diff from 07ebb554 to 26302191

2017-10-15
12:07
Patch by Marc Culler for [92e614e612] and for another issue (no ticket was open) related to clipping regions in scrolling and drawing on OS X. As far as known there should be no ghosts anymore. check-in: 53177176 user: fvogel tags: OSX_redraw_artifacts, bug-92e614e612
2017-10-13
20:13
Merge bugfix branch bug-fab5fed65e with a better fix for [fab5fed65e] (from Marc Culler). Note: this patch was already applied to core-8-6-branch (part of [be9900e3], plus [4af049ff]) and trunk (part of [af9bd122], plus [32fa275d]), thus the empty diff. check-in: ce3bd56e user: fvogel tags: core-8-6-branch
20:07
Better fix for [fab5fed65e] from Marc Culler: Revert [dd0005dc8a] and add coordinate conversion in TkScrollWindow(). check-in: 26302191 user: fvogel tags: bug-fab5fed65e, OSX_redraw_artifacts
2017-01-15
22:29
Remove obsolete comments. The line they comment was kicked out of the code in [946e946700]. Also, add a small optimization to avoid double invalidation of the damaged region. Indeed the detailed analysis of ticket [fab5fed65e] showed that on OS X the damaged region is invalidated twice: - once through the processing of the Expose event (on OS X the Appkit is not used to draw the widget, Tk is used instead, see comments in tkMacOSXWindowEvent.c around line 770) - a second time because DisplayText() calls TextInvalidateRegion() after TkScrollWindow() check-in: 6f29d680 user: fvogel tags: bug-fab5fed65e, OSX_redraw_artifacts
22:01
Partially fix [fab5fed65e]: OS X - lots of textDisp failures (spurious 'borders' and indices in tk_textRedraw). This commit fixes the 'borders' part of the bug report. check-in: dd0005dc user: fvogel tags: bug-fab5fed65e, OSX_redraw_artifacts
2017-01-14
14:32
Partially fix [fab5fed65e]: OS X - lots of textDisp failures (spurious 'borders' and indices in tk_textRedraw). This commit fixes the spurious indices part of the bug report. check-in: 114ef627 user: fvogel tags: bug-fab5fed65e, OSX_redraw_artifacts
2017-01-10
20:35
Merge core-8-6-branch so that new test imgPhoto-4.74 lands in the present bugfix branch as well Closed-Leaf check-in: fd4fd7da user: fvogel tags: bug-d4fb4e80d2
16:02
More internal use of size_t. Add test-case imgPhoto-4.74, which shows error-handling when there are two values on the command line not connected to options. check-in: 4ffa8b06 user: jan.nijtmans tags: core-8-6-branch
2017-01-09
21:56
Fix [7a838c38a1]: X11 bind event ring buffer and NoExpose event. Patch from Christian Werner. check-in: e7b81812 user: fvogel tags: trunk
21:56
Fix [7a838c38a1]: X11 bind event ring buffer and NoExpose event. Patch from Christian Werner. check-in: 07ebb554 user: fvogel tags: core-8-6-branch
13:42
Better comment explaining why some events are ignored. Closed-Leaf check-in: cef0b3e4 user: fvogel tags: bug-7a838c38a1
2017-01-07
15:18
Fix [c12af74765]: OS X - text-21.1 fails check-in: 46ce2328 user: fvogel tags: core-8-6-branch

Changes to generic/tkTextDisp.c.

4295
4296
4297
4298
4299
4300
4301

4302
4303
4304
4305
4306
4307
4308
4309
4310
	 * calling TextInvalidateRegion to mark the display blocks as stale.
	 */

	damageRgn = TkCreateRegion();
	if (TkScrollWindow(textPtr->tkwin, dInfoPtr->scrollGC, dInfoPtr->x,
		oldY, dInfoPtr->maxX-dInfoPtr->x, height, 0, y-oldY,
		damageRgn)) {

	    TextInvalidateRegion(textPtr, damageRgn);

	}
	numCopies++;
	TkDestroyRegion(damageRgn);
    }

    /*
     * Clear the REDRAW_PENDING flag here. This is actually pretty tricky. We







>

|







4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
	 * calling TextInvalidateRegion to mark the display blocks as stale.
	 */

	damageRgn = TkCreateRegion();
	if (TkScrollWindow(textPtr->tkwin, dInfoPtr->scrollGC, dInfoPtr->x,
		oldY, dInfoPtr->maxX-dInfoPtr->x, height, 0, y-oldY,
		damageRgn)) {
#ifndef MAC_OSX_TK
	    TextInvalidateRegion(textPtr, damageRgn);
#endif
	}
	numCopies++;
	TkDestroyRegion(damageRgn);
    }

    /*
     * Clear the REDRAW_PENDING flag here. This is actually pretty tricky. We

Changes to macosx/tkMacOSXDraw.c.

1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543

1544
1545
1546
1547
1548
1549
1550
	     * This region is described in NSView coordinates (y=0 at the bottom)
	     * and converted to Tk coordinates later.
  	     */

	    srcRect = CGRectMake(x, y, width, height);
	    dstRect = CGRectOffset(srcRect, dx, dy);

	    /* Expand the rectangles slightly to avoid degeneracies. */
	    srcRect.origin.y -= 1;
	    srcRect.size.height += 2;
	    dstRect.origin.y += 1;
	    dstRect.size.height -= 2;

	    /* Compute the damage. */
  	    dmgRgn = HIShapeCreateMutableWithRect(&srcRect);
 	    extraRgn = HIShapeCreateWithRect(&dstRect);
 	    ChkErr(HIShapeDifference, dmgRgn, extraRgn, (HIMutableShapeRef) dmgRgn);
	    result = HIShapeIsEmpty(dmgRgn) ? 0 : 1;

	    /* Convert to Tk coordinates. */
	    TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn);

	    if (extraRgn) {
		CFRelease(extraRgn);
	    }

 	    /* Scroll the rectangle. */
 	    [view scrollRect:scrollSrc by:NSMakeSize(dx, -dy)];








<
<
<
<
<
<








>







1523
1524
1525
1526
1527
1528
1529






1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
	     * This region is described in NSView coordinates (y=0 at the bottom)
	     * and converted to Tk coordinates later.
  	     */

	    srcRect = CGRectMake(x, y, width, height);
	    dstRect = CGRectOffset(srcRect, dx, dy);







	    /* Compute the damage. */
  	    dmgRgn = HIShapeCreateMutableWithRect(&srcRect);
 	    extraRgn = HIShapeCreateWithRect(&dstRect);
 	    ChkErr(HIShapeDifference, dmgRgn, extraRgn, (HIMutableShapeRef) dmgRgn);
	    result = HIShapeIsEmpty(dmgRgn) ? 0 : 1;

	    /* Convert to Tk coordinates. */
	    TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn);
            TkMacOSXOffsetRegion(damageRgn, -macDraw->xOff, -macDraw->yOff);
	    if (extraRgn) {
		CFRelease(extraRgn);
	    }

 	    /* Scroll the rectangle. */
 	    [view scrollRect:scrollSrc by:NSMakeSize(dx, -dy)];

1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
		}
	    }

	    /* Queue up Expose events for the damage region. */
	    int oldMode = Tcl_SetServiceMode(TCL_SERVICE_NONE);
	    [view generateExposeEvents:dmgRgn childrenOnly:1];
	    Tcl_SetServiceMode(oldMode);

	    /* Belt and suspenders: make the AppKit request a redraw
	       when it gets control again. */
  	}
    } else {
	dmgRgn = HIShapeCreateEmpty();
	TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn);
    }

    if (dmgRgn) {







<
<
<







1562
1563
1564
1565
1566
1567
1568



1569
1570
1571
1572
1573
1574
1575
		}
	    }

	    /* Queue up Expose events for the damage region. */
	    int oldMode = Tcl_SetServiceMode(TCL_SERVICE_NONE);
	    [view generateExposeEvents:dmgRgn childrenOnly:1];
	    Tcl_SetServiceMode(oldMode);



  	}
    } else {
	dmgRgn = HIShapeCreateEmpty();
	TkMacOSXSetWithNativeRegion(damageRgn, dmgRgn);
    }

    if (dmgRgn) {