diff --git a/src/develop/blend.c b/src/develop/blend.c index 716edeb09844..8c12f0ea8167 100644 --- a/src/develop/blend.c +++ b/src/develop/blend.c @@ -504,9 +504,7 @@ void dt_develop_blend_process(dt_iop_module_t *self, const dt_iop_roi_t *const roi_in, const dt_iop_roi_t *const roi_out) { - if(piece->pipe->bypass_blendif - && self->dev->gui_attached - && (self == self->dev->gui_module)) + if(piece->pipe->bypass_blendif && dt_iop_has_focus(self)) return; const dt_develop_blend_params_t *const d = piece->blendop_data; @@ -545,10 +543,7 @@ void dt_develop_blend_process(dt_iop_module_t *self, return; } - const gboolean valid_request = - self->dev->gui_attached - && (self == self->dev->gui_module) - && (piece->pipe == self->dev->full.pipe); + const gboolean valid_request = dt_iop_has_focus(self) && (piece->pipe == self->dev->full.pipe); // does user want us to display a specific channel? const dt_dev_pixelpipe_display_mask_t request_mask_display = @@ -934,9 +929,7 @@ gboolean dt_develop_blend_process_cl(dt_iop_module_t *self, const dt_iop_roi_t *roi_in, const dt_iop_roi_t *roi_out) { - if(piece->pipe->bypass_blendif - && self->dev->gui_attached - && (self == self->dev->gui_module)) + if(piece->pipe->bypass_blendif && dt_iop_has_focus(self)) return TRUE; dt_develop_blend_params_t *const d = piece->blendop_data; @@ -971,10 +964,7 @@ gboolean dt_develop_blend_process_cl(dt_iop_module_t *self, // only non-zero if mask_display was set by an _earlier_ module const dt_dev_pixelpipe_display_mask_t mask_display = piece->pipe->mask_display; - const gboolean valid_request = - self->dev->gui_attached - && (self == self->dev->gui_module) - && (piece->pipe == self->dev->full.pipe); + const gboolean valid_request = dt_iop_has_focus(self) && (piece->pipe == self->dev->full.pipe); // does user want us to display a specific channel? const dt_dev_pixelpipe_display_mask_t request_mask_display = diff --git a/src/iop/colorzones.c b/src/iop/colorzones.c index 7f78185af822..64c0070df7c9 100644 --- a/src/iop/colorzones.c +++ b/src/iop/colorzones.c @@ -585,8 +585,9 @@ void process(dt_iop_module_t *self, // display selection if requested if((piece->pipe->type & DT_DEV_PIXELPIPE_FULL) && g - && g->display_mask && self->dev->gui_attached - && (self == self->dev->gui_module) && (piece->pipe == self->dev->full.pipe)) + && g->display_mask + && dt_iop_has_focus(self) + && (piece->pipe == self->dev->full.pipe)) process_display(self, piece, ivoid, ovoid, roi_in, roi_out); else if(d->mode == DT_IOP_COLORZONES_MODE_SMOOTH) process_v3(self, piece, ivoid, ovoid, roi_in, roi_out); @@ -604,7 +605,7 @@ int process_cl(dt_iop_module_t *self, dt_iop_colorzones_data_t *d = piece->data; dt_iop_colorzones_global_data_t *gd = self->global_data; cl_mem dev_L, dev_a, dev_b = NULL; - cl_int err = DT_OPENCL_DEFAULT_ERROR; + cl_int err = CL_MEM_OBJECT_ALLOCATION_FAILURE; const int devid = piece->pipe->devid; const int width = roi_in->width; diff --git a/src/iop/demosaicing/rcd.c b/src/iop/demosaicing/rcd.c index 15bf9998ca6b..9ab838c10485 100644 --- a/src/iop/demosaicing/rcd.c +++ b/src/iop/demosaicing/rcd.c @@ -582,8 +582,6 @@ static cl_int process_rcd_cl(dt_iop_module_t *self, const int width = roi_in->width; const int height = roi_in->height; - err = CL_MEM_OBJECT_ALLOCATION_FAILURE; - dev_tmp = dt_opencl_alloc_device(devid, roi_in->width, roi_in->height, sizeof(float) * 4); if(dev_tmp == NULL) goto error; diff --git a/src/iop/retouch.c b/src/iop/retouch.c index a2a5463982d4..8d408b906bb3 100644 --- a/src/iop/retouch.c +++ b/src/iop/retouch.c @@ -3870,9 +3870,7 @@ void process(dt_iop_module_t *self, retouch_user_data_t usr_data = { 0 }; dwt_params_t *dwt_p = NULL; - const int gui_active = (self->dev) ? (self == self->dev->gui_module) : 0; - const gboolean display_wavelet_scale = - (g && gui_active) ? g->display_wavelet_scale : FALSE; + const gboolean display_wavelet_scale = g && dt_iop_has_focus(self) ? g->display_wavelet_scale : FALSE; // we will do all the clone, heal, etc on the input image, // this way the source for one algorithm can be the destination from a previous one @@ -3891,8 +3889,7 @@ void process(dt_iop_module_t *self, usr_data.mask_display = FALSE; usr_data.suppress_mask = (g && g->suppress_mask - && self->dev->gui_attached - && (self == self->dev->gui_module) + && dt_iop_has_focus(self) && (piece->pipe == self->dev->full.pipe)); usr_data.display_scale = p->curr_scale; @@ -3908,8 +3905,8 @@ void process(dt_iop_module_t *self, // check if this module should expose mask. if((piece->pipe->type & DT_DEV_PIXELPIPE_FULL) && g - && (g->mask_display || display_wavelet_scale) && self->dev->gui_attached - && (self == self->dev->gui_module) && (piece->pipe == self->dev->full.pipe)) + && (g->mask_display || display_wavelet_scale) + && dt_iop_has_focus(self) && (piece->pipe == self->dev->full.pipe)) { for(size_t j = 0; j < (size_t)roi_rt->width * roi_rt->height * 4; j += 4) in_retouch[j + 3] = 0.f; @@ -3923,7 +3920,7 @@ void process(dt_iop_module_t *self, if(piece->pipe->type & DT_DEV_PIXELPIPE_FULL) { // check if the image support this number of scales - if(gui_active) + if(dt_iop_has_focus(self)) { const int max_scales = dwt_get_max_scale(dwt_p); if(dwt_p->scales > max_scales) @@ -4819,9 +4816,7 @@ int process_cl(dt_iop_module_t *self, retouch_user_data_t usr_data = { 0 }; dwt_params_cl_t *dwt_p = NULL; - const int gui_active = (self->dev) ? (self == self->dev->gui_module) : 0; - const gboolean display_wavelet_scale = - (g && gui_active) ? g->display_wavelet_scale : FALSE; + const gboolean display_wavelet_scale = g && dt_iop_has_focus(self) ? g->display_wavelet_scale : FALSE; // we will do all the clone, heal, etc on the input image, this way // the source for one algorithm can be the destination from a @@ -4851,8 +4846,7 @@ int process_cl(dt_iop_module_t *self, usr_data.mask_display = FALSE; usr_data.suppress_mask = (g && g->suppress_mask - && self->dev->gui_attached - && (self == self->dev->gui_module) + && dt_iop_has_focus(self) && (piece->pipe == self->dev->full.pipe)); usr_data.display_scale = p->curr_scale; @@ -4873,8 +4867,7 @@ int process_cl(dt_iop_module_t *self, // check if this module should expose mask. if((piece->pipe->type & DT_DEV_PIXELPIPE_FULL) && g && g->mask_display - && self->dev->gui_attached - && (self == self->dev->gui_module) + && dt_iop_has_focus(self) && (piece->pipe == self->dev->full.pipe)) { const int kernel = gd->kernel_retouch_clear_alpha; @@ -4893,7 +4886,7 @@ int process_cl(dt_iop_module_t *self, if(piece->pipe->type & DT_DEV_PIXELPIPE_FULL) { // check if the image support this number of scales - if(gui_active) + if(dt_iop_has_focus(self)) { const int max_scales = dwt_get_max_scale_cl(dwt_p); if(dwt_p->scales > max_scales)