core: store old config values per-monitor
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ieb3a272935892c874339b13e63b998fd6a6a6964
This commit is contained in:
parent
e7f107a8fe
commit
1a366d2445
1 changed files with 26 additions and 0 deletions
26
src/core.c
26
src/core.c
|
|
@ -103,6 +103,32 @@ static int assign_wallpaper_to_output(chroma_state_t *state,
|
||||||
// Assign image to output
|
// Assign image to output
|
||||||
output->image = image;
|
output->image = image;
|
||||||
|
|
||||||
|
// Store old configuration values for comparison
|
||||||
|
chroma_scale_mode_t old_scale_mode = output->scale_mode;
|
||||||
|
chroma_filter_quality_t old_filter_quality = output->filter_quality;
|
||||||
|
bool had_config = output->config_loaded;
|
||||||
|
|
||||||
|
// Load configuration for this output (scale mode and filter quality)
|
||||||
|
if (chroma_config_get_mapping_for_output(
|
||||||
|
&state->config, output->name ? output->name : "unknown",
|
||||||
|
&output->scale_mode, &output->filter_quality) == CHROMA_OK) {
|
||||||
|
output->config_loaded = true;
|
||||||
|
chroma_log("DEBUG", "Loaded config for output %u: scale=%d, filter=%d",
|
||||||
|
output->id, output->scale_mode, output->filter_quality);
|
||||||
|
|
||||||
|
// Check if configuration changed and invalidate texture if needed
|
||||||
|
if (had_config && (old_scale_mode != output->scale_mode ||
|
||||||
|
old_filter_quality != output->filter_quality)) {
|
||||||
|
chroma_output_invalidate_texture(output);
|
||||||
|
chroma_log("DEBUG",
|
||||||
|
"Configuration changed for output %u, invalidated texture",
|
||||||
|
output->id);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
output->config_loaded = false;
|
||||||
|
chroma_log("WARN", "Failed to load config for output %u", output->id);
|
||||||
|
}
|
||||||
|
|
||||||
// Create surface if it doesn't exist
|
// Create surface if it doesn't exist
|
||||||
if (!output->surface) {
|
if (!output->surface) {
|
||||||
int ret = chroma_surface_create(state, output);
|
int ret = chroma_surface_create(state, output);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue