Skip to content

Commit 922b1aa

Browse files
author
dgp
committed
merge trunk
2 parents b774fab + 6a15d87 commit 922b1aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+1261
-1741
lines changed

.github/workflows/linux-build.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ env:
1616
ERROR_ON_FAILURES: 1
1717
jobs:
1818
build:
19-
runs-on: ubuntu-22.04
19+
runs-on: ubuntu-24.04
2020
strategy:
2121
matrix:
2222
compiler:
@@ -26,8 +26,6 @@ jobs:
2626
- ""
2727
- "CFLAGS=-DTK_NO_DEPRECATED=1"
2828
- "--disable-shared"
29-
- "--disable-xft"
30-
- "--disable-xss"
3129
- "--enable-symbols"
3230
steps:
3331
- name: Checkout Tk
@@ -42,7 +40,8 @@ jobs:
4240
path: tcl
4341
- name: Setup Environment (compiler=${{ matrix.compiler }})
4442
run: |
45-
sudo apt-get install libxss-dev libxft-dev
43+
sudo apt-get update
44+
sudo apt-get install libxss-dev libxft-dev libcups2-dev libatk1.0-dev libatk-bridge2.0-dev
4645
mkdir "$HOME/install dir"
4746
touch tk/doc/man.macros tk/generic/tkStubInit.c
4847
echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV
@@ -124,14 +123,13 @@ jobs:
124123
name: Tk ${{ env.VERSION }} HTML documentation (snapshot)
125124
path: /tmp/dist/tk*/html
126125
test:
127-
runs-on: ubuntu-22.04
126+
runs-on: ubuntu-24.04
128127
strategy:
129128
matrix:
130129
compiler:
131130
- "gcc"
132131
config:
133132
- ""
134-
- "--disable-xft"
135133
- "--enable-symbols"
136134
steps:
137135
- name: Checkout Tk
@@ -146,7 +144,8 @@ jobs:
146144
path: tcl
147145
- name: Setup Environment (compiler=${{ matrix.compiler }})
148146
run: |
149-
sudo apt-get install libxss-dev libxft-dev xvfb libicu-dev xfonts-75dpi xfonts-100dpi xfonts-scalable libxfont2 unifont
147+
sudo apt-get update
148+
sudo apt-get install libxss-dev libxft-dev libcups2-dev xvfb libicu-dev xfonts-75dpi xfonts-100dpi xfonts-scalable libxfont2 unifont
150149
mkdir "$HOME/install dir"
151150
touch tk/doc/man.macros tk/generic/tkStubInit.c
152151
echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV

.github/workflows/linux-with-tcl9-build.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ env:
1616
ERROR_ON_FAILURES: 1
1717
jobs:
1818
build:
19-
runs-on: ubuntu-22.04
19+
runs-on: ubuntu-24.04
2020
strategy:
2121
matrix:
2222
compiler:
@@ -26,8 +26,6 @@ jobs:
2626
- ""
2727
- "CFLAGS=-DTK_NO_DEPRECATED=1"
2828
- "--disable-shared"
29-
- "--disable-xft"
30-
- "--disable-xss"
3129
- "--enable-symbols"
3230
steps:
3331
- name: Checkout
@@ -42,7 +40,7 @@ jobs:
4240
path: tcl
4341
- name: Setup Environment (compiler=${{ matrix.compiler }})
4442
run: |
45-
sudo apt-get install libxss-dev libxft-dev
43+
sudo apt-get install libx11-dev
4644
mkdir "$HOME/install dir"
4745
touch tk/doc/man.macros tk/generic/tkStubInit.c
4846
echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV
@@ -105,14 +103,13 @@ jobs:
105103
exit 1
106104
}
107105
test:
108-
runs-on: ubuntu-22.04
106+
runs-on: ubuntu-24.04
109107
strategy:
110108
matrix:
111109
compiler:
112110
- "gcc"
113111
config:
114112
- ""
115-
- "--disable-xft"
116113
- "--enable-symbols"
117114
steps:
118115
- name: Checkout
@@ -127,7 +124,8 @@ jobs:
127124
path: tcl
128125
- name: Setup Environment (compiler=${{ matrix.compiler }})
129126
run: |
130-
sudo apt-get install libxss-dev libxft-dev xvfb libicu-dev xfonts-75dpi xfonts-100dpi xfonts-scalable libxfont2 unifont
127+
sudo apt-get update
128+
sudo apt-get install xvfb libx11-dev libicu-dev xfonts-75dpi xfonts-100dpi xfonts-scalable libxfont2 unifont
131129
mkdir "$HOME/install dir"
132130
touch tk/doc/man.macros tk/generic/tkStubInit.c
133131
echo "CFGOPT=$CFGOPT" >> $GITHUB_ENV

.github/workflows/onefiledist.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ permissions:
1111
jobs:
1212
linux:
1313
name: Linux
14-
runs-on: ubuntu-22.04
14+
runs-on: ubuntu-24.04
1515
defaults:
1616
run:
1717
shell: bash
@@ -31,7 +31,8 @@ jobs:
3131
path: tcl
3232
- name: Prepare
3333
run: |
34-
sudo apt-get install libxss-dev libxft-dev
34+
sudo apt-get update
35+
sudo apt-get install libxss-dev libxft-dev libcups2-dev libatk1.0-dev libatk-bridge2.0-dev
3536
touch tcl/generic/tclStubInit.c tcl/generic/tclOOStubInit.c
3637
touch tk/generic/tkStubInit.c
3738
echo "INST_DIR=$(cd install;pwd)" >> $GITHUB_ENV

doc/event.n

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,9 @@ Corresponds to the \fB%t\fR substitution for binding scripts.
304304
\fIboolean\fR must be a boolean value; it specifies whether
305305
the screen pointer should be warped as well.
306306
Valid for \fBKey\fR, \fBKeyRelease\fR, \fBButton\fR,
307-
\fBButtonRelease\fR, and \fBMotion\fR events. The pointer will
308-
only warp to a window if it is mapped.
307+
\fBButtonRelease\fR, and \fBMotion\fR events. Tk supports pointer warping
308+
relative to the screen's root window, and relative to a Tk window. In the
309+
latter case, the pointer will only warp if the window is mapped.
309310
.\" OPTION: -width
310311
.TP
311312
\fB\-width\fI size\fR

generic/tk.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ extern "C" {
9393
#if defined(__GNUC__) && !defined(__cplusplus)
9494
# pragma GCC diagnostic ignored "-Wc++-compat"
9595
#endif
96+
# define NeedWidePrototypes 1
9697
# include <X11/Xlib.h>
9798
# ifdef MAC_OSX_TK
9899
# include <X11/X.h>

generic/tkBind.c

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ DEBUG(static int countSeqItems = 0;)
690690
*/
691691

692692
static void ChangeScreen(Tcl_Interp *interp, char *dispName, int screenIndex);
693-
static int CreateVirtualEvent(Tcl_Interp *interp, VirtualEventTable *vetPtr,
693+
static bool CreateVirtualEvent(Tcl_Interp *interp, VirtualEventTable *vetPtr,
694694
char *virtString, const char *eventString);
695695
static int DeleteVirtualEvent(Tcl_Interp *interp, VirtualEventTable *vetPtr,
696696
char *virtString, const char *eventString);
@@ -712,7 +712,7 @@ static void InitVirtualEventTable(VirtualEventTable *vetPtr);
712712
static PatSeq * MatchPatterns(TkDisplay *dispPtr, Tk_BindingTable bindPtr, PSList *psList,
713713
PSList *psSuccList, unsigned patIndex, const Event *eventPtr,
714714
void *object, PatSeq **physPtrPtr);
715-
static int NameToWindow(Tcl_Interp *interp, Tk_Window main,
715+
static bool NameToWindow(Tcl_Interp *interp, Tk_Window main,
716716
Tcl_Obj *objPtr, Tk_Window *tkwinPtr);
717717
static unsigned ParseEventDescription(Tcl_Interp *interp, const char **eventStringPtr,
718718
TkPattern *patPtr, unsigned *eventMaskPtr);
@@ -2090,19 +2090,19 @@ ResetCounters(
20902090
}
20912091

20922092
/* helper function */
2093-
static int
2093+
static bool
20942094
IsBetterMatch(
20952095
const PatSeq *fstMatchPtr,
20962096
const PatSeq *sndMatchPtr) /* this is a better match? */
20972097
{
20982098
int diff;
20992099

2100-
if (!sndMatchPtr) { return 0; }
2101-
if (!fstMatchPtr) { return 1; }
2100+
if (!sndMatchPtr) { return false; }
2101+
if (!fstMatchPtr) { return true; }
21022102

21032103
diff = CountSpecialized(fstMatchPtr, sndMatchPtr);
2104-
if (diff > 0) { return 1; }
2105-
if (diff < 0) { return 0; }
2104+
if (diff > 0) { return true; }
2105+
if (diff < 0) { return false; }
21062106

21072107
{ /* local scope */
21082108
#define M 1000000ULL
@@ -2128,8 +2128,8 @@ IsBetterMatch(
21282128
assert(GetCount(sndMatchPtr, i) < SIZE_OF_ARRAY(weight));
21292129
sndCount += weight[GetCount(sndMatchPtr, i)];
21302130
}
2131-
if (sndCount > fstCount) { return 1; }
2132-
if (sndCount < fstCount) { return 0; }
2131+
if (sndCount > fstCount) { return true; }
2132+
if (sndCount < fstCount) { return false; }
21332133
}
21342134

21352135
return sndMatchPtr->number > fstMatchPtr->number;
@@ -2632,7 +2632,7 @@ Tk_BindEvent(
26322632
*/
26332633

26342634
/* helper function */
2635-
static int
2635+
static bool
26362636
VirtPatIsBound(
26372637
Tk_BindingTable bindPtr, /* Table in which to look for bindings. */
26382638
PatSeq *psPtr, /* Test this pattern. */
@@ -2655,7 +2655,7 @@ VirtPatIsBound(
26552655

26562656
if (physPatPtr->info || !virtPatPtr->info) {
26572657
if (IsSubsetOf(virtPatPtr->modMask, physPatPtr->modMask)) {
2658-
return 0; /* We cannot surpass this match. */
2658+
return false; /* We cannot surpass this match. */
26592659
}
26602660
}
26612661
}
@@ -2675,11 +2675,11 @@ VirtPatIsBound(
26752675
if ((hPtr = Tcl_FindHashEntry(&bindPtr->lookupTables.patternTable, (char *) &key))) {
26762676
/* The physical event matches this virtual event's definition. */
26772677
*physPtrPtr = (PatSeq *) Tcl_GetHashValue(hPtr);
2678-
return 1;
2678+
return true;
26792679
}
26802680
}
26812681

2682-
return 0;
2682+
return false;
26832683
}
26842684

26852685
/* helper function */
@@ -2743,7 +2743,7 @@ CompareModMasks(
27432743
}
27442744

27452745
/* helper function */
2746-
static int
2746+
static bool
27472747
IsPSInPSList(
27482748
const PatSeq *psPtr, /* Is this pattern sequence... */
27492749
const PSList *psList) /* ...an element of this list of patterns sequence? */
@@ -2752,10 +2752,10 @@ IsPSInPSList(
27522752

27532753
TK_DLIST_FOREACH(psEntry, psList) {
27542754
if (psEntry->psPtr == psPtr) {
2755-
return 1;
2755+
return true;
27562756
}
27572757
}
2758-
return 0;
2758+
return false;
27592759
}
27602760

27612761
static PatSeq *
@@ -3535,7 +3535,7 @@ DeleteVirtualEventTable(
35353535
*----------------------------------------------------------------------
35363536
*/
35373537

3538-
static int
3538+
static bool
35393539
CreateVirtualEvent(
35403540
Tcl_Interp *interp, /* Used for error reporting. */
35413541
VirtualEventTable *vetPtr, /* Table in which to augment virtual event. */
@@ -3553,15 +3553,15 @@ CreateVirtualEvent(
35533553
assert(eventString);
35543554

35553555
if (!(virtUid = GetVirtualEventUid(interp, virtString))) {
3556-
return 0;
3556+
return false;
35573557
}
35583558

35593559
/*
35603560
* Find/create physical event.
35613561
*/
35623562

35633563
if (!(psPtr = FindSequence(interp, &vetPtr->lookupTables, NULL, eventString, 1, 0, NULL))) {
3564-
return 0;
3564+
return false;
35653565
}
35663566
assert(TEST_PSENTRY(psPtr));
35673567

@@ -3586,7 +3586,7 @@ CreateVirtualEvent(
35863586
VirtOwners_Append(&psPtr->ptr.owners, vhPtr);
35873587
}
35883588

3589-
return 1;
3589+
return true;
35903590
}
35913591

35923592
/*
@@ -4414,10 +4414,11 @@ HandleEventGenerate(
44144414
}
44154415

44164416
/*
4417-
* We only allow warping if the window is mapped.
4417+
* We allow warping relative to the screen's root window, or relative to a
4418+
* Tk window provided that it is mapped.
44184419
*/
44194420

4420-
if (warp && Tk_IsMapped(tkwin)) {
4421+
if (warp && (! windowName[0] || Tk_IsMapped(tkwin))) {
44214422
TkDisplay *dispPtr = TkGetDisplay(event.general.xmotion.display);
44224423

44234424
Tk_Window warpWindow = Tk_IdToWindow(dispPtr->display, event.general.xmotion.window);
@@ -4482,7 +4483,7 @@ HandleEventGenerate(
44824483
*---------------------------------------------------------------------------
44834484
*/
44844485

4485-
static int
4486+
static bool
44864487
NameToWindow(
44874488
Tcl_Interp *interp, /* Interp for error return and name lookup. */
44884489
Tk_Window mainWin, /* Main window of application. */
@@ -4500,7 +4501,7 @@ NameToWindow(
45004501

45014502
if (name[0] == '.') {
45024503
if (!(tkwin = Tk_NameToWindow(interp, name, mainWin))) {
4503-
return 0;
4504+
return false;
45044505
}
45054506
} else {
45064507
Window id;
@@ -4519,13 +4520,13 @@ NameToWindow(
45194520
if (!tkwin) {
45204521
Tcl_SetObjResult(interp, Tcl_ObjPrintf("bad window name/identifier \"%s\"", name));
45214522
Tcl_SetErrorCode(interp, "TK", "LOOKUP", "WINDOW_ID", name, (char *)NULL);
4522-
return 0;
4523+
return false;
45234524
}
45244525
}
45254526

45264527
assert(tkwin);
45274528
*tkwinPtr = tkwin;
4528-
return 1;
4529+
return true;
45294530
}
45304531

45314532
/*

generic/tkCanvLine.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,8 +1589,8 @@ LineToPoint(
15891589
TkGetButtPoints(coordPtr, coordPtr+2, width,
15901590
linePtr->capStyle == CapProjecting, poly+4, poly+6);
15911591
} else if (linePtr->joinStyle == JoinMiter) {
1592-
if (TkGetMiterPoints(coordPtr, coordPtr+2, coordPtr+4,
1593-
width, poly+4, poly+6) == 0) {
1592+
if (!TkGetMiterPoints(coordPtr, coordPtr+2, coordPtr+4,
1593+
width, poly+4, poly+6)) {
15941594
changedMiterToBevel = 1;
15951595
TkGetButtPoints(coordPtr, coordPtr+2, width, 0,
15961596
poly+4, poly+6);

generic/tkCanvPoly.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,8 +1424,8 @@ PolygonToPoint(
14241424
TkGetButtPoints(coordPtr, coordPtr+2, (double) width, 0, poly+4,
14251425
poly+6);
14261426
} else if (polyPtr->joinStyle == JoinMiter) {
1427-
if (TkGetMiterPoints(coordPtr, coordPtr+2, coordPtr+4,
1428-
(double) width, poly+4, poly+6) == 0) {
1427+
if (!TkGetMiterPoints(coordPtr, coordPtr+2, coordPtr+4,
1428+
(double) width, poly+4, poly+6)) {
14291429
changedMiterToBevel = 1;
14301430
TkGetButtPoints(coordPtr, coordPtr+2, (double) width, 0,
14311431
poly+4, poly+6);
@@ -1622,8 +1622,8 @@ PolygonToArea(
16221622
if (count == 2) {
16231623
TkGetButtPoints(coordPtr, coordPtr+2, width, 0, poly+4, poly+6);
16241624
} else if (polyPtr->joinStyle == JoinMiter) {
1625-
if (TkGetMiterPoints(coordPtr, coordPtr+2, coordPtr+4, width,
1626-
poly+4, poly+6) == 0) {
1625+
if (!TkGetMiterPoints(coordPtr, coordPtr+2, coordPtr+4, width,
1626+
poly+4, poly+6)) {
16271627
changedMiterToBevel = 1;
16281628
TkGetButtPoints(coordPtr, coordPtr+2, width,0, poly+4, poly+6);
16291629
}

generic/tkCmds.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,6 +1407,8 @@ WindowingsystemCmd(
14071407
windowingsystem = "win32";
14081408
#elif defined(MAC_OSX_TK)
14091409
windowingsystem = "aqua";
1410+
#elif defined(TK_USE_WAYLAND)
1411+
windowingsystem = "wayland";
14101412
#else
14111413
windowingsystem = "x11";
14121414
#endif

0 commit comments

Comments
 (0)