Skip to content

Commit ecc8ac4

Browse files
committed
WinGUI : if mouseinterval( 0); has been called, and/or click events are not enabled for a particular mouse button, then return mouse button presses immediately; don't queue them and wait for a corresponding button release. From issue #330.
1 parent de6c742 commit ecc8ac4

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

wingui/pdcscrn.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,6 +1667,8 @@ static void add_mouse_event_to_queue( const int button, const int action,
16671667
has been; two if pressed/released (clicked); three if clicked and
16681668
pressed again... all the way up to six if it's been triple-clicked. */
16691669

1670+
#define BUTTON_N_CLICKED(N) PDC_SHIFTED_BUTTON( BUTTON1_CLICKED, (N))
1671+
16701672
static int add_mouse( int button, const int action, const int x, const int y)
16711673
{
16721674
bool flush_events_to_queue = (button == -1 || action == BUTTON_MOVED);
@@ -1694,6 +1696,10 @@ static int add_mouse( int button, const int action, const int x, const int y)
16941696
{
16951697
mouse_state |= (1 << button);
16961698
button_count[button - 1]++;
1699+
if( !SP->mouse_wait)
1700+
flush_events_to_queue = TRUE;
1701+
if( !(SP->_trap_mbe & BUTTON_N_CLICKED( button)))
1702+
flush_events_to_queue = TRUE;
16971703
}
16981704
if( button >= 0)
16991705
{

0 commit comments

Comments
 (0)