From e876f4b3166ed38f55d632c3f736d603d357464d Mon Sep 17 00:00:00 2001 From: hrxi Date: Tue, 9 May 2017 14:53:26 +0200 Subject: Fix a couple of warnings relating to parents of dialogs Fixes these kind of warnings: ``` (dino:): Gtk-CRITICAL **: gtk_window_set_transient_for: assertion 'parent == NULL || GTK_IS_WINDOW (parent)' failed Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged. (dino:): GLib-GObject-WARNING **: invalid cast from 'GtkPaned' to 'GtkWindow' ``` Also centers these dialogs (settings, add chat, join conversation) on top of their parent windows. --- main/src/ui/conversation_list_titlebar.vala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'main/src') diff --git a/main/src/ui/conversation_list_titlebar.vala b/main/src/ui/conversation_list_titlebar.vala index 5ef824d5..c49b43c4 100644 --- a/main/src/ui/conversation_list_titlebar.vala +++ b/main/src/ui/conversation_list_titlebar.vala @@ -23,7 +23,7 @@ public class ConversationListTitlebar : Gtk.HeaderBar { SimpleAction contacts_action = new SimpleAction("add_chat", null); contacts_action.activate.connect(() => { AddConversation.Chat.Dialog add_chat_dialog = new AddConversation.Chat.Dialog(stream_interactor); - add_chat_dialog.set_transient_for((Window) get_toplevel()); + add_chat_dialog.set_transient_for(window); add_chat_dialog.conversation_opened.connect((conversation) => conversation_opened(conversation)); add_chat_dialog.show(); }); @@ -32,7 +32,7 @@ public class ConversationListTitlebar : Gtk.HeaderBar { SimpleAction conference_action = new SimpleAction("add_conference", null); conference_action.activate.connect(() => { AddConversation.Conference.Dialog add_conference_dialog = new AddConversation.Conference.Dialog(stream_interactor); - add_conference_dialog.set_transient_for((Window) get_toplevel()); + add_conference_dialog.set_transient_for(window); add_conference_dialog.conversation_opened.connect((conversation) => conversation_opened(conversation)); add_conference_dialog.show(); }); @@ -44,4 +44,4 @@ public class ConversationListTitlebar : Gtk.HeaderBar { } } -} \ No newline at end of file +} -- cgit v1.2.3-54-g00ecf