Hi
I want to bring an application window (toplevel shell) to be in front of all other application windows in the desktop, e.g. when the application finishes a certain task or receives a message from another application, it just pops up to the front of all other windows.
I can do that when the application is iconified using:
XtMapWidget(toplevel);
XtRealizeWidget(toplevel);
XtVaSetValues(toplevel, XmNiconic, False, NULL);
XtRaiseWindow(XtDisplay(toplevel), XtWindow(toplevel));
But what can I do when the window is not iconified and just happens to be under a pile of other application windows?
‹ How to make a dialogbox in the front of the application ???? newbee simple question ›
Tue, 08/07/2012 - 15:23
#1
How to bring an application window to front of desktop
Check out XRaiseWindow(). Is it the function you are looking for?
Hi yura
Thanks for the reply.
XRaiseWindow() only works for windows that belong to the same application. The man page states that:
XRaiseWindow(Display *display, Window w)
The XRaiseWindow function raises the specified window to the
top of the stack so that no sibling window obscures it.
which is not what I need. I'm looking for a way to raise one application window above the windows of all other applications.
You need to use something like the following -
XtPopup(XtParent(image_win), XtGrabNone);
Note image_win was my window name.
Or the following call will also do this (not sure of the exact syntax) -
XmPopup
Hi,
Found this code that offers a way to deal with both iconified windows and windows that are just under other windows.
http://www.motifdeveloper.com/tips/tip24.html
Bottom of page, the PopupShell function. Setting de_iconify to false will ONLY deal with the window if it is not iconified. Setting it to true will pop it up from either state.
To the original poster:
quick question for you:
I'm trying to do exactly what you said you could do when the window was iconified.
In the code you listed, is "toplevel" the name of your window or widget?
I'm trying to use either the name of the window or window ID (not the name of the widget) and don't know how I get the name of the widget from the window name.
Thanks. Hope that code I listed helps.
But how to make a window in the front of the application all the way until the user close it and the other window of the application can not be locked ??