@@ -13,7 +13,7 @@ static inline bool allPropertiesSet(FFGTKResult* result)
1313 result -> font .length > 0 ;
1414}
1515
16- static inline void applyGTKSettings (FFGTKResult * result , const char * themeName , const char * iconsName , const char * fontName , const char * cursorTheme , int cursorSize )
16+ static inline void applyGTKSettings (FFGTKResult * result , const char * themeName , const char * iconsName , const char * fontName , const char * cursorTheme , int cursorSize , const char * wallpaper )
1717{
1818 if (result -> theme .length == 0 )
1919 ffStrbufAppendS (& result -> theme , themeName );
@@ -29,6 +29,9 @@ static inline void applyGTKSettings(FFGTKResult* result, const char* themeName,
2929
3030 if (result -> cursorSize .length == 0 && cursorSize > 0 )
3131 ffStrbufAppendF (& result -> cursorSize , "%i" , cursorSize );
32+
33+ if (result -> wallpaper .length == 0 )
34+ ffStrbufAppendS (& result -> wallpaper , wallpaper );
3235}
3336
3437static void detectGTKFromSettings (const FFinstance * instance , FFGTKResult * result )
@@ -40,6 +43,7 @@ static void detectGTKFromSettings(const FFinstance* instance, FFGTKResult* resul
4043 static const char * fontName = NULL ;
4144 static const char * cursorTheme = NULL ;
4245 static int cursorSize = 0 ;
46+ static const char * wallpaper = NULL ;
4347
4448 static bool init = false;
4549
@@ -48,7 +52,7 @@ static void detectGTKFromSettings(const FFinstance* instance, FFGTKResult* resul
4852 if (init )
4953 {
5054 ffThreadMutexUnlock (& mutex );
51- applyGTKSettings (result , themeName , iconsName , fontName , cursorTheme , cursorSize );
55+ applyGTKSettings (result , themeName , iconsName , fontName , cursorTheme , cursorSize , wallpaper );
5256 return ;
5357 }
5458
@@ -90,10 +94,12 @@ static void detectGTKFromSettings(const FFinstance* instance, FFGTKResult* resul
9094 fontName = ffSettingsGet (instance , "/org/gnome/desktop/interface/font-name" , "org.gnome.desktop.interface" , NULL , "font-name" , FF_VARIANT_TYPE_STRING ).strValue ;
9195 cursorTheme = ffSettingsGet (instance , "/org/gnome/desktop/interface/cursor-theme" , "org.gnome.desktop.interface" , NULL , "cursor-theme" , FF_VARIANT_TYPE_STRING ).strValue ;
9296 cursorSize = ffSettingsGet (instance , "/org/gnome/desktop/interface/cursor-size" , "org.gnome.desktop.interface" , NULL , "cursor-size" , FF_VARIANT_TYPE_INT ).intValue ;
97+ wallpaper = ffSettingsGet (instance , "/org/gnome/desktop/background/picture-uri" , "org.gnome.desktop.background" , NULL , "picture-uri" , FF_VARIANT_TYPE_STRING ).strValue ;
98+ // TODO: support other DEs for wallpaper
9399 }
94100
95101 ffThreadMutexUnlock (& mutex );
96- applyGTKSettings (result , themeName , iconsName , fontName , cursorTheme , cursorSize );
102+ applyGTKSettings (result , themeName , iconsName , fontName , cursorTheme , cursorSize , wallpaper );
97103}
98104
99105static void detectGTKFromConfigFile (const char * filename , FFGTKResult * result )
@@ -184,6 +190,7 @@ static void detectGTK(const FFinstance* instance, const char* version, FFGTKResu
184190 ffStrbufInit(&result.font); \
185191 ffStrbufInit(&result.cursor); \
186192 ffStrbufInit(&result.cursorSize); \
193+ ffStrbufInit(&result.wallpaper); \
187194 detectGTK(instance, #version, &result); \
188195 ffThreadMutexUnlock(&mutex); \
189196 return &result;
0 commit comments