Skip to content

Commit

Permalink
wip: label
Browse files Browse the repository at this point in the history
  • Loading branch information
dcz committed Jun 27, 2024
1 parent 2767f75 commit 6f77348
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion portal-test/gtk3/portal-test-win.c
Original file line number Diff line number Diff line change
Expand Up @@ -719,12 +719,21 @@ capture_input_release (GtkButton *button,
}


static void
globalshortcuts_activated (XdpGlobalShortcutsSession *session,
const char *shortcut_id,
guint timestamp,
gpointer user_data)
{
GtkLabel *label = GTK_LABEL (user_data);
gtk_label_set_text(label, shortcut_id);
}

static void
globalshortcuts_bind_done (GObject *source,
GAsyncResult *result,
gpointer data)
{
XdpPortal *portal = XDP_PORTAL (source);
PortalTestWin *win = data;
g_autoptr(GError) error = NULL;
g_autoptr (GString) s = NULL;
Expand All @@ -746,6 +755,8 @@ globalshortcuts_bind_done (GObject *source,
g_string_append_printf (s, "%s: %s ", shortcut.name, shortcut.trigger_description);
}
gtk_label_set_label (GTK_LABEL (win->globalshortcuts_activations), s->str);

g_signal_connect (session, "activated", G_CALLBACK (globalshortcuts_activated), win->globalshortcuts_activations);
}

static void
Expand Down

0 comments on commit 6f77348

Please sign in to comment.