Commit 48548812 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Move the logic for posting a KEYBOARD_CHANGED event if the keyboard…

winemac: Move the logic for posting a KEYBOARD_CHANGED event if the keyboard type changes into the setter of the keyboardType property. Signed-off-by: 's avatarKen Thomases <ken@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 7a114203
......@@ -116,7 +116,6 @@ enum {
- (BOOL) waitUntilQueryDone:(int*)done timeout:(NSDate*)timeout processEvents:(BOOL)processEvents;
- (void) keyboardSelectionDidChange;
- (void) noteKey:(uint16_t)keyCode pressed:(BOOL)pressed;
- (void) window:(WineWindow*)window isBeingDragged:(BOOL)dragged;
......
......@@ -453,6 +453,15 @@ static NSString* WineLocalizedString(unsigned int stringID)
}
}
- (void) setKeyboardType:(CGEventSourceKeyboardType)newType
{
if (newType != keyboardType)
{
keyboardType = newType;
[self keyboardSelectionDidChange];
}
}
- (void) enabledKeyboardInputSourcesChanged
{
macdrv_layout_list_needs_update = TRUE;
......
......@@ -1929,15 +1929,7 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi
event->key.time_ms = [controller ticksForEventTime:[theEvent timestamp]];
if ((cgevent = [theEvent CGEvent]))
{
CGEventSourceKeyboardType keyboardType = CGEventGetIntegerValueField(cgevent,
kCGKeyboardEventKeyboardType);
if (keyboardType != controller.keyboardType)
{
controller.keyboardType = keyboardType;
[controller keyboardSelectionDidChange];
}
}
controller.keyboardType = CGEventGetIntegerValueField(cgevent, kCGKeyboardEventKeyboardType);
[queue postEvent:event];
......
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