Real tool windows

Hi,

i noticed GTK-quartz does not have an actual implementation for tool/utility windows (GDK_WINDOW_TYPE_HINT_UTILITY)

The current implementation makes them float to the top. Apart from not looking as good as native ones, they also ALWAYS stay on the very top, even you switch to another app. GIMP 2.5/2.6 heavily uses this style for their toolbars, which result in very inconveniant behaviour. For instance, if you open your mail app while GIMP is open, the tool windows will appear on top of the mail app.

Therefore i decided to dig into the code and see if I could fix it myself.

The good news : visually, it works :)

See screenshot here : http://www.mediafire.com/imageview.php?quickkey=txhv7jaa6n5&thumb=4

The bad news (not really unexpected given my inexperience) : i sort of broken event handling. Mouse and keboard events are no more always received

Now my questions :
* Would that kind of patch interest you if done properly?
* I am trying to do it in a stupid way?
* If not, do you have any clue where i broke event handling?

current diff ==> http://pastebin.com/m73639f65

thank you

I think it would be nice to

I think it would be nice to get real utility windows, so work in this area is appreciated!

I started looking at the patch but there seems to be a lot of unneeded changes of variable names etc, which makes reviewing really hard. If you could produce a patch with only the relevant changes, that would be great.

Actually there's very little

Actually there's very little irrelevant changes (only the splash screen patch that's already on bugzilla)

The variable name changes were sort of necessary, because since the class no more derives from NSWindow, but instead includes it as a member variable, it is now necessary to keep a clear difference between the gdk-window and the ns-window (it used to be 'self' and 'window'. Now that they are both member variables I need different names - i picked 'window' and 'gdkwindow'. hence why most references to 'window' have been changed to 'gdkwindow'). Still if that annoys you i could change it, but of course i can't name them all 'window', i'll have to change some names at some point or there will be conflicts :)

The main problem is that in Cocoa, utility windows do not seem to be a style flag, like in GTK+, but instead are a totally different class. Therefore if we want these windows in, deriving from NSWindow is no more posible (unless there is some ObjC dark magic i don't know about). That's why i moved NSWindow to a member NSWindow*. I also added a member NSPanel*. Therefore, depending on what type of window is requested, either NSWindow* or NSPanel* is instanciated (since NSPanel is a subclass of NSWindow, the NSWindow* pointer is always set)

Ah, right. Thanks for the

Ah, right. Thanks for the clarification. I'll try to take a look at the patch as soon as possible and think about the general approach.

The ideal solution here

The ideal solution here would probably be something along the lines of your patch, but I wonder if we should try a middle road first, i.e. trying to get normal NSWindows working in a "tool window way". Or at least start out with listing what we want to achieve. The whole style mask/window hint/window type mess could need some serious cleanup before we start adding more functionality.

trying to get normal

trying to get normal NSWindows working in a "tool window way"

You know Cocoa much better than i do; From my search in the Apple docs, I could not find any mention that this was possible, but you may give it a try, you may find/know something I didn't.

The whole style mask/window hint/window type mess could need some serious cleanup before we start adding more functionality.

Very likely - i'm not sure i can do that though since i'm still rather new to the GTK-quartz codebase. I'd rather leave that to you then

Anyway, if there's any

Anyway, if there's any chance my patch could be useful, we should put it somewhere else (bug tracker?), the pastebin won't live forever