summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhobbs <hobbs>2004-09-10 20:50:52 (GMT)
committerhobbs <hobbs>2004-09-10 20:50:52 (GMT)
commit14704281d8afd8bcb9aeca639fd7db1a6df2a2d9 (patch)
treeb5e3364ab5a230e6e4387bff073df7b9919c85e6
parent1a95bbf7c02aa7cabf93e2aadc97ee801e3816e3 (diff)
downloadtk-14704281d8afd8bcb9aeca639fd7db1a6df2a2d9.zip
tk-14704281d8afd8bcb9aeca639fd7db1a6df2a2d9.tar.gz
tk-14704281d8afd8bcb9aeca639fd7db1a6df2a2d9.tar.bz2
(UpdateWrapper): update to Kovalenko to account for whether the
override window has a transient parent, and apply WS_POPUP in the correct case. The makes splash screens pop up as well as making dropdowns not grab focus away from the parent.
-rw-r--r--ChangeLog4
-rw-r--r--win/tkWinWm.c30
2 files changed, 20 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index b1c1cb0..ab7ad73 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,10 @@
* win/tkWinWm.c (ActivateWindow): SetFocus to grab window when
clicking outside the grab window hierarchy. [Bug 220908]
+ (UpdateWrapper): update to Kovalenko to account for whether the
+ override window has a transient parent, and apply WS_POPUP in the
+ correct case. The makes splash screens pop up as well as making
+ dropdowns not grab focus away from the parent.
2004-09-09 Jeff Hobbs <jeffh@ActiveState.com>
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index b7817d6..dd81f47 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.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: tkWinWm.c,v 1.54.2.4 2004/09/10 18:47:21 hobbs Exp $
+ * RCS: @(#) $Id: tkWinWm.c,v 1.54.2.5 2004/09/10 20:51:07 hobbs Exp $
*/
#include "tkWinInt.h"
@@ -315,7 +315,7 @@ typedef struct TkWmInfo {
* Window styles for various types of toplevel windows.
*/
-#define WM_OVERRIDE_STYLE (WS_CHILD|WS_CLIPCHILDREN|WS_CLIPSIBLINGS|CS_DBLCLKS)
+#define WM_OVERRIDE_STYLE (WS_CLIPCHILDREN|WS_CLIPSIBLINGS|CS_DBLCLKS)
#define EX_OVERRIDE_STYLE (WS_EX_TOOLWINDOW)
#define WM_TOPLEVEL_STYLE (WS_OVERLAPPEDWINDOW|WS_CLIPCHILDREN|CS_DBLCLKS)
@@ -1934,17 +1934,26 @@ UpdateWrapper(winPtr)
} else {
/*
* Pick the decorative frame style. Override redirect windows get
- * created as undecorated popups. Transient windows get a modal
- * dialog frame. Neither override, nor transient windows appear in
- * the Windows taskbar. Note that a transient window does not resize
- * by default, so we need to explicitly add the WS_THICKFRAME style
- * if we want it to be resizeable.
+ * created as undecorated popups if they have no transient parent,
+ * otherwise they are children. This allows splash screens to operate
+ * as an independent window, while having dropdows (like for a
+ * combobox) not grab focus away from their parent. Transient windows
+ * get a modal dialog frame. Neither override, nor transient windows
+ * appear in the Windows taskbar. Note that a transient window does
+ * not resize by default, so we need to explicitly add the
+ * WS_THICKFRAME style if we want it to be resizeable.
*/
if (winPtr->atts.override_redirect) {
wmPtr->style = WM_OVERRIDE_STYLE;
wmPtr->exStyle = EX_OVERRIDE_STYLE;
+ /* parent must be desktop even if we have a transient parent */
parentHWND = GetDesktopWindow();
+ if (wmPtr->masterPtr) {
+ wmPtr->style |= WS_CHILD;
+ } else {
+ wmPtr->style |= WS_POPUP;
+ }
} else if (wmPtr->masterPtr) {
wmPtr->style = WM_TRANSIENT_STYLE;
wmPtr->exStyle = EX_TRANSIENT_STYLE;
@@ -2153,13 +2162,6 @@ UpdateWrapper(winPtr)
}
/*
- * To keep the standard Tk behavior, we must raise override_redirected
- * window manually
- */
- if (winPtr->atts.override_redirect) {
- TkWinSetWindowPos(wmPtr->wrapper, NULL, Above);
- }
- /*
* If this is the first window created by the application, then
* we should activate the initial window.
*/