[nautilus] bookmarks-window: reset transient window and screen when presenting
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] bookmarks-window: reset transient window and screen when presenting
- Date: Tue, 24 Apr 2012 16:48:10 +0000 (UTC)
commit b6bd80c3ab94e647359ef536dd694794390b1a5e
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Tue Apr 24 12:47:25 2012 -0400
bookmarks-window: reset transient window and screen when presenting
This makes the bookmarks window play nicer when multiple windows are
involved.
src/nautilus-bookmarks-window.c | 2 --
src/nautilus-window-bookmarks.c | 21 +++++++--------------
2 files changed, 7 insertions(+), 16 deletions(-)
---
diff --git a/src/nautilus-bookmarks-window.c b/src/nautilus-bookmarks-window.c
index d994813..94c26da 100644
--- a/src/nautilus-bookmarks-window.c
+++ b/src/nautilus-bookmarks-window.c
@@ -705,9 +705,7 @@ nautilus_bookmarks_window_new (NautilusWindow *parent_window,
BOOKMARKS_WINDOW_INITIAL_HEIGHT);
gtk_window_set_application (window,
gtk_window_get_application (GTK_WINDOW (parent_window)));
- gtk_window_set_transient_for (window, GTK_WINDOW (parent_window));
gtk_window_set_destroy_with_parent (window, TRUE);
- gtk_window_set_screen (window, gtk_window_get_screen (GTK_WINDOW (window)));
g_signal_connect (window, "key-press-event",
G_CALLBACK (nautilus_bookmarks_window_key_press_event_cb), NULL);
diff --git a/src/nautilus-window-bookmarks.c b/src/nautilus-window-bookmarks.c
index 5d973b9..2de0e9b 100644
--- a/src/nautilus-window-bookmarks.c
+++ b/src/nautilus-window-bookmarks.c
@@ -99,17 +99,6 @@ show_bogus_bookmark_window (NautilusWindow *window,
g_free (detail);
}
-static GtkWindow *
-get_or_create_bookmarks_window (NautilusWindow *window)
-{
- if (bookmarks_window == NULL) {
- bookmarks_window = nautilus_bookmarks_window_new (window, window->details->bookmark_list);
- g_object_add_weak_pointer (G_OBJECT (bookmarks_window), (gpointer *) &bookmarks_window);
- }
-
- return bookmarks_window;
-}
-
/**
* add_bookmark_for_current_location
*
@@ -135,10 +124,14 @@ nautilus_window_add_bookmark_for_current_location (NautilusWindow *window)
void
nautilus_window_edit_bookmarks (NautilusWindow *window)
{
- GtkWindow *dialog;
+ if (bookmarks_window == NULL) {
+ bookmarks_window = nautilus_bookmarks_window_new (window, window->details->bookmark_list);
+ g_object_add_weak_pointer (G_OBJECT (bookmarks_window), (gpointer *) &bookmarks_window);
+ }
- dialog = get_or_create_bookmarks_window (window);
- gtk_window_present (dialog);
+ gtk_window_set_transient_for (bookmarks_window, GTK_WINDOW (window));
+ gtk_window_set_screen (GTK_WINDOW (bookmarks_window), gtk_window_get_screen (GTK_WINDOW (window)));
+ gtk_window_present (bookmarks_window);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]