summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2020-02-18 21:19:57 (GMT)
committerfvogel <fvogelnew1@free.fr>2020-02-18 21:19:57 (GMT)
commitf85275ba623ef4e7bbd74cee04017c8ed6d5c9a5 (patch)
treece4499d877ec6bf5deb8d9dd9766e8568f438a52 /generic
parent2eba29238e00ddad8847d54417625dd5dcf4e781 (diff)
downloadtk-f85275ba623ef4e7bbd74cee04017c8ed6d5c9a5.zip
tk-f85275ba623ef4e7bbd74cee04017c8ed6d5c9a5.tar.gz
tk-f85275ba623ef4e7bbd74cee04017c8ed6d5c9a5.tar.bz2
Use TkGrabState() in function TestgrabObjCmd() instead of dispPtr->grabWinPtr to make the code clearer and the interface cleaner.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkTest.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/generic/tkTest.c b/generic/tkTest.c
index e3bfd4d..1f373ad 100644
--- a/generic/tkTest.c
+++ b/generic/tkTest.c
@@ -2118,7 +2118,6 @@ TestgrabObjCmd(
enum option {GRABBED, RELEASED};
int index, res = 0;
Tk_Window mainWin, tkwin;
- TkDisplay *dispPtr;
mainWin = (Tk_Window) clientData;
@@ -2136,17 +2135,17 @@ TestgrabObjCmd(
if (tkwin == NULL) {
return TCL_ERROR;
}
- dispPtr = ((TkWindow *) tkwin)->dispPtr;
- /*printf("TestgrabObjCmd %s, grabWinPtr = %p , tkwin = %p\n", options[index], dispPtr->grabWinPtr, tkwin);fflush(stdout);*/
+ /*printf("TestgrabObjCmd %s, grabWinPtr = %p , tkwin = %p\n", options[index],
+ ((TkWindow *) tkwin)->dispPtr->grabWinPtr, tkwin);fflush(stdout);*/
switch ((enum option) index) {
case GRABBED:
- if (dispPtr->grabWinPtr == (TkWindow *) tkwin) {
+ if (TkGrabState((TkWindow *) tkwin) != TK_GRAB_NONE) {
res = 1;
}
break;
case RELEASED:
- if (dispPtr->grabWinPtr != (TkWindow *) tkwin) {
+ if (TkGrabState((TkWindow *) tkwin) == TK_GRAB_NONE) {
res = 1;
}
break;