Skip to content

Commit

Permalink
Color picker : fix GUI interaction in darkroom
Browse files Browse the repository at this point in the history
Commit user input on mouse_moved and button_pressed, not on button_pushed.

That's a perk of the new API.
  • Loading branch information
aurelienpierre committed Dec 5, 2023
1 parent a0aa9cb commit 96f0d97
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/views/darkroom.c
Original file line number Diff line number Diff line change
Expand Up @@ -2940,7 +2940,9 @@ void mouse_moved(dt_view_t *self, double x, double y, double pressure, int which
dev->preview_status = DT_DEV_PIXELPIPE_DIRTY;
}
}
dt_dev_invalidate_preview(dev);
dt_control_queue_redraw_center();
dt_dev_refresh_ui_images(dev);
return;
}
x += offx;
Expand Down Expand Up @@ -3001,6 +3003,10 @@ int button_released(dt_view_t *self, double x, double y, int which, uint32_t sta
dt_control_queue_redraw_center();
dt_control_change_cursor(GDK_LEFT_PTR);
}
dt_control_queue_redraw_center();
dt_control_navigation_redraw();
dt_dev_invalidate_preview(dev);
dt_dev_refresh_ui_images(dev);
return 1;
}
// masks
Expand All @@ -3011,6 +3017,10 @@ int button_released(dt_view_t *self, double x, double y, int which, uint32_t sta
handled = dev->gui_module->button_released(dev->gui_module, x, y, which, state);
if(handled) return handled;
if(which == 1) dt_control_change_cursor(GDK_LEFT_PTR);
dt_control_queue_redraw_center();
dt_control_navigation_redraw();
dt_dev_invalidate_preview(dev);
dt_dev_refresh_ui_images(dev);
return 1;
}

Expand Down Expand Up @@ -3220,9 +3230,6 @@ int button_pressed(dt_view_t *self, double x, double y, double pressure, int whi
dt_control_set_dev_zoom_x(zoom_x);
dt_control_set_dev_zoom_y(zoom_y);
dt_control_queue_redraw_center();
dt_control_navigation_redraw();
dt_dev_invalidate(dev);
dt_dev_refresh_ui_images(dev);
return 1;
}
return 0;
Expand Down

0 comments on commit 96f0d97

Please sign in to comment.