Skip to content

Commit

Permalink
launcher: Handle GApplication::activate
Browse files Browse the repository at this point in the history
GApplication warns if you do not handle activate.

For now this does nothing, typically it would focus the main window
of an application, which doesn't apply to many of Cog's platforms.

(cherry picked from commit 5976f59)
  • Loading branch information
Patrick Griffis authored and aperezdc committed Dec 13, 2023
1 parent 92d1f07 commit 1a212b0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions launcher/cog-launcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,14 @@ cog_launcher_startup(GApplication *application)
#endif
}

static void
cog_launcher_activate(GApplication *application)
{
/* GApplication warns if activate is not handled. Usually this signal will focus a
window but this doesn't apply to many of our platforms so this is a noop. */
G_APPLICATION_CLASS(cog_launcher_parent_class)->activate(application);
}

static void
cog_launcher_shutdown(GApplication *application)
{
Expand Down Expand Up @@ -1406,6 +1414,7 @@ cog_launcher_class_init(CogLauncherClass *klass)
application_class->startup = cog_launcher_startup;
application_class->shutdown = cog_launcher_shutdown;
application_class->handle_local_options = cog_launcher_handle_local_options;
application_class->activate = cog_launcher_activate;

g_object_class_install_property(object_class,
PROP_AUTOMATED,
Expand Down

0 comments on commit 1a212b0

Please sign in to comment.