That's a good tip. I agreee with you also that we need to do better with the parenting. The problem extends well beyond the file dialogs. I had just assumed that because Gnome works differently, it wasn't such an obvious problem for Linux users.


From: Ted Gould <ted@...11...>
Sent: 26 June 2007 11:17
To: bulia byak <buliabyak@...400...>
Subject: Re: [Inkscape-devel] Getting the GdkWindow in which a verb was invoked


On Tue, 2007-06-26 at 13:07 -0300, bulia byak wrote:
> > In the GTK version, sp_file_open_dialog (in file.cpp) is called from inside
> > FileVerb::Perform in verbs.cpp. But how is it possible to get the GdkWindow
> > object of the windows in which the verb was invoked?
>
> You can do SP_ACTIVE_DESKTOP, then use getToplevel to get GTK window,
> and then use ->window to get from GTK to GDK (untested!)

I don't think this is good, I'd like to see SP_ACTIVE_DESKTOP all but
removed from the codebase. When the verb is called it is passed the
information on the window that called it. That's currently not passed
into sp_file_open_dialog, but should be. (infact, very few verbs use
it, but they should).

The desktop can be gotten in any verb "perform" function with the
following code:

SPDesktop *dt = dynamic_cast(sp_action_get_view(action));

That is, if it is called on a SPDesktop and not another subclass of an
action. But I would imagine that FileOpen always is.

--Ted