winemac: Tell Wine when Cocoa has brought a window to the front.
This commit is contained in:
parent
9779f0ace4
commit
c043587d56
@ -1629,8 +1629,12 @@ int macdrv_err_on;
|
|||||||
|
|
||||||
macdrv_release_event(event);
|
macdrv_release_event(event);
|
||||||
}
|
}
|
||||||
else if (broughtWindowForward && ![window isKeyWindow])
|
else if (broughtWindowForward)
|
||||||
[self windowGotFocus:window];
|
{
|
||||||
|
[[window ancestorWineWindow] postBroughtForwardEvent];
|
||||||
|
if (![window isKeyWindow])
|
||||||
|
[self windowGotFocus:window];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Since mouse button events deliver absolute cursor position, the
|
// Since mouse button events deliver absolute cursor position, the
|
||||||
|
@ -73,5 +73,8 @@
|
|||||||
- (void) updateFullscreen;
|
- (void) updateFullscreen;
|
||||||
|
|
||||||
- (void) postKeyEvent:(NSEvent *)theEvent;
|
- (void) postKeyEvent:(NSEvent *)theEvent;
|
||||||
|
- (void) postBroughtForwardEvent;
|
||||||
|
|
||||||
|
- (WineWindow*) ancestorWineWindow;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -1268,6 +1268,27 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (WineWindow*) ancestorWineWindow
|
||||||
|
{
|
||||||
|
WineWindow* ancestor = self;
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
WineWindow* parent = (WineWindow*)[ancestor parentWindow];
|
||||||
|
if ([parent isKindOfClass:[WineWindow class]])
|
||||||
|
ancestor = parent;
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return ancestor;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) postBroughtForwardEvent
|
||||||
|
{
|
||||||
|
macdrv_event* event = macdrv_create_event(WINDOW_BROUGHT_FORWARD, self);
|
||||||
|
[queue postEvent:event];
|
||||||
|
macdrv_release_event(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ---------- NSWindow method overrides ----------
|
* ---------- NSWindow method overrides ----------
|
||||||
@ -1313,12 +1334,13 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
|
|||||||
/* We don't call this. It's the action method of the items in the Window menu. */
|
/* We don't call this. It's the action method of the items in the Window menu. */
|
||||||
- (void) makeKeyAndOrderFront:(id)sender
|
- (void) makeKeyAndOrderFront:(id)sender
|
||||||
{
|
{
|
||||||
if (![self isKeyWindow] && !self.disabled && !self.noActivate)
|
|
||||||
[[WineApplicationController sharedController] windowGotFocus:self];
|
|
||||||
|
|
||||||
if ([self isMiniaturized])
|
if ([self isMiniaturized])
|
||||||
[self deminiaturize:nil];
|
[self deminiaturize:nil];
|
||||||
[self orderBelow:nil orAbove:nil activate:NO];
|
[self orderBelow:nil orAbove:nil activate:NO];
|
||||||
|
[[self ancestorWineWindow] postBroughtForwardEvent];
|
||||||
|
|
||||||
|
if (![self isKeyWindow] && !self.disabled && !self.noActivate)
|
||||||
|
[[WineApplicationController sharedController] windowGotFocus:self];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) sendEvent:(NSEvent*)event
|
- (void) sendEvent:(NSEvent*)event
|
||||||
@ -1480,6 +1502,9 @@ static inline void fix_generic_modifiers_by_device(NSUInteger* modifiers)
|
|||||||
[controller updateFullscreenWindows];
|
[controller updateFullscreenWindows];
|
||||||
[controller adjustWindowLevels];
|
[controller adjustWindowLevels];
|
||||||
|
|
||||||
|
if (![self parentWindow])
|
||||||
|
[self postBroughtForwardEvent];
|
||||||
|
|
||||||
if (!self.disabled && !self.noActivate)
|
if (!self.disabled && !self.noActivate)
|
||||||
{
|
{
|
||||||
causing_becomeKeyWindow = self;
|
causing_becomeKeyWindow = self;
|
||||||
|
@ -48,6 +48,7 @@ static const char *dbgstr_event(int type)
|
|||||||
"RELEASE_CAPTURE",
|
"RELEASE_CAPTURE",
|
||||||
"STATUS_ITEM_MOUSE_BUTTON",
|
"STATUS_ITEM_MOUSE_BUTTON",
|
||||||
"STATUS_ITEM_MOUSE_MOVE",
|
"STATUS_ITEM_MOUSE_MOVE",
|
||||||
|
"WINDOW_BROUGHT_FORWARD",
|
||||||
"WINDOW_CLOSE_REQUESTED",
|
"WINDOW_CLOSE_REQUESTED",
|
||||||
"WINDOW_DID_UNMINIMIZE",
|
"WINDOW_DID_UNMINIMIZE",
|
||||||
"WINDOW_FRAME_CHANGED",
|
"WINDOW_FRAME_CHANGED",
|
||||||
@ -111,6 +112,7 @@ static macdrv_event_mask get_event_mask(DWORD mask)
|
|||||||
{
|
{
|
||||||
event_mask |= event_mask_for_type(QUERY_EVENT);
|
event_mask |= event_mask_for_type(QUERY_EVENT);
|
||||||
event_mask |= event_mask_for_type(RELEASE_CAPTURE);
|
event_mask |= event_mask_for_type(RELEASE_CAPTURE);
|
||||||
|
event_mask |= event_mask_for_type(WINDOW_BROUGHT_FORWARD);
|
||||||
event_mask |= event_mask_for_type(WINDOW_MINIMIZE_REQUESTED);
|
event_mask |= event_mask_for_type(WINDOW_MINIMIZE_REQUESTED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,6 +236,9 @@ void macdrv_handle_event(const macdrv_event *event)
|
|||||||
case STATUS_ITEM_MOUSE_MOVE:
|
case STATUS_ITEM_MOUSE_MOVE:
|
||||||
macdrv_status_item_mouse_move(event);
|
macdrv_status_item_mouse_move(event);
|
||||||
break;
|
break;
|
||||||
|
case WINDOW_BROUGHT_FORWARD:
|
||||||
|
macdrv_window_brought_forward(hwnd);
|
||||||
|
break;
|
||||||
case WINDOW_CLOSE_REQUESTED:
|
case WINDOW_CLOSE_REQUESTED:
|
||||||
macdrv_window_close_requested(hwnd);
|
macdrv_window_close_requested(hwnd);
|
||||||
break;
|
break;
|
||||||
|
@ -162,6 +162,7 @@ extern void macdrv_app_deactivated(void) DECLSPEC_HIDDEN;
|
|||||||
extern void macdrv_app_quit_requested(const macdrv_event *event) DECLSPEC_HIDDEN;
|
extern void macdrv_app_quit_requested(const macdrv_event *event) DECLSPEC_HIDDEN;
|
||||||
extern void macdrv_window_minimize_requested(HWND hwnd) DECLSPEC_HIDDEN;
|
extern void macdrv_window_minimize_requested(HWND hwnd) DECLSPEC_HIDDEN;
|
||||||
extern void macdrv_window_did_unminimize(HWND hwnd) DECLSPEC_HIDDEN;
|
extern void macdrv_window_did_unminimize(HWND hwnd) DECLSPEC_HIDDEN;
|
||||||
|
extern void macdrv_window_brought_forward(HWND hwnd) DECLSPEC_HIDDEN;
|
||||||
extern BOOL query_resize_end(HWND hwnd) DECLSPEC_HIDDEN;
|
extern BOOL query_resize_end(HWND hwnd) DECLSPEC_HIDDEN;
|
||||||
extern BOOL query_resize_start(HWND hwnd) DECLSPEC_HIDDEN;
|
extern BOOL query_resize_start(HWND hwnd) DECLSPEC_HIDDEN;
|
||||||
extern BOOL query_min_max_info(HWND hwnd) DECLSPEC_HIDDEN;
|
extern BOOL query_min_max_info(HWND hwnd) DECLSPEC_HIDDEN;
|
||||||
|
@ -185,6 +185,7 @@ enum {
|
|||||||
RELEASE_CAPTURE,
|
RELEASE_CAPTURE,
|
||||||
STATUS_ITEM_MOUSE_BUTTON,
|
STATUS_ITEM_MOUSE_BUTTON,
|
||||||
STATUS_ITEM_MOUSE_MOVE,
|
STATUS_ITEM_MOUSE_MOVE,
|
||||||
|
WINDOW_BROUGHT_FORWARD,
|
||||||
WINDOW_CLOSE_REQUESTED,
|
WINDOW_CLOSE_REQUESTED,
|
||||||
WINDOW_DID_UNMINIMIZE,
|
WINDOW_DID_UNMINIMIZE,
|
||||||
WINDOW_FRAME_CHANGED,
|
WINDOW_FRAME_CHANGED,
|
||||||
|
@ -1862,6 +1862,18 @@ done:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* macdrv_window_brought_forward
|
||||||
|
*
|
||||||
|
* Handler for WINDOW_BROUGHT_FORWARD events.
|
||||||
|
*/
|
||||||
|
void macdrv_window_brought_forward(HWND hwnd)
|
||||||
|
{
|
||||||
|
TRACE("win %p\n", hwnd);
|
||||||
|
SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
struct quit_info {
|
struct quit_info {
|
||||||
HWND *wins;
|
HWND *wins;
|
||||||
UINT capacity;
|
UINT capacity;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user