Skip to content

Commit e667bb8

Browse files
committed
build: Bring back compatibility with XApp 1.9.0
Dark Mode Manager is only a nice-to-have feature, not necessary. This allows us to backport master versions of xreader to older releases which ship xapp < 2.5.0.
1 parent 28ee72c commit e667bb8

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

‎debian/control‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Build-Depends: debhelper-compat (= 12),
1919
libsm-dev,
2020
libspectre-dev,
2121
libtiff-dev,
22-
libxapp-dev (>= 2.5.0),
22+
libxapp-dev (>= 1.9.0),
2323
libx11-dev,
2424
libxml2-dev,
2525
lsb-release,

‎meson.build‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ gtk_api_version = '3.0'
4949
gtk = dependency('gtk+-' + gtk_api_version, version: '>= ' + gtk_version)
5050
ice = dependency('ice')
5151
sm = dependency('sm')
52-
xapp = dependency('xapp', version: '>= 2.5.0')
52+
xapp = dependency('xapp', version: '>= 1.9.0')
53+
if xapp.version().version_compare('>= 2.6.0')
54+
xreader_conf.set('HAVE_XAPP_DARK_MODE_MANAGER', 1)
55+
endif
5356
xml = dependency('libxml-2.0', version: '>= 2.5.0')
5457
zlib = dependency('zlib')
5558
libsecret = dependency('libsecret-1', version: '>= 0.5', required: get_option('keyring'))

‎shell/ev-application.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ struct _EvApplication {
6060
guint scr_saver_cookie;
6161
EggSMClient *smclient;
6262

63+
#ifdef HAVE_XAPP_DARK_MODE_MANAGER
6364
XAppDarkModeManager *dark_mode_manager;
65+
#endif
6466
};
6567

6668
struct _EvApplicationClass {
@@ -902,9 +904,11 @@ ev_application_shutdown (GApplication *gapplication)
902904
g_free (application->dot_dir);
903905
application->dot_dir = NULL;
904906

907+
#ifdef HAVE_XAPP_DARK_MODE_MANAGER
905908
if (application->dark_mode_manager) {
906909
g_clear_object (&application->dark_mode_manager);
907910
}
911+
#endif
908912

909913
g_clear_pointer (&supported_mimetypes, g_strfreev);
910914

@@ -1014,12 +1018,14 @@ ev_application_init (EvApplication *ev_application)
10141018

10151019
parse_mimetypes ();
10161020

1021+
#ifdef HAVE_XAPP_DARK_MODE_MANAGER
10171022
if (g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "XFCE") != 0) {
10181023
ev_application->dark_mode_manager = xapp_dark_mode_manager_new (FALSE);
10191024
}
10201025
else {
10211026
ev_application->dark_mode_manager = NULL;
10221027
}
1028+
#endif
10231029
}
10241030

10251031
gboolean

0 commit comments

Comments
 (0)