summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorgeorgeps <georgeps>2008-08-19 15:52:11 (GMT)
committergeorgeps <georgeps>2008-08-19 15:52:11 (GMT)
commit65721df535d2aea9213fc2c357a9c4c256b2cec6 (patch)
treec84b392e06fb0dd9d69a9a13c3f46b8a56267704 /generic
parent03d77dae7c7add838a4b5a9e29dd3561899decc5 (diff)
downloadtk-65721df535d2aea9213fc2c357a9c4c256b2cec6.zip
tk-65721df535d2aea9213fc2c357a9c4c256b2cec6.tar.gz
tk-65721df535d2aea9213fc2c357a9c4c256b2cec6.tar.bz2
After some discussion with Joe English and subsequently the
X.org developers (Keith Packard in particular), it was discovered that Tk is doing management of XIDs that it shouldn't need to do. The very common XC-MISC extension which has come with every version of X for the last 15 years is used with Xlib now, to retrieve the information about the used/unused XIDs. The public Tk_FreeXId is now a no-op. Joe English reviewed the patch, and said "please commit." The patch is associated with the bug tracker id: 2039720 generic/tkError.c: Remove the usage of TkpWindowWasRecentlyDeleted. generic/tkInt.decls: Update the declarations for the now unused internalstubs. generic/tkIntDecls.h: Regenerated based on tkInt.decls. generic/tkIntPlatDecls.h: Regenerated based on tkInt.decls. generic/tkStubInit.c generic/tkWindow.c: Remove the calls to TkInitXId, and TkFreeWindowId. macosx/tkMaxOSXPort.h: Remove TkFreeWindowId and TkInitXId macro definitions. macosx/tkMacOSXXStubs.c: Remove the no-op TkpWindowWasRecentlyDeleted. unix/tkUnixEvent.c: Remove call to TkFreeXId. unix/tkUnixXId.c: Remove a lot of unnecessary code (see above). win/tkWinPort.h: Remove TkFreeWindowId and TkInitXId. win/tkWinWindow.c: Remove TkpWindowWasRecentlyDeleted.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkError.c5
-rw-r--r--generic/tkInt.decls14
-rw-r--r--generic/tkIntDecls.h16
-rw-r--r--generic/tkIntPlatDecls.h41
-rw-r--r--generic/tkStubInit.c10
-rw-r--r--generic/tkWindow.c5
6 files changed, 23 insertions, 68 deletions
diff --git a/generic/tkError.c b/generic/tkError.c
index 518cfdb..6144093 100644
--- a/generic/tkError.c
+++ b/generic/tkError.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkError.c,v 1.6 2007/12/13 15:24:14 dgp Exp $
+ * RCS: @(#) $Id: tkError.c,v 1.7 2008/08/19 15:52:11 georgeps Exp $
*/
#include "tkInt.h"
@@ -271,8 +271,7 @@ ErrorProc(
if (errEventPtr->error_code == BadWindow) {
Window w = (Window) errEventPtr->resourceid;
- if (Tk_IdToWindow(display, w) != NULL
- || TkpWindowWasRecentlyDeleted(w, dispPtr)) {
+ if (Tk_IdToWindow(display, w) != NULL) {
return 0;
}
}
diff --git a/generic/tkInt.decls b/generic/tkInt.decls
index 561b237..7f87450 100644
--- a/generic/tkInt.decls
+++ b/generic/tkInt.decls
@@ -10,7 +10,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: tkInt.decls,v 1.44 2007/12/13 15:24:14 dgp Exp $
+# RCS: @(#) $Id: tkInt.decls,v 1.45 2008/08/19 15:52:11 georgeps Exp $
library tk
@@ -278,9 +278,6 @@ declare 74 generic {
declare 75 generic {
int TkpUseWindow(Tcl_Interp *interp, Tk_Window tkwin, CONST char *string)
}
-declare 76 generic {
- int TkpWindowWasRecentlyDeleted(Window win, TkDisplay *dispPtr)
-}
declare 77 generic {
void TkQueueEventForAllChildren(TkWindow *winPtr, XEvent *eventPtr)
}
@@ -531,12 +528,6 @@ interface tkIntPlat
declare 0 x11 {
void TkCreateXEventSource(void)
}
-declare 1 x11 {
- void TkFreeWindowId(TkDisplay *dispPtr, Window w)
-}
-declare 2 x11 {
- void TkInitXId(TkDisplay *dispPtr)
-}
declare 3 x11 {
int TkpCmapStressed(Tk_Window tkwin, Colormap colormap)
}
@@ -561,9 +552,6 @@ declare 9 x11 {
declare 10 x11 {
void TkSendCleanup(TkDisplay *dispPtr)
}
-declare 11 x11 {
- void TkFreeXId(TkDisplay *dispPtr)
-}
declare 12 x11 {
int TkpWmSetState(TkWindow *winPtr, int state)
}
diff --git a/generic/tkIntDecls.h b/generic/tkIntDecls.h
index d5f1266..8f749a8 100644
--- a/generic/tkIntDecls.h
+++ b/generic/tkIntDecls.h
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkIntDecls.h,v 1.34 2008/04/08 03:28:05 kennykb Exp $
+ * RCS: @(#) $Id: tkIntDecls.h,v 1.35 2008/08/19 15:52:11 georgeps Exp $
*/
#ifndef _TKINTDECLS
@@ -477,12 +477,7 @@ EXTERN void TkpSetMainMenubar (Tcl_Interp * interp,
EXTERN int TkpUseWindow (Tcl_Interp * interp, Tk_Window tkwin,
CONST char * string);
#endif
-#ifndef TkpWindowWasRecentlyDeleted_TCL_DECLARED
-#define TkpWindowWasRecentlyDeleted_TCL_DECLARED
-/* 76 */
-EXTERN int TkpWindowWasRecentlyDeleted (Window win,
- TkDisplay * dispPtr);
-#endif
+/* Slot 76 is reserved */
#ifndef TkQueueEventForAllChildren_TCL_DECLARED
#define TkQueueEventForAllChildren_TCL_DECLARED
/* 77 */
@@ -1039,7 +1034,7 @@ typedef struct TkIntStubs {
void (*tkpRedirectKeyEvent) (TkWindow * winPtr, XEvent * eventPtr); /* 73 */
void (*tkpSetMainMenubar) (Tcl_Interp * interp, Tk_Window tkwin, char * menuName); /* 74 */
int (*tkpUseWindow) (Tcl_Interp * interp, Tk_Window tkwin, CONST char * string); /* 75 */
- int (*tkpWindowWasRecentlyDeleted) (Window win, TkDisplay * dispPtr); /* 76 */
+ void *reserved76;
void (*tkQueueEventForAllChildren) (TkWindow * winPtr, XEvent * eventPtr); /* 77 */
int (*tkReadBitmapFile) (Display * display, Drawable d, CONST char * filename, unsigned int * width_return, unsigned int * height_return, Pixmap * bitmap_return, int * x_hot_return, int * y_hot_return); /* 78 */
int (*tkScrollWindow) (Tk_Window tkwin, GC gc, int x, int y, int width, int height, int dx, int dy, TkRegion damageRgn); /* 79 */
@@ -1536,10 +1531,7 @@ extern CONST TkIntStubs *tkIntStubsPtr;
#define TkpUseWindow \
(tkIntStubsPtr->tkpUseWindow) /* 75 */
#endif
-#ifndef TkpWindowWasRecentlyDeleted
-#define TkpWindowWasRecentlyDeleted \
- (tkIntStubsPtr->tkpWindowWasRecentlyDeleted) /* 76 */
-#endif
+/* Slot 76 is reserved */
#ifndef TkQueueEventForAllChildren
#define TkQueueEventForAllChildren \
(tkIntStubsPtr->tkQueueEventForAllChildren) /* 77 */
diff --git a/generic/tkIntPlatDecls.h b/generic/tkIntPlatDecls.h
index 1d8c391..dabb233 100644
--- a/generic/tkIntPlatDecls.h
+++ b/generic/tkIntPlatDecls.h
@@ -9,7 +9,7 @@
* Copyright (c) 1998-1999 by Scriptics Corporation.
* All rights reserved.
*
- * RCS: @(#) $Id: tkIntPlatDecls.h,v 1.32 2008/04/08 15:00:43 das Exp $
+ * RCS: @(#) $Id: tkIntPlatDecls.h,v 1.33 2008/08/19 15:52:12 georgeps Exp $
*/
#ifndef _TKINTPLATDECLS
@@ -484,16 +484,8 @@ EXTERN unsigned long TkpGetMS (void);
/* 0 */
EXTERN void TkCreateXEventSource (void);
#endif
-#ifndef TkFreeWindowId_TCL_DECLARED
-#define TkFreeWindowId_TCL_DECLARED
-/* 1 */
-EXTERN void TkFreeWindowId (TkDisplay * dispPtr, Window w);
-#endif
-#ifndef TkInitXId_TCL_DECLARED
-#define TkInitXId_TCL_DECLARED
-/* 2 */
-EXTERN void TkInitXId (TkDisplay * dispPtr);
-#endif
+/* Slot 1 is reserved */
+/* Slot 2 is reserved */
#ifndef TkpCmapStressed_TCL_DECLARED
#define TkpCmapStressed_TCL_DECLARED
/* 3 */
@@ -535,11 +527,7 @@ EXTERN void TkWmCleanup (TkDisplay * dispPtr);
/* 10 */
EXTERN void TkSendCleanup (TkDisplay * dispPtr);
#endif
-#ifndef TkFreeXId_TCL_DECLARED
-#define TkFreeXId_TCL_DECLARED
-/* 11 */
-EXTERN void TkFreeXId (TkDisplay * dispPtr);
-#endif
+/* Slot 11 is reserved */
#ifndef TkpWmSetState_TCL_DECLARED
#define TkpWmSetState_TCL_DECLARED
/* 12 */
@@ -654,8 +642,8 @@ typedef struct TkIntPlatStubs {
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
void (*tkCreateXEventSource) (void); /* 0 */
- void (*tkFreeWindowId) (TkDisplay * dispPtr, Window w); /* 1 */
- void (*tkInitXId) (TkDisplay * dispPtr); /* 2 */
+ void *reserved1;
+ void *reserved2;
int (*tkpCmapStressed) (Tk_Window tkwin, Colormap colormap); /* 3 */
void (*tkpSync) (Display * display); /* 4 */
Window (*tkUnixContainerId) (TkWindow * winPtr); /* 5 */
@@ -664,7 +652,7 @@ typedef struct TkIntPlatStubs {
int (*tkpScanWindowId) (Tcl_Interp * interp, CONST char * string, Window * idPtr); /* 8 */
void (*tkWmCleanup) (TkDisplay * dispPtr); /* 9 */
void (*tkSendCleanup) (TkDisplay * dispPtr); /* 10 */
- void (*tkFreeXId) (TkDisplay * dispPtr); /* 11 */
+ void *reserved11;
int (*tkpWmSetState) (TkWindow * winPtr, int state); /* 12 */
int (*tkpTestsendCmd) (ClientData clientData, Tcl_Interp * interp, int argc, CONST char ** argv); /* 13 */
#endif /* X11 */
@@ -1022,14 +1010,8 @@ extern CONST TkIntPlatStubs *tkIntPlatStubsPtr;
#define TkCreateXEventSource \
(tkIntPlatStubsPtr->tkCreateXEventSource) /* 0 */
#endif
-#ifndef TkFreeWindowId
-#define TkFreeWindowId \
- (tkIntPlatStubsPtr->tkFreeWindowId) /* 1 */
-#endif
-#ifndef TkInitXId
-#define TkInitXId \
- (tkIntPlatStubsPtr->tkInitXId) /* 2 */
-#endif
+/* Slot 1 is reserved */
+/* Slot 2 is reserved */
#ifndef TkpCmapStressed
#define TkpCmapStressed \
(tkIntPlatStubsPtr->tkpCmapStressed) /* 3 */
@@ -1062,10 +1044,7 @@ extern CONST TkIntPlatStubs *tkIntPlatStubsPtr;
#define TkSendCleanup \
(tkIntPlatStubsPtr->tkSendCleanup) /* 10 */
#endif
-#ifndef TkFreeXId
-#define TkFreeXId \
- (tkIntPlatStubsPtr->tkFreeXId) /* 11 */
-#endif
+/* Slot 11 is reserved */
#ifndef TkpWmSetState
#define TkpWmSetState \
(tkIntPlatStubsPtr->tkpWmSetState) /* 12 */
diff --git a/generic/tkStubInit.c b/generic/tkStubInit.c
index 2372007..e9f9c7d 100644
--- a/generic/tkStubInit.c
+++ b/generic/tkStubInit.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkStubInit.c,v 1.63 2008/04/27 22:38:58 dkf Exp $
+ * RCS: @(#) $Id: tkStubInit.c,v 1.64 2008/08/19 15:52:12 georgeps Exp $
*/
#include "tkInt.h"
@@ -128,7 +128,7 @@ static const TkIntStubs tkIntStubs = {
TkpRedirectKeyEvent, /* 73 */
TkpSetMainMenubar, /* 74 */
TkpUseWindow, /* 75 */
- TkpWindowWasRecentlyDeleted, /* 76 */
+ NULL, /* 76 */
TkQueueEventForAllChildren, /* 77 */
TkReadBitmapFile, /* 78 */
TkScrollWindow, /* 79 */
@@ -410,8 +410,8 @@ static const TkIntPlatStubs tkIntPlatStubs = {
#endif /* AQUA */
#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) /* X11 */
TkCreateXEventSource, /* 0 */
- TkFreeWindowId, /* 1 */
- TkInitXId, /* 2 */
+ NULL, /* 1 */
+ NULL, /* 2 */
TkpCmapStressed, /* 3 */
TkpSync, /* 4 */
TkUnixContainerId, /* 5 */
@@ -420,7 +420,7 @@ static const TkIntPlatStubs tkIntPlatStubs = {
TkpScanWindowId, /* 8 */
TkWmCleanup, /* 9 */
TkSendCleanup, /* 10 */
- TkFreeXId, /* 11 */
+ NULL, /* 11 */
TkpWmSetState, /* 12 */
TkpTestsendCmd, /* 13 */
#endif /* X11 */
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index 8820c73..7e947cf 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWindow.c,v 1.95 2008/04/27 22:38:58 dkf Exp $
+ * RCS: @(#) $Id: tkWindow.c,v 1.96 2008/08/19 15:52:12 georgeps Exp $
*/
#include "tkInt.h"
@@ -521,8 +521,6 @@ GetScreen(
dispPtr->name = (char *) ckalloc((unsigned) (length+1));
strncpy(dispPtr->name, screenName, length);
dispPtr->name[length] = '\0';
-
- TkInitXId(dispPtr);
break;
}
if ((strncmp(dispPtr->name, screenName, length) == 0)
@@ -1461,7 +1459,6 @@ Tk_DestroyWindow(
XDestroyWindow(winPtr->display, winPtr->window);
}
#endif
- TkFreeWindowId(dispPtr, winPtr->window);
Tcl_DeleteHashEntry(Tcl_FindHashEntry(&dispPtr->winTable,
(char *) winPtr->window));
winPtr->window = None;