Skip to content

Commit

Permalink
session: Add an 'internal-closed' signal
Browse files Browse the repository at this point in the history
This will be emitted unconditionally, so that auxiliary session
functionality can clean up things when the session closes.
  • Loading branch information
jadahl committed Jul 13, 2023
1 parent e6f7765 commit a64d44a
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/session.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@

#include <string.h>

enum
{
INTERNAL_CLOSED,

N_SIGNALS
};

static guint signals[N_SIGNALS];

enum
{
PROP_0,
Expand Down Expand Up @@ -174,6 +183,8 @@ session_close (Session *session,

SESSION_GET_CLASS (session)->close (session);

g_signal_emit (session, signals[INTERNAL_CLOSED], 0);

if (notify_closed)
{
GVariantBuilder details_builder;
Expand Down Expand Up @@ -528,4 +539,11 @@ session_class_init (SessionClass *klass)
G_PARAM_STATIC_STRINGS);

g_object_class_install_properties (gobject_class, PROP_LAST, obj_props);

signals[INTERNAL_CLOSED] = g_signal_new ("internal-closed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
G_TYPE_NONE, 0);
}

0 comments on commit a64d44a

Please sign in to comment.