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: Ken Thomases <ken@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7a1142035d
commit
48548812fe
|
@ -116,7 +116,6 @@ - (void) windowGotFocus:(WineWindow*)window;
|
|||
|
||||
- (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 @@ - (void) keyboardSelectionDidChange
|
|||
}
|
||||
}
|
||||
|
||||
- (void) setKeyboardType:(CGEventSourceKeyboardType)newType
|
||||
{
|
||||
if (newType != keyboardType)
|
||||
{
|
||||
keyboardType = newType;
|
||||
[self keyboardSelectionDidChange];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) enabledKeyboardInputSourcesChanged
|
||||
{
|
||||
macdrv_layout_list_needs_update = TRUE;
|
||||
|
|
|
@ -1929,15 +1929,7 @@ - (void) postKey:(uint16_t)keyCode
|
|||
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];
|
||||
|
||||
|
|
Loading…
Reference in New Issue