Make sure the XYWindow doesn't respond to our toggle modifiers.

This commit is contained in:
Marco Cawthorne 2021-10-31 22:16:34 +01:00
parent 9152440420
commit 7d04f846c6
Signed by: eukara
GPG key ID: C196CD8BA993248A
2 changed files with 17 additions and 2 deletions

View file

@ -173,3 +173,18 @@ ModifierFlags modifiers_for_state(unsigned int state)
}
return modifiers;
}
ModifierFlags modifiers_for_key(unsigned int state)
{
ModifierFlags modifiers = c_modifierNone;
if (state & GDK_CONTROL_MASK) {
modifiers |= c_modifierShift;
}
if (state & GDK_SHIFT_MASK) {
modifiers |= c_modifierControl;
}
if (state & GDK_MOD1_MASK) {
modifiers |= c_modifierAlt;
}
return modifiers;
}

View file

@ -740,7 +740,7 @@ bool XYWnd::chaseMouseMotion(int pointx, int pointy)
// =============================================================================
// XYWnd class
Shader *XYWnd::m_state_selected = 0;
ModifierFlags modifiers_for_key(unsigned int state);
void xy_update_xor_rectangle(XYWnd &self, rect_t area)
{
if (self.GetWidget().visible()) {
@ -756,7 +756,7 @@ gboolean xywnd_button_press(ui::Widget widget, GdkEventButton *event, XYWnd *xyw
xywnd->ButtonState_onMouseDown(buttons_for_event_button(event));
xywnd->onMouseDown(WindowVector(event->x, event->y), button_for_button(event->button),
modifiers_for_state(event->state));
modifiers_for_key(event->state));
}
return FALSE;
}