@@ -3860,9 +3860,7 @@ void process(dt_iop_module_t *self,
3860
3860
retouch_user_data_t usr_data = { 0 };
3861
3861
dwt_params_t * dwt_p = NULL ;
3862
3862
3863
- const int gui_active = (self -> dev ) ? (self == self -> dev -> gui_module ) : 0 ;
3864
- const gboolean display_wavelet_scale =
3865
- (g && gui_active ) ? g -> display_wavelet_scale : FALSE;
3863
+ const gboolean display_wavelet_scale = g && dt_iop_has_focus (self ) ? g -> display_wavelet_scale : FALSE;
3866
3864
3867
3865
// we will do all the clone, heal, etc on the input image,
3868
3866
// this way the source for one algorithm can be the destination from a previous one
@@ -3881,8 +3879,7 @@ void process(dt_iop_module_t *self,
3881
3879
usr_data .mask_display = FALSE;
3882
3880
usr_data .suppress_mask = (g
3883
3881
&& g -> suppress_mask
3884
- && self -> dev -> gui_attached
3885
- && (self == self -> dev -> gui_module )
3882
+ && dt_iop_has_focus (self )
3886
3883
&& (piece -> pipe == self -> dev -> full .pipe ));
3887
3884
usr_data .display_scale = p -> curr_scale ;
3888
3885
@@ -3898,8 +3895,8 @@ void process(dt_iop_module_t *self,
3898
3895
3899
3896
// check if this module should expose mask.
3900
3897
if ((piece -> pipe -> type & DT_DEV_PIXELPIPE_FULL ) && g
3901
- && (g -> mask_display || display_wavelet_scale ) && self -> dev -> gui_attached
3902
- && (self == self -> dev -> gui_module ) && (piece -> pipe == self -> dev -> full .pipe ))
3898
+ && (g -> mask_display || display_wavelet_scale )
3899
+ && dt_iop_has_focus (self ) && (piece -> pipe == self -> dev -> full .pipe ))
3903
3900
{
3904
3901
for (size_t j = 0 ; j < (size_t )roi_rt -> width * roi_rt -> height * 4 ; j += 4 )
3905
3902
in_retouch [j + 3 ] = 0.f ;
@@ -3913,7 +3910,7 @@ void process(dt_iop_module_t *self,
3913
3910
if (piece -> pipe -> type & DT_DEV_PIXELPIPE_FULL )
3914
3911
{
3915
3912
// check if the image support this number of scales
3916
- if (gui_active )
3913
+ if (dt_iop_has_focus ( self ) )
3917
3914
{
3918
3915
const int max_scales = dwt_get_max_scale (dwt_p );
3919
3916
if (dwt_p -> scales > max_scales )
@@ -4671,8 +4668,7 @@ int process_cl(dt_iop_module_t *self,
4671
4668
retouch_user_data_t usr_data = { 0 };
4672
4669
dwt_params_cl_t * dwt_p = NULL ;
4673
4670
4674
- const gboolean gui_active = (self -> dev ) ? (self == self -> dev -> gui_module ) : FALSE;
4675
- const gboolean display_wavelet_scale = g && gui_active ? g -> display_wavelet_scale : FALSE;
4671
+ const gboolean display_wavelet_scale = g && dt_iop_has_focus (self ) ? g -> display_wavelet_scale : FALSE;
4676
4672
4677
4673
// we will do all the clone, heal, etc on the input image, this way
4678
4674
// the source for one algorithm can be the destination from a
@@ -4696,8 +4692,7 @@ int process_cl(dt_iop_module_t *self,
4696
4692
usr_data .mask_display = FALSE;
4697
4693
usr_data .suppress_mask = (g
4698
4694
&& g -> suppress_mask
4699
- && self -> dev -> gui_attached
4700
- && (self == self -> dev -> gui_module )
4695
+ && dt_iop_has_focus (self )
4701
4696
&& (piece -> pipe == self -> dev -> full .pipe ));
4702
4697
usr_data .display_scale = p -> curr_scale ;
4703
4698
@@ -4718,8 +4713,7 @@ int process_cl(dt_iop_module_t *self,
4718
4713
// check if this module should expose mask.
4719
4714
if ((piece -> pipe -> type & DT_DEV_PIXELPIPE_FULL )
4720
4715
&& g && g -> mask_display
4721
- && self -> dev -> gui_attached
4722
- && (self == self -> dev -> gui_module )
4716
+ && dt_iop_has_focus (self )
4723
4717
&& (piece -> pipe == self -> dev -> full .pipe ))
4724
4718
{
4725
4719
const int kernel = gd -> kernel_retouch_clear_alpha ;
@@ -4738,7 +4732,7 @@ int process_cl(dt_iop_module_t *self,
4738
4732
if (piece -> pipe -> type & DT_DEV_PIXELPIPE_FULL )
4739
4733
{
4740
4734
// check if the image support this number of scales
4741
- if (gui_active )
4735
+ if (dt_iop_has_focus ( self ) )
4742
4736
{
4743
4737
const int max_scales = dwt_get_max_scale_cl (dwt_p );
4744
4738
if (dwt_p -> scales > max_scales )
0 commit comments