summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
Diffstat (limited to 'win')
-rwxr-xr-xwin/configure2
-rw-r--r--win/configure.in2
-rw-r--r--win/makefile.vc2
-rw-r--r--win/tkWinDefault.h1
-rw-r--r--win/tkWinDialog.c43
-rw-r--r--win/tkWinMenu.c29
-rw-r--r--win/tkWinWm.c6
7 files changed, 55 insertions, 30 deletions
diff --git a/win/configure b/win/configure
index 18efa23..cbac248 100755
--- a/win/configure
+++ b/win/configure
@@ -1312,7 +1312,7 @@ SHELL=/bin/sh
TK_VERSION=8.6
TK_MAJOR_VERSION=8
TK_MINOR_VERSION=6
-TK_PATCH_LEVEL=".4"
+TK_PATCH_LEVEL=".5"
VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION
#------------------------------------------------------------------------
diff --git a/win/configure.in b/win/configure.in
index 709b97f..0ff9304 100644
--- a/win/configure.in
+++ b/win/configure.in
@@ -14,7 +14,7 @@ SHELL=/bin/sh
TK_VERSION=8.6
TK_MAJOR_VERSION=8
TK_MINOR_VERSION=6
-TK_PATCH_LEVEL=".4"
+TK_PATCH_LEVEL=".5"
VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION
#------------------------------------------------------------------------
diff --git a/win/makefile.vc b/win/makefile.vc
index ae43eb6..6f61327 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -961,7 +961,7 @@ install-binaries:
!if !$(STATIC_BUILD)
@echo creating package index
@type << > $(OUT_DIR)\pkgIndex.tcl
-if {[catch {package present Tcl $(TCL_PATCH_LEVEL)}]} { return }
+if {[catch {package present Tcl 8.6.0}]} { return }
if {($$::tcl_platform(platform) eq "unix") && ([info exists ::env(DISPLAY)]
|| ([info exists ::argv] && ("-display" in $$::argv)))} {
package ifneeded Tk $(TK_PATCH_LEVEL) [list load [file join $$dir .. .. bin libtk$(TK_DOTVERSION).dll] Tk]
diff --git a/win/tkWinDefault.h b/win/tkWinDefault.h
index c52cc4d..f389075 100644
--- a/win/tkWinDefault.h
+++ b/win/tkWinDefault.h
@@ -224,6 +224,7 @@
#define DEF_LISTBOX_HIGHLIGHT_BG NORMAL_BG
#define DEF_LISTBOX_HIGHLIGHT HIGHLIGHT
#define DEF_LISTBOX_HIGHLIGHT_WIDTH "1"
+#define DEF_LISTBOX_JUSTIFY "left"
#define DEF_LISTBOX_RELIEF "sunken"
#define DEF_LISTBOX_SCROLL_COMMAND ""
#define DEF_LISTBOX_LIST_VARIABLE ""
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c
index d7f63fb..a7d8c7d 100644
--- a/win/tkWinDialog.c
+++ b/win/tkWinDialog.c
@@ -674,19 +674,25 @@ static void LoadShellProcs()
* processing functions are used to cope with keyboard navigation of
* controls.)
*
- * Here is one solution. After returning, we poll the message queue for
- * 1/4s looking for WM_LBUTTON up messages. If we see one it's consumed.
- * If we get a WM_LBUTTONDOWN message, then we exit early, since the user
- * must be doing something new. This fix only works for the current
- * application, so the problem will still occur if the open dialog
- * happens to be over another applications button. However this is a
- * fairly rare occurrance.
+ * Here is one solution. After returning, we flush all mouse events
+ * for 1/4 second. In 8.6.5 and earlier, the code used to
+ * poll the message queue consuming WM_LBUTTONUP messages.
+ * On seeing a WM_LBUTTONDOWN message, it would exit early, since the user
+ * must be doing something new. However this early exit does not work
+ * on Vista and later because the Windows sends both BUTTONDOWN and
+ * BUTTONUP after the DBLCLICK instead of just BUTTONUP as on XP.
+ * Rather than try and figure out version specific sequences, we
+ * ignore all mouse events in that interval.
+ *
+ * This fix only works for the current application, so the problem will
+ * still occur if the open dialog happens to be over another applications
+ * button. However this is a fairly rare occurrance.
*
* Results:
* None.
*
* Side effects:
- * Consumes an unwanted BUTTON messages.
+ * Consumes unwanted mouse related messages.
*
*-------------------------------------------------------------------------
*/
@@ -698,10 +704,7 @@ EatSpuriousMessageBugFix(void)
DWORD nTime = GetTickCount() + 250;
while (GetTickCount() < nTime) {
- if (PeekMessageA(&msg, 0, WM_LBUTTONDOWN, WM_LBUTTONDOWN, PM_NOREMOVE)){
- break;
- }
- PeekMessageA(&msg, 0, WM_LBUTTONUP, WM_LBUTTONUP, PM_REMOVE);
+ PeekMessage(&msg, 0, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE);
}
}
@@ -1113,7 +1116,7 @@ ParseOFNOptions(
if (strcmp(Tcl_GetString(objv[i]), "-xpstyle"))
goto error_return;
if (i + 1 == objc) {
- Tcl_SetResult(interp, "value for \"-xpstyle\" missing", TCL_STATIC);
+ Tcl_SetObjResult(interp, Tcl_NewStringObj("value for \"-xpstyle\" missing", -1));
Tcl_SetErrorCode(interp, "TK", "FILEDIALOG", "VALUE", NULL);
goto error_return;
}
@@ -1281,9 +1284,8 @@ static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr,
int oldMode;
if (tsdPtr->newFileDialogsState != FDLG_STATE_USE_NEW) {
- /* XXX - should be an assert but Tcl does not seem to have one? */
- Tcl_SetResult(interp, "Internal error: GetFileNameVista: IFileDialog API not available", TCL_STATIC);
- return TCL_ERROR;
+ Tcl_Panic("Internal error: GetFileNameVista: IFileDialog API not available");
+ return TCL_ERROR;
}
/*
@@ -1425,6 +1427,7 @@ static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr,
oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL);
hr = fdlgIf->lpVtbl->Show(fdlgIf, hWnd);
Tcl_SetServiceMode(oldMode);
+ EatSpuriousMessageBugFix();
/*
* Ensure that hWnd is enabled, because it can happen that we have updated
@@ -3145,13 +3148,13 @@ HookProc(
if (IsWindow(hwndCtrl)) {
EnableWindow(hwndCtrl, FALSE);
}
- TkSendVirtualEvent(phd->parent, "TkFontchooserVisibility");
+ TkSendVirtualEvent(phd->parent, "TkFontchooserVisibility", NULL);
return 1; /* we handled the message */
}
if (WM_DESTROY == msg) {
phd->hwnd = NULL;
- TkSendVirtualEvent(phd->parent, "TkFontchooserVisibility");
+ TkSendVirtualEvent(phd->parent, "TkFontchooserVisibility", NULL);
return 0;
}
@@ -3169,7 +3172,7 @@ HookProc(
ApplyLogfont(phd->interp, phd->cmdObj, hdc, &lf);
}
if (phd && phd->parent) {
- TkSendVirtualEvent(phd->parent, "TkFontchooserFontChanged");
+ TkSendVirtualEvent(phd->parent, "TkFontchooserFontChanged", NULL);
}
return 1;
}
@@ -3481,7 +3484,7 @@ FontchooserShowCmd(
ApplyLogfont(hdPtr->interp, hdPtr->cmdObj, hdc, &lf);
}
if (hdPtr->parent) {
- TkSendVirtualEvent(hdPtr->parent, "TkFontchooserFontChanged");
+ TkSendVirtualEvent(hdPtr->parent, "TkFontchooserFontChanged", NULL);
}
}
Tcl_SetServiceMode(oldMode);
diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c
index 4593928..8e14669 100644
--- a/win/tkWinMenu.c
+++ b/win/tkWinMenu.c
@@ -155,7 +155,7 @@ static void DrawWindowsSystemBitmap(Display *display,
Drawable drawable, GC gc, const RECT *rectPtr,
int bitmapID, int alignFlags);
static void FreeID(WORD commandID);
-static char * GetEntryText(TkMenuEntry *mePtr);
+static char * GetEntryText(TkMenu *menuPtr, TkMenuEntry *mePtr);
static void GetMenuAccelGeometry(TkMenu *menuPtr,
TkMenuEntry *mePtr, Tk_Font tkfont,
const Tk_FontMetrics *fmPtr, int *widthPtr,
@@ -486,6 +486,7 @@ TkpDestroyMenuEntry(
static char *
GetEntryText(
+ TkMenu *menuPtr, /* The menu considered. */
TkMenuEntry *mePtr) /* A pointer to the menu entry. */
{
char *itemText;
@@ -506,7 +507,7 @@ GetEntryText(
int i;
const char *label = (mePtr->labelPtr == NULL) ? ""
: Tcl_GetString(mePtr->labelPtr);
- const char *accel = (mePtr->accelPtr == NULL) ? ""
+ const char *accel = ((menuPtr->menuType == MENUBAR) || (mePtr->accelPtr == NULL)) ? ""
: Tcl_GetString(mePtr->accelPtr);
const char *p, *next;
Tcl_DString itemString;
@@ -605,7 +606,7 @@ ReconfigureWindowsMenu(
continue;
}
- itemText = GetEntryText(mePtr);
+ itemText = GetEntryText(menuPtr, mePtr);
if ((menuPtr->menuType == MENUBAR)
|| (menuPtr->menuFlags & MENU_SYSTEM_MENU)) {
Tcl_WinUtfToTChar(itemText, -1, &translatedText);
@@ -1287,7 +1288,17 @@ TkWinHandleMenuEvent(
if (menuPtr != NULL) {
long entryIndex = LOWORD(*pwParam);
- mePtr = NULL;
+ if ((menuPtr->menuType == MENUBAR) && menuPtr->tearoff) {
+ /*
+ * Windows passes the entry index starting at 0 for
+ * the first menu entry. However this entry #0 is the
+ * tearoff entry for Tk (the menu has -tearoff 1),
+ * which is ignored for MENUBAR menues on Windows.
+ */
+
+ entryIndex++;
+ }
+ mePtr = NULL;
if (flags != 0xFFFF) {
if ((flags&MF_POPUP) && (entryIndex<menuPtr->numEntries)) {
mePtr = menuPtr->entries[entryIndex];
@@ -1502,12 +1513,12 @@ GetMenuAccelGeometry(
*heightPtr = fmPtr->linespace;
if (mePtr->type == CASCADE_ENTRY) {
*widthPtr = 0;
- } else if (mePtr->accelPtr == NULL) {
- *widthPtr = 0;
- } else {
+ } else if ((menuPtr->menuType != MENUBAR) && (mePtr->accelPtr != NULL)) {
const char *accel = Tcl_GetString(mePtr->accelPtr);
*widthPtr = Tk_TextWidth(tkfont, accel, mePtr->accelLength);
+ } else {
+ *widthPtr = 0;
}
}
@@ -1763,6 +1774,10 @@ DrawMenuEntryAccelerator(
int leftEdge = x + mePtr->indicatorSpace + mePtr->labelWidth;
const char *accel;
+ if (menuPtr->menuType == MENUBAR) {
+ return;
+ }
+
if (mePtr->accelPtr != NULL) {
accel = Tcl_GetString(mePtr->accelPtr);
} else {
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index 768ee69..4e7618d 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.c
@@ -3673,6 +3673,12 @@ WmForgetCmd(
winPtr->flags &= ~(TK_TOP_HIERARCHY|TK_TOP_LEVEL|TK_HAS_WRAPPER|TK_WIN_MANAGED);
Tk_MakeWindowExist((Tk_Window)winPtr->parentPtr);
RemapWindows(winPtr, Tk_GetHWND(winPtr->parentPtr->window));
+
+ /*
+ * Make sure wm no longer manages this window
+ */
+ Tk_ManageGeometry(frameWin, NULL, NULL);
+
TkWmDeadWindow(winPtr);
/* flags (above) must be cleared before calling */
/* TkMapTopFrame (below) */