Skip to content

Commit 8eb0714

Browse files
Include libportal and reproduce bug
Demonstrate bug for flatpak/libportal#199
1 parent 1d93e68 commit 8eb0714

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

page.tesk.SettingsNotIncluded.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,24 @@
2323
"*.a"
2424
],
2525
"modules" : [
26+
{
27+
"name": "libportal",
28+
"buildsystem": "meson",
29+
"config-opts": [
30+
"-Dtests=false",
31+
"-Dbackend-gtk3=disabled",
32+
"-Dbackend-gtk4=enabled",
33+
"-Dbackend-qt5=disabled",
34+
"-Ddocs=false"
35+
],
36+
"sources": [
37+
{
38+
"type": "archive",
39+
"url": "https://github.com/flatpak/libportal/releases/download/0.9.1/libportal-0.9.1.tar.xz",
40+
"sha256": "de801ee349ed3c255a9af3c01b1a401fab5b3fc1c35eb2fd7dfb35d4b8194d7f"
41+
}
42+
]
43+
},
2644
{
2745
"name" : "settingsnotincluded",
2846
"builddir" : true,

src/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ settingsnotincluded_sources = [
66

77
settingsnotincluded_deps = [
88
dependency('gtk4'),
9+
dependency('libportal-gtk4'),
910
]
1011

1112
settingsnotincluded_sources += gnome.compile_resources('settingsnotincluded-resources',

src/settingsnotincluded-application.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,18 @@
2020

2121
#include "config.h"
2222
#include <glib/gi18n.h>
23+
#include <libportal/portal.h>
24+
25+
/* FIXME: Commented out to demonstrate reproducer */
26+
/* #include <libportal/settings.h> */
2327

2428
#include "settingsnotincluded-application.h"
2529
#include "settingsnotincluded-window.h"
2630

2731
struct _SettingsnotincludedApplication
2832
{
2933
GtkApplication parent_instance;
34+
XdpPortal *portal;
3035
};
3136

3237
G_DEFINE_FINAL_TYPE (SettingsnotincludedApplication, settingsnotincluded_application, GTK_TYPE_APPLICATION)
@@ -112,12 +117,20 @@ static const GActionEntry app_actions[] = {
112117
static void
113118
settingsnotincluded_application_init (SettingsnotincludedApplication *self)
114119
{
120+
XdpSettings *settings;
121+
115122
g_action_map_add_action_entries (G_ACTION_MAP (self),
116123
app_actions,
117124
G_N_ELEMENTS (app_actions),
118125
self);
119126
gtk_application_set_accels_for_action (GTK_APPLICATION (self),
120127
"app.quit",
121128
(const char *[]){ "<primary>q", NULL });
129+
130+
self->portal = xdp_portal_new ();
131+
settings = xdp_portal_get_settings (self->portal);
132+
133+
/* FIXME: Here lies the problem */
134+
xdp_settings_read_uint (settings, "org.freedesktop.appearance", "color-scheme", NULL, NULL);
122135
}
123136

0 commit comments

Comments
 (0)