[gimp] fix marking file dialogs as transient if opened from context menu

Nils Philippsen nphilipp at fedoraproject.org
Wed Nov 14 16:25:23 UTC 2012


commit cf239fe2b4b6d5e4008e4d0b670fc68ab644f314
Author: Nils Philippsen <nils at redhat.com>
Date:   Wed Nov 14 17:21:46 2012 +0100

    fix marking file dialogs as transient if opened from context menu
    
    (#835736)

 gimp-2.8.2-file-dialog-toplevel.patch |   70 +++++++++++++++++++++++++++++++++
 gimp.spec                             |    7 +++-
 2 files changed, 76 insertions(+), 1 deletions(-)
---
diff --git a/gimp-2.8.2-file-dialog-toplevel.patch b/gimp-2.8.2-file-dialog-toplevel.patch
new file mode 100644
index 0000000..b83bb35
--- /dev/null
+++ b/gimp-2.8.2-file-dialog-toplevel.patch
@@ -0,0 +1,70 @@
+From 64b9787f8c2996e915474103044062a534924f38 Mon Sep 17 00:00:00 2001
+From: Nils Philippsen <nils at redhat.com>
+Date: Wed, 14 Nov 2012 17:16:53 +0100
+Subject: [PATCH] patch: file-dialog-toplevel
+
+Squashed commit of the following:
+
+commit b46df3e435d16819f1054f412b9adc2fc404c6ec
+Author: Nils Philippsen <nils at redhat.com>
+Date:   Wed Nov 14 16:43:06 2012 +0100
+
+    app: remove check which hides conditions that should not happen
+
+    Remove a GTK_IS_WINDOW() check where this would hide parent widgets
+    being passed in that don't have a gtk toplevel. This should not happen
+    and if it does we want to know about it.
+    (cherry picked from commit f6f8079013401eecaa11e5f8bdd2688e51fd6602)
+
+commit 7f6370fb0314308a32f3db82473a1a109ba1b1ca
+Author: Nils Philippsen <nils at redhat.com>
+Date:   Wed Nov 14 16:42:05 2012 +0100
+
+    app: fix marking file dialogs as transient if opened from context menu
+
+    GimpDisplayShell isn't a GtkWindow (anymore), therefore use
+    gtk_widget_get_toplevel() to find the actual toplevel window.
+    (cherry picked from commit 1a4087bd5f1c79859fbfc417eff58f8e7783f335)
+---
+ app/actions/file-commands.c | 11 ++++-------
+ 1 file changed, 4 insertions(+), 7 deletions(-)
+
+diff --git a/app/actions/file-commands.c b/app/actions/file-commands.c
+index cbf82de..94a23a0 100644
+--- a/app/actions/file-commands.c
++++ b/app/actions/file-commands.c
+@@ -522,11 +522,8 @@ file_open_dialog_show (Gimp        *gimp,
+       gimp_file_dialog_set_open_image (GIMP_FILE_DIALOG (dialog),
+                                        image, open_as_layers);
+ 
+-      parent = gtk_widget_get_toplevel (parent);
+-
+-      if (GTK_IS_WINDOW (parent))
+-        gtk_window_set_transient_for (GTK_WINDOW (dialog),
+-                                      GTK_WINDOW (parent));
++      gtk_window_set_transient_for (GTK_WINDOW (dialog),
++                                    GTK_WINDOW (gtk_widget_get_toplevel (parent)));
+ 
+       gtk_window_present (GTK_WINDOW (dialog));
+     }
+@@ -555,7 +552,7 @@ file_save_dialog_show (Gimp        *gimp,
+       if (dialog)
+         {
+           gtk_window_set_transient_for (GTK_WINDOW (dialog),
+-                                        GTK_WINDOW (parent));
++                                        GTK_WINDOW (gtk_widget_get_toplevel (parent)));
+ 
+           g_object_set_data_full (G_OBJECT (image),
+                                   "gimp-file-save-dialog", dialog,
+@@ -606,7 +603,7 @@ file_export_dialog_show (Gimp      *gimp,
+       if (dialog)
+         {
+           gtk_window_set_transient_for (GTK_WINDOW (dialog),
+-                                        GTK_WINDOW (parent));
++                                        GTK_WINDOW (gtk_widget_get_toplevel (parent)));
+ 
+           g_object_set_data_full (G_OBJECT (image),
+                                   "gimp-file-export-dialog", dialog,
+-- 
+1.7.11.7
+
diff --git a/gimp.spec b/gimp.spec
index a49c8bb..5fce03e 100644
--- a/gimp.spec
+++ b/gimp.spec
@@ -80,7 +80,7 @@ Summary:        GNU Image Manipulation Program
 Name:           gimp
 Epoch:          2
 Version:        2.8.2
-Release:        %{?prerelprefix}3%{dotprerel}%{dotgitrev}%{?dist}
+Release:        %{?prerelprefix}4%{dotprerel}%{dotgitrev}%{?dist}
 
 # Compute some version related macros
 # Ugly hack, you need to get your quoting backslashes/percent signs straight
@@ -202,6 +202,7 @@ Patch0:         gimp-%{version}%{dashprerel}-git%{gitrev}.patch.bz2
 
 Patch1:         gimp-2.8.2-max-memsize.patch
 Patch2:         gimp-2.8.2-crop-to-selection.patch
+Patch3:         gimp-2.8.2-file-dialog-toplevel.patch
 
 %description
 GIMP (GNU Image Manipulation Program) is a powerful image composition and
@@ -289,6 +290,7 @@ EOF
 
 %patch1 -p1 -b .max-memsize
 %patch2 -p1 -b .crop-to-selection
+%patch3 -p1 -b .file-dialog-toplevel
 
 %build
 %if %{with hardening}
@@ -584,6 +586,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
 %endif
 
 %changelog
+* Wed Nov 14 2012 Nils Philippsen <nils at redhat.com> - 2:2.8.2-4
+- fix marking file dialogs as transient if opened from context menu (#835736)
+
 * Tue Nov 13 2012 Nils Philippsen <nils at redhat.com> - 2:2.8.2-3
 - don't trip over too much installed memory, reenable all tests
 - realign selection after "Crop to Selection" (#873212, fix by Michael


More information about the scm-commits mailing list