Bug 732072: Image windows created by script-fu plug-ins...

are opened behind the previously focused Image Window

libgimp/gimpui.c bypasses gtk in setting the transient_for
property and so it is not possible to call
gtk_set_transient_for (dialog, NULL), but it is necessary
to go directly to the gdk level.
This commit is contained in:
Massimo Valentini 2014-08-21 12:43:51 +02:00
parent dfd2998e60
commit 51d3498cd4
1 changed files with 17 additions and 0 deletions

View File

@ -718,6 +718,16 @@ script_fu_brush_callback (gpointer data,
brush->paint_mode = paint_mode;
}
static void
unset_transient_for (GtkWidget *dialog)
{
GdkWindow *window = gtk_widget_get_window (dialog);
if (window)
gdk_property_delete (window,
gdk_atom_intern_static_string ("WM_TRANSIENT_FOR"));
}
static void
script_fu_response (GtkWidget *widget,
gint response_id,
@ -747,6 +757,13 @@ script_fu_response (GtkWidget *widget,
while (g_main_context_pending (NULL))
g_main_context_iteration (NULL, TRUE);
#endif
/*
* The script could have created a new GimpImageWindow, so
* unset the transient-for property not to focus the
* ImageWindow from which the script was started
*/
unset_transient_for (sf_interface->dialog);
gtk_widget_destroy (sf_interface->dialog);
break;