views:

137

answers:

2

(see edits)

I'm developing a QT/c++ application under gnome.

The application a main window and QListBox child window.

Both of these windows show up as separate main windows when I alt-tab away from the application.

How can I make it so that only one window is shown when I (or later the user) uses alt-tab?

I am guessing this behavior comes because one main window doesn't clip the subwindow - the subwindow extends the boundary of the main window. Gnome has bad alt-tab behavior for a number of other applications too, showing modal dialog boxes separately from main windows. But in the case of my app, this is really annoying.

I am thinking I could make a giant transparent window that includes both existing windows. But it would be nicer to find a "clean" solution.

(the most logical guess is indeed that it has something to do with window flags. I've tried every reasonable combination of flags I could think of. The window types are described here)

Edit: The app has a QWidget as its main window (Not QMainWindow), QListView is contained in the QWidget object and created by passing a point to the main window. is styled with Qt::Tool | Qt::FramelessWindowHint.

Edit2: The Qt::X11BypassWindowManagerHint style does work to remove the window from the alt-tab list. The problem is that it also makes the window "unmanaged" so it cover the other windows. I could manaully hide whenever I lose focus - prize now for a better solution.

+1  A: 
jollyroger
Well, you've got the only answer - the problem is, you are wrong. I'll just hold off. Maybe award it if you edit to reflect the comments in my question...
Joe Soul-bringer
Well, I think the solution is as in my edits - you need to use the Qt::X11BypassWindowManagerHint style with all it's problems. But hey, if you've gone that much trouble, you're closer than anyone else...
Joe Soul-bringer
But frickin stack overflow might have eaten the bonus since I can't see them appearing. Bad SO. This place ain't what it used to be...
Joe Soul-bringer
+1  A: 

You can try it by hand with the wmctrl tool. With "-r -b SOMETHING" you can modify NET_WM arguments to it. Try these in [1].

If this works, you can add them in with Xlib-Calls (If you get to know X11 Window Number from Qt. I am sure that's possible).

[1] http://standards.freedesktop.org/wm-spec/1.3/ar01s05.html
nob