server-main: Add quit()

This allows to exit the mainloop e.g. when signalled from gnome-session
or by a signal.
This commit is contained in:
Guido Günther
2021-03-25 16:03:57 +01:00
parent 3cdced0c0c
commit e800a88893

View File

@ -50,9 +50,16 @@ struct squeekboard {
};
GMainLoop *loop;
static gboolean opt_system = FALSE;
static gchar *opt_address = NULL;
static void
quit (void)
{
g_main_loop_quit (loop);
}
// D-Bus
static void
@ -307,8 +314,7 @@ main (int argc, char **argv)
session_register();
GMainLoop *loop = g_main_loop_new (NULL, FALSE);
loop = g_main_loop_new (NULL, FALSE);
g_main_loop_run (loop);
if (connection) {