Commit 2ee46b5c authored by Andy Vawer's avatar Andy Vawer Committed by ROOL
Browse files

Fix for menu reopen issue on Adjust click

When choosing a menu option with Adjust, menus other than the top level would be closed because the request for clipboard status via Wimp_SendMessage/Wimp_Poll interfered with the menu reopening.

Version 1.38. Tagged as 'Draw-1_38'
parent 5fef6528
......@@ -9,12 +9,12 @@
GBLS Module_ApplicationDate
GBLS Module_HelpVersion
GBLS Module_ComponentName
Module_MajorVersion SETS "1.37"
Module_Version SETA 137
Module_MajorVersion SETS "1.38"
Module_Version SETA 138
Module_MinorVersion SETS ""
Module_Date SETS "09 Nov 2019"
Module_ApplicationDate SETS "09-Nov-19"
Module_Date SETS "04 Mar 2020"
Module_ApplicationDate SETS "04-Mar-20"
Module_ComponentName SETS "Draw"
Module_FullVersion SETS "1.37"
Module_HelpVersion SETS "1.37 (09 Nov 2019)"
Module_FullVersion SETS "1.38"
Module_HelpVersion SETS "1.38 (04 Mar 2020)"
END
/* (1.37)
/* (1.38)
*
* This file is automatically maintained by srccommit, do not edit manually.
*
*/
#define Module_MajorVersion_CMHG 1.37
#define Module_MajorVersion_CMHG 1.38
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 09 Nov 2019
#define Module_Date_CMHG 04 Mar 2020
#define Module_MajorVersion "1.37"
#define Module_Version 137
#define Module_MajorVersion "1.38"
#define Module_Version 138
#define Module_MinorVersion ""
#define Module_Date "09 Nov 2019"
#define Module_Date "04 Mar 2020"
#define Module_ApplicationDate "09-Nov-19"
#define Module_ApplicationDate "04-Mar-20"
#define Module_ComponentName "Draw"
#define Module_FullVersion "1.37"
#define Module_HelpVersion "1.37 (09 Nov 2019)"
#define Module_LibraryVersionInfo "1:37"
#define Module_FullVersion "1.38"
#define Module_HelpVersion "1.38 (04 Mar 2020)"
#define Module_LibraryVersionInfo "1:38"
......@@ -587,8 +587,7 @@ static BOOL draw_clipboard_send_datarequest(wimp_eventstr *e)
switch (e->e)
{ case wimp_EACK:
if (e->data.msg.hdr.action == wimp_MDATAREQUEST)
{
/*Bounced message - no data on clipboard to paste*/
{ /*Bounced message - no data on clipboard to paste*/
return FALSE;
}
break;
......@@ -616,14 +615,23 @@ static BOOL draw_clipboard_send_datarequest(wimp_eventstr *e)
return FALSE;
}
BOOL draw_clipboard_check_paste(void)
static BOOL draw_clipboard_cached_state = FALSE;
BOOL draw_clipboard_check_paste(BOOL rerequest)
{ wimp_eventstr e;
/*See if there's anything on the clipboard for pasting*/
if (draw_owns_clipboard) return TRUE; /*Quick check*/
return draw_clipboard_send_datarequest(&e);
/*If we are allowed, request update via Wimp Message*/
/*We can't do this if we're reopening a Menu as the message reply*/
/*needs a call to Wimp_Poll which stops menu adjust clicks reopening*/
/*the menu properly*/
if (rerequest)
return (draw_clipboard_cached_state = draw_clipboard_send_datarequest (&e));
else
return draw_clipboard_cached_state;
}
void draw_clipboard_paste(diagrec *diag, viewrec *vuue)
......
......@@ -1139,7 +1139,10 @@ static BOOL select_check (int which, int code, diagrec *diag, viewrec *vuue)
case s_Select_Duplicate:
return draw_selection->indx > 0;
case s_Select_Paste:
return draw_clipboard_check_paste();
{ wimp_mousestr m;
wimpt_noerr (wimp_get_point_info (&m));
return draw_clipboard_check_paste (m.bbits == wimp_BMID);
}
case s_Select_Group:
return owner && draw_selection->indx > 1;
case s_Select_Ungroup:
......
......@@ -39,9 +39,12 @@ void draw_clipboard_claim(int claimtype);
* send a Message_DataRequest to see if anyone else has suitable
* clipboard data to paste.
*
* @param rerequest TRUE if OK to send out Wimp message requesting
* updated status, FALSE to use cached value
*
* @return 0 if no data available, 1 if there is data
*/
BOOL draw_clipboard_check_paste(void);
BOOL draw_clipboard_check_paste(BOOL rerequest);
/** @brief Release clipboard claim
......
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