调整设置壁纸函数参数
This commit is contained in:
10
src/main.c
10
src/main.c
@@ -24,7 +24,7 @@ static void init_monitors(void);
|
|||||||
static char **get_monitor_tags(uint32_t monitor_count, uint32_t monitor_index);
|
static char **get_monitor_tags(uint32_t monitor_count, uint32_t monitor_index);
|
||||||
static void init_wallpaper(void);
|
static void init_wallpaper(void);
|
||||||
static gboolean update_wallpaper(gpointer user_data);
|
static gboolean update_wallpaper(gpointer user_data);
|
||||||
static void set_wallpaper_by_index(uint32_t index);
|
static void set_wallpaper_by_index(uint32_t index, wallpaper_config_t *config);
|
||||||
static wallpaper_config_t *parse_wallpaper_config(void);
|
static wallpaper_config_t *parse_wallpaper_config(void);
|
||||||
static void free_wallpaper_config(wallpaper_config_t *wallpaper_config);
|
static void free_wallpaper_config(wallpaper_config_t *wallpaper_config);
|
||||||
static void init_color_set(void);
|
static void init_color_set(void);
|
||||||
@@ -250,7 +250,7 @@ gboolean update_wallpaper(gpointer user_data) {
|
|||||||
if (!wc) return false;
|
if (!wc) return false;
|
||||||
|
|
||||||
static uint32_t index = 0;
|
static uint32_t index = 0;
|
||||||
set_wallpaper_by_index(index);
|
set_wallpaper_by_index(index, wc);
|
||||||
uint32_t monitor_count = 0;
|
uint32_t monitor_count = 0;
|
||||||
for (monitor_t *m = monitors; m; m = m->next) monitor_count++;
|
for (monitor_t *m = monitors; m; m = m->next) monitor_count++;
|
||||||
|
|
||||||
@@ -265,12 +265,12 @@ gboolean update_wallpaper(gpointer user_data) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_wallpaper_by_index(uint32_t index) {
|
void set_wallpaper_by_index(uint32_t index, wallpaper_config_t *config) {
|
||||||
if (!wallpaper_config) return;
|
if (!config) return;
|
||||||
|
|
||||||
rect_size_t *screen_size = get_screen_size();
|
rect_size_t *screen_size = get_screen_size();
|
||||||
uint32_t *wallpaper = generate_wallpaper(
|
uint32_t *wallpaper = generate_wallpaper(
|
||||||
wallpaper_config, monitors, index, screen_size->width, screen_size->height);
|
config, monitors, index, screen_size->width, screen_size->height);
|
||||||
|
|
||||||
if (wallpaper) {
|
if (wallpaper) {
|
||||||
double start = get_time();
|
double start = get_time();
|
||||||
|
|||||||
Reference in New Issue
Block a user