From bc2875abe04af3a0845c5a2cca5f4e61eb677d29 Mon Sep 17 00:00:00 2001 From: patthoyts Date: Tue, 6 Jan 2009 01:26:25 +0000 Subject: Use task modal rather than system modal for messageboxes and use MB_SETFOREGROUND to get the user notification if the application is not the foreground application (flashing in the taskbar). [Bug 2484771] --- ChangeLog | 5 +++++ win/tkWinDialog.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 301c3de..295572e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-01-06 Pat Thoyts + + * win/tkWinDialog.c: Use task modal for messagebox instead of + system modal [Bug 2484771] (ferrieux,thoyts,mjanssen) + 2009-01-03 Donal K. Fellows * doc/canvas.n: Improve the documentation of the -offset and diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c index fd0942b..3f422f2 100644 --- a/win/tkWinDialog.c +++ b/win/tkWinDialog.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: tkWinDialog.c,v 1.59 2008/12/16 23:53:14 nijtmans Exp $ + * RCS: @(#) $Id: tkWinDialog.c,v 1.60 2009/01/06 01:26:26 patthoyts Exp $ * */ @@ -2151,6 +2151,9 @@ Tk_MessageBoxObjCmd( } } + while (!Tk_IsTopLevel(parent)) { + parent = Tk_Parent(parent); + } Tk_MakeWindowExist(parent); hWnd = Tk_GetHWND(Tk_WindowId(parent)); @@ -2180,7 +2183,7 @@ Tk_MessageBoxObjCmd( flags = buttonFlagMap[defaultBtnIdx]; } - flags |= icon | type | MB_SYSTEMMODAL; + flags |= icon | type | MB_TASKMODAL | MB_SETFOREGROUND; tmpObj = messageObj ? Tcl_DuplicateObj(messageObj) : Tcl_NewUnicodeObj(NULL, 0); -- cgit v0.12