mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
Merge branch 'greeter-activate' into 'master'
sysprof: Always present existing window on activation See merge request GNOME/sysprof!130
This commit is contained in:
@ -42,13 +42,14 @@ static const GOptionEntry option_entries[] = {
|
||||
static void
|
||||
sysprof_application_activate (GApplication *app)
|
||||
{
|
||||
const GList *windows;
|
||||
GtkWidget *greeter;
|
||||
|
||||
g_assert (GTK_IS_APPLICATION (app));
|
||||
|
||||
for (const GList *iter = gtk_application_get_windows (GTK_APPLICATION (app));
|
||||
iter != NULL;
|
||||
iter = iter->next)
|
||||
windows = gtk_application_get_windows (GTK_APPLICATION (app));
|
||||
|
||||
for (const GList *iter = windows; iter != NULL; iter = iter->next)
|
||||
{
|
||||
if (SYSPROF_IS_WINDOW (iter->data))
|
||||
{
|
||||
@ -57,6 +58,12 @@ sysprof_application_activate (GApplication *app)
|
||||
}
|
||||
}
|
||||
|
||||
if (windows)
|
||||
{
|
||||
gtk_window_present (windows->data);
|
||||
return;
|
||||
}
|
||||
|
||||
greeter = sysprof_greeter_new ();
|
||||
gtk_application_add_window (GTK_APPLICATION (app), GTK_WINDOW (greeter));
|
||||
gtk_window_present (GTK_WINDOW (greeter));
|
||||
|
||||
Reference in New Issue
Block a user