Modified flag checks to avoid invalid flag sets.
@@ -394,30 +394,29 @@ BOOL xf_generic_ButtonEvent(xfContext* xfc, int x, int y, int button,
input = xfc->context.input;
if (flags != 0)
+ {
+ if (flags & (PTR_FLAGS_WHEEL | PTR_FLAGS_HWHEEL))
+ {
+ if (down)
+ freerdp_input_send_mouse_event(input, flags, 0, 0);
+ }
+ else
{
BOOL extended = FALSE;
- if (flags & (PTR_XFLAGS_BUTTON1 | PTR_XFLAGS_BUTTON1))
+ if (flags & (PTR_XFLAGS_BUTTON1 | PTR_XFLAGS_BUTTON2))
{
extended = TRUE;
if (down)
flags |= PTR_XFLAGS_DOWN;
}
-
- if (flags & (PTR_FLAGS_BUTTON1 | PTR_FLAGS_BUTTON2 | PTR_FLAGS_BUTTON3))
+ else 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)
- freerdp_input_send_mouse_event(input, flags, 0, 0);
- }
- else
- {
if (app)
{
/* make sure window exists */
