[gimp/soc-2010-cage] Bug 565459 - newly opened images are put into the background



commit 7739d9d3f39e8298206654e6d0cea6221f6cbc4b
Author: Martin Nordholts <martinn src gnome org>
Date:   Wed Jun 23 20:17:37 2010 +0200

    Bug 565459 - newly opened images are put into the background
    
    When we are going to open new image windows, unset the transient
    window. We don't need it since we will use gdk_window_raise() to
    keep the dialog on top. And if we don't do it, then the dialog
    will pull the image window it was invoked from on top of all the
    new opened image windows, and we don't want that to happen.
    
    Patch heavily inspiried by hack from Massimo Valentini.
    
    Also add a manual test case for the fix. (I don't think there is GTK+
    API to automate it).

 app/dialogs/file-open-dialog.c |    9 +++++++++
 app/tests/manual-testcases.txt |   15 +++++++++++++++
 2 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/app/dialogs/file-open-dialog.c b/app/dialogs/file-open-dialog.c
index 8cd9c0e..c82c004 100644
--- a/app/dialogs/file-open-dialog.c
+++ b/app/dialogs/file-open-dialog.c
@@ -125,6 +125,15 @@ file_open_dialog_response (GtkWidget *open_dialog,
 
   gimp_file_dialog_set_sensitive (dialog, FALSE);
 
+  /* When we are going to open new image windows, unset the transient
+   * window. We don't need it since we will use gdk_window_raise() to
+   * keep the dialog on top. And if we don't do it, then the dialog
+   * will pull the image window it was invoked from on top of all the
+   * new opened image windows, and we don't want that to happen.
+   */
+  if (! dialog->open_as_layers)
+    gtk_window_set_transient_for (GTK_WINDOW (open_dialog), NULL);
+
   for (list = uris; list; list = g_slist_next (list))
     {
       gchar *filename = file_utils_filename_from_uri (list->data);
diff --git a/app/tests/manual-testcases.txt b/app/tests/manual-testcases.txt
new file mode 100644
index 0000000..47afdc0
--- /dev/null
+++ b/app/tests/manual-testcases.txt
@@ -0,0 +1,15 @@
+This file contains manual test cases
+------------------------------------
+
+/gimp-manual-tests/opened_image_stays_on_top
+
+  Step-by-step:
+    1. Create a new image, make the image window almost as big as the screen
+    2. From the image window menu, do File -> Open
+    3. Select an image and open it
+
+  Expected result:
+    The image is opened and is kept above the image it was opened from
+
+  Last known PASS:
+    2010-06-23



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]