[gimp] app: force the action search dialog above its parent window...
- From: Jehan Pagès <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: force the action search dialog above its parent window...
- Date: Sat, 29 Nov 2014 22:56:15 +0000 (UTC)
commit 23de02b8c2985b8b0f6c10832ce0ab2a22573919
Author: Jehan <jehan girinstud io>
Date: Sat Nov 29 23:53:18 2014 +0100
app: force the action search dialog above its parent window...
... and set it modal to prevent interaction with other GIMP windows.
app/dialogs/action-search-dialog.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/app/dialogs/action-search-dialog.c b/app/dialogs/action-search-dialog.c
index 17a6ad7..b0881f0 100644
--- a/app/dialogs/action-search-dialog.c
+++ b/app/dialogs/action-search-dialog.c
@@ -123,6 +123,10 @@ action_search_dialog_create (Gimp *gimp)
if (! private)
{
GtkWidget *action_search_dialog = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ GdkScreen *screen = gdk_screen_get_default ();
+ GdkWindow *gdk_parent = gdk_screen_get_active_window (screen);
+ gpointer parent_widget;
+ GtkWindow *parent;
GtkWidget *main_vbox;
private = g_slice_new0 (SearchDialog);
@@ -136,6 +140,15 @@ action_search_dialog_create (Gimp *gimp)
"gimp-action-search-dialog");
gtk_window_set_title (GTK_WINDOW (action_search_dialog),
_("Search Actions"));
+ gtk_window_set_modal (GTK_WINDOW (action_search_dialog), TRUE);
+ /* The user data for a GdkWindow is its associated widget. */
+ gdk_window_get_user_data (gdk_parent, &parent_widget);
+ parent = GTK_WINDOW(gtk_widget_get_toplevel (GTK_WIDGET (parent_widget)));
+ /* NOTE: gtk_window_set_keep_above() would be easier but would render
+ * the search dialog above any windows, even non-GIMP related, which
+ * some early testers found annoying.
+ * Setting it transient forces it above a single parent instead. */
+ gtk_window_set_transient_for (GTK_WINDOW (action_search_dialog), parent);
main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2);
gtk_container_add (GTK_CONTAINER (action_search_dialog), main_vbox);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]