Tk Source Code

Check-in [4c6cdfa4]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

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

Overview
Comment:Fix [6fcaaa6f80]: ttk::entry insertion cursor not visible. Patch from Csaba Nemethi.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-6-branch
Files: files | file ages | folders
SHA3-256: 4c6cdfa40b9df0a94d00106b9100ab68ad5432cc1d17e45d6dd9901c6b1fe9dc
User & Date: fvogel 2018-09-08 17:08:09
Context
2018-10-21
13:00
Bugfix [6e8afe516d]: rework of tkBind.c. check-in: 67dd75c7 user: gcramer tags: bug6e8afe516d, tip-532
2018-09-30
19:45
Branch to work on broken Tk display on macOS 10.14 Mojave check-in: 30ab59ea user: kevin_walzer tags: mac-mojave
10:00
Fix bitmap-4.1, color-4.1 and cursor-4.1 by cherrypicking the fix [ae13ed65] from trunk. Ticket [ad98f10b3a] dealt with trunk only, the problem appears to be seen in core-8-6-branch as well when running this Tk branch with core-8-branch of Tcl, on Linux Debian 8 at least. check-in: a1a0145c user: fvogel tags: core-8-6-branch
2018-09-29
14:44
Fix [4c84b11111]: Documentation error on page 'event' about <<ThemeChanged>> Closed-Leaf check-in: 919390e3 user: fvogel tags: bug-4c84b111113
2018-09-26
06:26
Fix [9658bc800c]: Right border calculated wrong in Tk menu if borderwidth != activeborderwidth. Patch provided by ingo_brunberg check-in: 2c451736 user: fvogel tags: bug-9658bc800c
2018-09-25
19:13
Fix [f792b457eb]: scrollbar-3.26, 3.27, 3.28, 3.35 tests fail on macOS. The fix consists in using the Linux code for the testmetrics command on macOS, instead of returning the width of the scrollbar (for both cxvscroll and cyvscroll requests). Closed-Leaf check-in: 62785e5e user: fvogel tags: bug-f792b457eb
2018-09-24
19:59
Fix [050d1ea747]: scrollbar-3.50, 6.11, 6.12, 6.25, 6.39 tests fail on macOS Closed-Leaf check-in: 3e32baa0 user: fvogel tags: bug-a84b20eddf, bug-050d1ea747
02:38
Restore some metrics from earlier Cocoa implementation of scorllbar because it seems to render more accurately and smoothly Closed-Leaf check-in: a978b090 user: kevin_walzer tags: mac-scrollbar-metrics-restore
2018-09-23
20:11
Create new branch named "fv-macos-scrollbar-tests" check-in: c514f967 user: fvogel tags: fv-macos-scrollbar-tests
19:57
Fix [874dca4873]: scrollbar-10.[12] fail on macOS check-in: bb66444f user: fvogel tags: bug-874dca4873
2018-09-22
17:59
Patch by Arjen sent to core 2018-09-21 Leaf check-in: 77c390ba user: oehhar tags: tip474-uniform-mouse-wheel
06:51
Fix [8229232472]: Cascade menu entry indicator wrong colour on Unix. Patch provided by cjmcdonald. check-in: 091bec93 user: fvogel tags: bug-8229232472
2018-09-09
16:04
Fix [719ae3991b]: ttk scrollbar-1.[23] tests fail (regression) Closed-Leaf check-in: 16fdad9d user: fvogel tags: bug-719ae3991b
2018-09-08
17:08
Fix [6fcaaa6f80]: ttk::entry insertion cursor not visible. Patch from Csaba Nemethi. check-in: 28b52309 user: fvogel tags: trunk
17:08
Fix [6fcaaa6f80]: ttk::entry insertion cursor not visible. Patch from Csaba Nemethi. check-in: 4c6cdfa4 user: fvogel tags: core-8-6-branch
16:41
Fix [382712ade6] (X11: 'event generate . <KeyPress>' segfaults) again with a different fix. Patch from Christian Werner. check-in: 1ada7439 user: fvogel tags: core-8-6-branch
2018-09-07
20:08
Ooops, one line should have been removed in previous commit. Plus: don't convert tab to spaces on otherwise unchanged lines Closed-Leaf check-in: 1eaf79fe user: fvogel tags: bug-6fcaaa6f80
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/ttk/ttkEntry.c.

1240
1241
1242
1243
1244
1245
1246

1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259







1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
#ifdef HAVE_XFT
    TkUnixSetXftClipRegion(clipRegion);
#endif

    /* Draw cursor:
     */
    if (showCursor) {

	int cursorX = EntryCharPosition(entryPtr, entryPtr->entry.insertPos),
	    cursorY = entryPtr->entry.layoutY,
	    cursorHeight = entryPtr->entry.layoutHeight,
	    cursorWidth = 1;

	Tcl_GetIntFromObj(NULL,es.insertWidthObj,&cursorWidth);
	if (cursorWidth <= 0) {
	    cursorWidth = 1;
	}

	/* @@@ should: maybe: SetCaretPos even when blinked off */
	Tk_SetCaretPos(tkwin, cursorX, cursorY, cursorHeight);








	gc = EntryGetGC(entryPtr, es.insertColorObj, clipRegion);
	XFillRectangle(Tk_Display(tkwin), d, gc,
	    cursorX-cursorWidth/2, cursorY, cursorWidth, cursorHeight);
	XSetClipMask(Tk_Display(tkwin), gc, None);
	Tk_FreeGC(Tk_Display(tkwin), gc);
    }

    /* Draw the text:
     */
    gc = EntryGetGC(entryPtr, es.foregroundObj, clipRegion);
    Tk_DrawTextLayout(






>













>
>
>
>
>
>
>
|

|
<







1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270

1271
1272
1273
1274
1275
1276
1277
#ifdef HAVE_XFT
    TkUnixSetXftClipRegion(clipRegion);
#endif

    /* Draw cursor:
     */
    if (showCursor) {
        Ttk_Box field = Ttk_ClientRegion(entryPtr->core.layout, "field");
	int cursorX = EntryCharPosition(entryPtr, entryPtr->entry.insertPos),
	    cursorY = entryPtr->entry.layoutY,
	    cursorHeight = entryPtr->entry.layoutHeight,
	    cursorWidth = 1;

	Tcl_GetIntFromObj(NULL,es.insertWidthObj,&cursorWidth);
	if (cursorWidth <= 0) {
	    cursorWidth = 1;
	}

	/* @@@ should: maybe: SetCaretPos even when blinked off */
	Tk_SetCaretPos(tkwin, cursorX, cursorY, cursorHeight);

	cursorX -= cursorWidth/2;
	if (cursorX < field.x) {
	    cursorX = field.x;
	} else if (cursorX + cursorWidth > field.x + field.width) {
	    cursorX = field.x + field.width - cursorWidth;
	}

	gc = EntryGetGC(entryPtr, es.insertColorObj, None);
	XFillRectangle(Tk_Display(tkwin), d, gc,
	    cursorX, cursorY, cursorWidth, cursorHeight);

	Tk_FreeGC(Tk_Display(tkwin), gc);
    }

    /* Draw the text:
     */
    gc = EntryGetGC(entryPtr, es.foregroundObj, clipRegion);
    Tk_DrawTextLayout(