Commit dd3d9ab3 authored by Jehan's avatar Jehan

app: make sure we reset tool modifier state before saving options.

I had this funny behavior when I was quitting GIMP with the active tool
using modifiers (for instance bucket fill). Each time I'd quit with
ctrl-q (and if the image is not dirty), the options would use the value
from the modifier state and be saved as-is. Hence at next restart, the
default value was always different!
parent 5a4754f3
......@@ -45,6 +45,8 @@
#include "display/gimpstatusbar.h"
#include "tools/gimp-tools.h"
#include "tools/gimptool.h"
#include "tools/tool_manager.h"
#include "widgets/gimpaction-history.h"
#include "widgets/gimpclipboard.h"
......@@ -694,7 +696,8 @@ static gboolean
gui_exit_callback (Gimp *gimp,
gboolean force)
{
GimpGuiConfig *gui_config = GIMP_GUI_CONFIG (gimp->config);
GimpGuiConfig *gui_config = GIMP_GUI_CONFIG (gimp->config);
GimpTool *active_tool;
if (gimp->be_verbose)
g_print ("EXIT: %s\n", G_STRFUNC);
......@@ -723,6 +726,15 @@ gui_exit_callback (Gimp *gimp,
gui_unique_exit ();
/* If any modifier is set when quitting (typically when exiting with
* Ctrl-q for instance!), when serializing the tool options, it will
* save any alternate value instead of the main one. Make sure that
* any modifier is reset before saving options.
*/
active_tool = tool_manager_get_active (gimp);
if (active_tool && active_tool->focus_display)
gimp_tool_set_modifier_state (active_tool, 0, active_tool->focus_display);
if (gui_config->save_session_info)
session_save (gimp, FALSE);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment