Modified flag checks to avoid invalid flag sets.

This commit is contained in:
Armin Novak 2018-12-11 09:32:11 +01:00
parent 7102927548
commit 0fa9f06565
1 changed files with 15 additions and 16 deletions

View File

@ -395,22 +395,6 @@ BOOL xf_generic_ButtonEvent(xfContext* xfc, int x, int y, int button,
if (flags != 0)
{
BOOL extended = FALSE;
if (flags & (PTR_XFLAGS_BUTTON1 | PTR_XFLAGS_BUTTON1))
{
extended = TRUE;
if (down)
flags |= PTR_XFLAGS_DOWN;
}
if (flags & (PTR_FLAGS_BUTTON1 | PTR_FLAGS_BUTTON2 | PTR_FLAGS_BUTTON3))
{
if (down)
flags |= PTR_FLAGS_DOWN;
}
if (flags & (PTR_FLAGS_WHEEL | PTR_FLAGS_HWHEEL))
{
if (down)
@ -418,6 +402,21 @@ BOOL xf_generic_ButtonEvent(xfContext* xfc, int x, int y, int button,
}
else
{
BOOL extended = FALSE;
if (flags & (PTR_XFLAGS_BUTTON1 | PTR_XFLAGS_BUTTON2))
{
extended = TRUE;
if (down)
flags |= PTR_XFLAGS_DOWN;
}
else if (flags & (PTR_FLAGS_BUTTON1 | PTR_FLAGS_BUTTON2 | PTR_FLAGS_BUTTON3))
{
if (down)
flags |= PTR_FLAGS_DOWN;
}
if (app)
{
/* make sure window exists */