summaryrefslogtreecommitdiffstats
path: root/unix/tkUnixXId.c
diff options
context:
space:
mode:
authorhypnotoad <yoda@etoyoc.com>2016-10-02 12:07:40 (GMT)
committerhypnotoad <yoda@etoyoc.com>2016-10-02 12:07:40 (GMT)
commit0c444bd87e7dc74b25427a5fccf08ddd8d565cd6 (patch)
tree3afc6c9d5e73e2e86de808ce98ce275312d3dc7e /unix/tkUnixXId.c
parent20c81b194394bb6ea16d1831f6f895b63477819c (diff)
parent6c0dafab46875ddb6dd0a91f5e056a8d87722ca6 (diff)
downloadtk-core_zip_vfs.zip
tk-core_zip_vfs.tar.gz
tk-core_zip_vfs.tar.bz2
Pulling changes from trunkcore_zip_vfs
Diffstat (limited to 'unix/tkUnixXId.c')
-rw-r--r--unix/tkUnixXId.c54
1 files changed, 15 insertions, 39 deletions
diff --git a/unix/tkUnixXId.c b/unix/tkUnixXId.c
index 819b7aa..c6873a1 100644
--- a/unix/tkUnixXId.c
+++ b/unix/tkUnixXId.c
@@ -14,39 +14,6 @@
/*
*----------------------------------------------------------------------
*
- * Tk_FreeXId --
- *
- * This function is called to indicate that an X resource identifier is
- * now free.
- *
- * Results:
- * None.
- *
- * Side effects:
- * The identifier is added to the stack of free identifiers for its
- * display, so that it can be re-used.
- *
- *----------------------------------------------------------------------
- */
-
-void
-Tk_FreeXId(
- Display *display, /* Display for which xid was allocated. */
- XID xid) /* Identifier that is no longer in use. */
-{
- /*
- * This does nothing, because the XC-MISC extension takes care of
- * freeing XIDs for us. It has been a standard X11 extension for
- * about 15 years as of 2008. Keith Packard and another X.org
- * developer suggested that we remove the previous code that used:
- * #define XLIB_ILLEGAL_ACCESS.
- */
-}
-
-
-/*
- *----------------------------------------------------------------------
- *
* Tk_GetPixmap --
*
* Same as the XCreatePixmap function except that it manages resource
@@ -96,7 +63,6 @@ Tk_FreePixmap(
Pixmap pixmap) /* Identifier for pixmap. */
{
XFreePixmap(display, pixmap);
- Tk_FreeXId(display, (XID) pixmap);
}
@@ -125,13 +91,23 @@ TkpScanWindowId(
const char *string,
Window *idPtr)
{
- int value;
+ int code;
+ Tcl_Obj obj;
+
+ obj.refCount = 1;
+ obj.bytes = (char *) string; /* DANGER?! */
+ obj.length = strlen(string);
+ obj.typePtr = NULL;
- if (Tcl_GetInt(interp, string, &value) != TCL_OK) {
- return TCL_ERROR;
+ code = Tcl_GetLongFromObj(interp, &obj, (long *)idPtr);
+
+ if (obj.refCount > 1) {
+ Tcl_Panic("invalid sharing of Tcl_Obj on C stack");
+ }
+ if (obj.typePtr && obj.typePtr->freeIntRepProc) {
+ obj.typePtr->freeIntRepProc(&obj);
}
- *idPtr = (Window) value;
- return TCL_OK;
+ return code;
}
/*