Skip to content

Commit 460be19

Browse files
committed
wb: don't modify p->x, p->y in _preview_pipe_finished_callback; switch left-over gui->reset to DT_ENTER|LEAVE_GUI_UPDATE
1 parent 0708465 commit 460be19

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

src/iop/channelmixerrgb.c

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3105,31 +3105,24 @@ static void _preview_pipe_finished_callback(gpointer instance, dt_iop_module_t *
31053105
dt_iop_channelmixer_rgb_params_t *p = self->params;
31063106
if(p->illuminant == DT_ILLUMINANT_FROM_WB)
31073107
{
3108-
// The WB coefficients might have changed in the temperature module.
3109-
// We need to re-calculate the chromaticity (x, y) to update the GUI feedback.
3110-
float x = p->x;
3111-
float y = p->y;
3108+
// WB coefficients might have changed temperature.c; recalculate xy and update the GUI
3109+
float x, y;
31123110

31133111
if(find_illuminant_xy_from_wb_coeffs(&(self->dev->image_storage), self->dev->chroma.wb_coeffs, &x, &y))
31143112
{
3115-
p->x = x;
3116-
p->y = y;
3117-
3118-
darktable.gui->reset++;
3119-
// Update derived GUI widgets (CCT label, color patch)
3113+
DT_ENTER_GUI_UPDATE();
31203114
_update_approx_cct(self);
31213115
_update_illuminant_color(self);
31223116

3123-
// Update Hue/Chroma sliders to match the new coordinates
3124-
dt_aligned_pixel_t xyY = { p->x, p->y, 1.f };
3117+
dt_aligned_pixel_t xyY = { x, y, 1.f };
31253118
dt_aligned_pixel_t Lch;
31263119
dt_xyY_to_Lch(xyY, Lch);
31273120

31283121
if(Lch[1] > 0)
31293122
dt_bauhaus_slider_set(g->illum_x, rad2degf(Lch[2]));
31303123
dt_bauhaus_slider_set(g->illum_y, Lch[1]);
31313124

3132-
darktable.gui->reset--;
3125+
DT_LEAVE_GUI_UPDATE();
31333126
}
31343127
}
31353128

0 commit comments

Comments
 (0)