diff options
author | patthoyts@users.sourceforge.net <patthoyts> | 2009-12-08 20:34:23 (GMT) |
---|---|---|
committer | patthoyts@users.sourceforge.net <patthoyts> | 2009-12-08 20:34:23 (GMT) |
commit | 9e1a4621e7b2531885d3fdfbb8f4e2a6dc73fbe4 (patch) | |
tree | 35e4fd484a5e5bc2ea797ceef274e896083ff6d4 | |
parent | 3e1df6a67316e867fad791a9dd65ef797cb12896 (diff) | |
download | tk-9e1a4621e7b2531885d3fdfbb8f4e2a6dc73fbe4.zip tk-9e1a4621e7b2531885d3fdfbb8f4e2a6dc73fbe4.tar.gz tk-9e1a4621e7b2531885d3fdfbb8f4e2a6dc73fbe4.tar.bz2 |
[Bug 2864685] Set correct extended window manager hints on Tk menus.
-rw-r--r-- | ChangeLog | 42 | ||||
-rw-r--r-- | unix/tkUnixWm.c | 34 |
2 files changed, 57 insertions, 19 deletions
@@ -1,29 +1,35 @@ +2009-12-08 Pat Thoyts <patthoyts@users.sourceforge.net> + + * unix/tkUnixWm.c: [Bug 2864685] Apply suitable extended window + manager hints to the menus so that modern unix window managers + can use the correct animation modes. + 2009-12-02 Jan Nijtmans <nijtmans@users.sf.net> - * win/configure (regenerated) - * win/Makefile.in Use tktest86.dll for all tests. - * win/tkWinInt.h mark various functions MODULE_SCOPE - * generic/tkInt.decls make TkWinChildProc available in private - stub table. [Bug #220600] and [Bug #220690]. - * generic/tkIntPlatDecls.h (regenerated) - * generic/tkStubInit.c (regenerated) + * win/configure: (regenerated) + * win/Makefile.in: Use tktest86.dll for all tests. + * win/tkWinInt.h: mark various functions MODULE_SCOPE + * generic/tkInt.decls: make TkWinChildProc available in private + stub table. [Bug #220600] and [Bug #220690]. + * generic/tkIntPlatDecls.h: (regenerated) + * generic/tkStubInit.c: (regenerated) 2009-11-30 Jan Nijtmans <nijtmans@users.sf.net> - * win/Makefile.in Better dependancies in case of static - build. Generate tktest86.dll and tktest86.lib. + * win/Makefile.in: Better dependancies in case of static + build. Generate tktest86.dll and tktest86.lib. 2009-11-29 Jan Nijtmans <nijtmans@users.sf.net> - * generic/tkInt.h Make all internal initialization - * generic/tkTest.c routines MODULE_SCOPE - * generic/tkOldTest.c - * generic/tkSquare.c - * carbon/tkMaxOSXTest.c - * macosx/tkMaxOSXTest.c - * win/tkWinTest.c - * win/tcl.m4 (copied from Tcl 8.6) - * win/configure (regenerated) + * generic/tkInt.h: Make all internal initialization + * generic/tkTest.c: routines MODULE_SCOPE + * generic/tkOldTest.c: + * generic/tkSquare.c: + * carbon/tkMaxOSXTest.c: + * macosx/tkMaxOSXTest.c: + * win/tkWinTest.c: + * win/tcl.m4: (copied from Tcl 8.6) + * win/configure: (regenerated) 2009-11-25 Stuart Cassoff <stwo@users.sf.net> diff --git a/unix/tkUnixWm.c b/unix/tkUnixWm.c index 195a9e1..7b47a51 100644 --- a/unix/tkUnixWm.c +++ b/unix/tkUnixWm.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: tkUnixWm.c,v 1.74 2009/11/24 15:06:23 dkf Exp $ + * RCS: @(#) $Id: tkUnixWm.c,v 1.75 2009/12/08 20:34:23 patthoyts Exp $ */ #include "tkUnixInt.h" @@ -6608,6 +6608,30 @@ GetMaxSize( /* *---------------------------------------------------------------------- * + * TkSetTransientFor -- + * + * Set a Tk window to be transient with reference to a specified + * parent or the toplevel ancestor if None is passed as parent. + * + *---------------------------------------------------------------------- + */ + +void +TkSetTransientFor(Tk_Window tkwin, Tk_Window parent) +{ + if (parent == None) { + parent = Tk_Parent(tkwin); + while (!Tk_IsTopLevel(parent)) + parent = Tk_Parent(tkwin); + } + XSetTransientForHint(Tk_Display(tkwin), + ((TkWindow *)tkwin)->wmInfoPtr->wrapperPtr->window, + ((TkWindow *)parent)->wmInfoPtr->wrapperPtr->window); +} + +/* + *---------------------------------------------------------------------- + * * TkpMakeMenuWindow -- * * Configure the window to be either a pull-down (or pop-up) menu, or as @@ -6634,6 +6658,7 @@ TkpMakeMenuWindow( WmInfo *wmPtr; XSetWindowAttributes atts; TkWindow *wrapperPtr; + Atom atom; if (!Tk_HasWrapper(tkwin)) { return; @@ -6646,10 +6671,17 @@ TkpMakeMenuWindow( if (transient) { atts.override_redirect = True; atts.save_under = True; + atom = Tk_InternAtom((Tk_Window) tkwin, "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU"); } else { atts.override_redirect = False; atts.save_under = False; + atom = Tk_InternAtom((Tk_Window) tkwin, "_NET_WM_WINDOW_TYPE_MENU"); + TkSetTransientFor(tkwin, NULL); } + XChangeProperty(Tk_Display(tkwin), wrapperPtr->window, + Tk_InternAtom((Tk_Window) tkwin, "_NET_WM_WINDOW_TYPE"), + XA_ATOM, 32, PropModeReplace, + (unsigned char *) &atom, 1); /* * The override-redirect and save-under bits must be set on the wrapper |