launcher: Use native char type and fix formatting

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4130>
This commit is contained in:
Sebastian Wick 2024-11-12 15:28:26 +01:00
parent 8e2e986eeb
commit 15ca9a09b5
2 changed files with 21 additions and 20 deletions

View File

@ -60,15 +60,15 @@ meta_launcher_get_seat_id (MetaLauncher *launcher)
}
static gboolean
find_systemd_session (gchar **session_id,
find_systemd_session (char **session_id,
GError **error)
{
const gchar * const graphical_session_types[] = { "wayland", "x11", "mir", NULL };
const gchar * const active_states[] = { "active", "online", NULL };
g_autofree gchar *class = NULL;
g_autofree gchar *local_session_id = NULL;
g_autofree gchar *type = NULL;
g_autofree gchar *state = NULL;
const char * const graphical_session_types[] = { "wayland", "x11", "mir", NULL };
const char * const active_states[] = { "active", "online", NULL };
g_autofree char *class = NULL;
g_autofree char *local_session_id = NULL;
g_autofree char *type = NULL;
g_autofree char *state = NULL;
g_auto (GStrv) sessions = NULL;
int n_sessions;
int saved_errno;
@ -285,9 +285,9 @@ get_session_proxy (const char *fallback_session_id,
}
static MetaDBusLogin1Seat *
get_seat_proxy (gchar *seat_id,
GCancellable *cancellable,
GError **error)
get_seat_proxy (char *seat_id,
GCancellable *cancellable,
GError **error)
{
g_autofree char *seat_proxy_path = get_escaped_dbus_path ("/org/freedesktop/login1/seat", seat_id);
GDBusProxyFlags flags;
@ -335,7 +335,7 @@ on_active_changed (MetaDBusLogin1Session *session,
sync_active (self);
}
static gchar *
static char *
get_seat_id (GError **error)
{
g_autoptr (GError) local_error = NULL;

View File

@ -24,17 +24,18 @@
typedef struct _MetaLauncher MetaLauncher;
typedef struct _MetaDBusLogin1Session MetaDBusLogin1Session;
MetaLauncher *meta_launcher_new (MetaBackend *backend,
const char *session_id,
const char *custom_seat_id,
GError **error);
void meta_launcher_free (MetaLauncher *self);
MetaLauncher *meta_launcher_new (MetaBackend *backend,
const char *session_id,
const char *custom_seat_id,
GError **error);
gboolean meta_launcher_activate_vt (MetaLauncher *self,
signed char vt,
GError **error);
void meta_launcher_free (MetaLauncher *self);
const char * meta_launcher_get_seat_id (MetaLauncher *launcher);
gboolean meta_launcher_activate_vt (MetaLauncher *self,
signed char vt,
GError **error);
const char * meta_launcher_get_seat_id (MetaLauncher *launcher);
MetaDBusLogin1Session * meta_launcher_get_session_proxy (MetaLauncher *launcher);