Commit c61eb171 authored by Mohammed Sadiq's avatar Mohammed Sadiq
Browse files

purple-notify: Place dialog over the current active window

Use the current active window instead of placing on top of the main window.
The main window is not always required to be the active one.  Also avoid
the cast as the window may be NULL if no window is present
parent f401634d
......@@ -27,12 +27,14 @@ chatty_notify_message (PurpleNotifyMsgType type,
const char *primary,
const char *secondary)
ChattyWindow *window;
GtkWidget *dialog;
GtkApplication *app;
GtkWindow *window;
GtkWidget *dialog;
window = chatty_application_get_main_window (CHATTY_APPLICATION_DEFAULT ());
app = GTK_APPLICATION (g_application_get_default ());
window = gtk_application_get_active_window (app);
dialog = gtk_message_dialog_new (GTK_WINDOW(window),
dialog = gtk_message_dialog_new (window,
......@@ -51,7 +53,7 @@ chatty_notify_message (PurpleNotifyMsgType type,
gtk_window_set_transient_for (GTK_WINDOW(dialog), GTK_WINDOW(window));
gtk_window_set_transient_for (GTK_WINDOW (dialog), window);
gtk_widget_show_all (dialog);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment