Path: utzoo!attcan!uunet!ogicse!mintaka!bloom-beacon!eng.sun.COM!smarks From: smarks@eng.sun.COM (Stuart W. Marks) Newsgroups: comp.windows.x Subject: Re: ICCCM question about raising windows Message-ID: <9004110124.AA06170@trantor.Eng.Sun.COM> Date: 11 Apr 90 01:24:21 GMT References: <9004092038.AA07859@sae.com> Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 47 | When the user asks the application to display a window that is already | created, but obscured, I would like to be able to just raise it rather | than recreate it. | | If the application is running under a reparenting window manager, I | obviously can't raise the window of the Shell widget I created. Is it | OK to walk up the window's parents until I get to the root window, and | raise child of root that I find? Actually, you do simply raise the Shell widget. (But I agree that it isn't obvious.) This works because a reparenting window manager will have selected for SubstructureRedirect on its parent window, so the request to raise the window will get redirected to the window manager. Thus, issuing an XRaiseWindow call (or whatever) on the Shell widget is always the right thing to do. Now, it's not guaranteed that the window manager will honor your application's request to raise the window to the top. Some window managers will decide that they don't want to honor stacking order requests, and so your application will have to live with that. Please don't walk around the window hierarchy and manipulate windows that you think are the right ones. There's a possibility that the direct child of root that you find isn't the window manager's parent window, but is a pseudo-root window of some sort. Raising this window is NOT what you want to do! | I don't see this situation covered in the ICCCM. If it is, could someone | please quote me chapter and verse. There's a discussion of stacking order requests towards the end of section 4.1.5 of the ICCCM. | If my workaround shouldn't be used, | could someone suggest a portable way for communicating the raise request | to the window manager? Using XRaiseWindow (or other configuration requests) directly on the Shell is the most portable way. It's certainly more portable than searching the window tree. s'marks Stuart W. Marks ARPA: smarks@eng.sun.com Window Systems Group UUCP: sun!smarks Sun Microsystems, Inc.