Commit 005d09c2 authored by ROOL's avatar ROOL 🤖
Browse files

Fix for flags read back being out of sync with the picker

Detail:
  SWI ColourPicker_ReadDialogue claims to return the current state (and does so for the colour) but was returning the cached copy of the flags word. Ensure this is always up to date whenever the colour is changed by copying the 'none' state into the cached flags.
Admin:
  Discovered during Toolbox Unification bounty work.
parent cea9864f
......@@ -406,6 +406,12 @@ static os_error *Colour_Changed (dialogue_list l, osbool none, osbool dragging)
os_error *error = NULL;
colourpicker_message_colour_changed *colour_changed = NULL;
/*Keep 'None' flag up to date for dialogue_read*/
if (none)
l->flags |= colourpicker_DIALOGUE_TRANSPARENT;
else
l->flags &= ~colourpicker_DIALOGUE_TRANSPARENT;
tracef ("Colour_Changed, flags are 0x%X\n" _ l->flags);
switch ((l->flags & colourpicker_DIALOGUE_TYPE) >>
colourpicker_DIALOGUE_TYPE_SHIFT)
......@@ -1683,12 +1689,6 @@ os_error *dialogue_update (bits flags, colourpicker_d d,
/*Send the relevant message.*/
if ((error = Colour_Changed (l, none, /*dragging?*/ FALSE)) != NULL)
goto finish;
/*Fix MED-xxxx: update record to reflect change. JRC 21st Dec 1994*/
if (none)
l->flags |= colourpicker_DIALOGUE_TRANSPARENT;
else
l->flags &= ~colourpicker_DIALOGUE_TRANSPARENT;
}
if ((flags & colourpicker_UPDATE_TYPE) != NONE)
......@@ -1721,38 +1721,6 @@ os_error *dialogue_update (bits flags, colourpicker_d d,
}
if ((flags & colourpicker_UPDATE_TITLE) != NONE)
#if 0
{ wimp_outline outline;
wimp_window_info info;
char *title;
if ((l->title = dialogue->title) != NULL)
title = dialogue->title;
else
{ if ((error = lookup (main_messages, "Title", (void **) &title))
!= NULL)
goto finish;
}
/*Update the window's indirected data.*/
info.w = l->main_w;
if ((error = xwimp_get_window_info_header_only (&info)) != NULL)
goto finish;
riscos_strncpy (info.title_data AS indirected_text.text,
title, info.title_data AS indirected_text.size);
/*Redraw that area of the screen.*/
outline.w = l->main_w;
if ((error = xwimp_get_window_outline (&outline)) != NULL)
goto finish;
if ((error = xwimp_force_redraw ((wimp_w) -1, outline.outline.x0,
info.visible.y1, outline.outline.x1, outline.outline.y1)) !=
NULL)
goto finish;
}
#else
{ char *title;
if ((l->title = dialogue->title) != NULL)
......@@ -1766,7 +1734,6 @@ os_error *dialogue_update (bits flags, colourpicker_d d,
if ((error = window_set_title (l->main_w, title)) != NULL)
goto finish;
}
#endif
if ((flags & colourpicker_UPDATE_COLOUR) != NONE)
{ relocate_frame frame;
......
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