From 429732ce1a4db12cfd9149bbc1c630bd9509508b Mon Sep 17 00:00:00 2001 From: Ken Thomases Date: Fri, 11 Jan 2013 06:18:55 -0600 Subject: [PATCH] winemac: Implement support for WS_EX_TOPMOST windows. --- dlls/winemac.drv/cocoa_window.h | 1 + dlls/winemac.drv/cocoa_window.m | 10 +++++++++- dlls/winemac.drv/macdrv_cocoa.h | 1 + dlls/winemac.drv/window.c | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/dlls/winemac.drv/cocoa_window.h b/dlls/winemac.drv/cocoa_window.h index 86211dd4983..41e0b903ff0 100644 --- a/dlls/winemac.drv/cocoa_window.h +++ b/dlls/winemac.drv/cocoa_window.h @@ -26,6 +26,7 @@ @interface WineWindow : NSPanel NSUInteger normalStyleMask; BOOL disabled; BOOL noActivate; + BOOL floating; } @end diff --git a/dlls/winemac.drv/cocoa_window.m b/dlls/winemac.drv/cocoa_window.m index dde77b3916a..16217c28915 100644 --- a/dlls/winemac.drv/cocoa_window.m +++ b/dlls/winemac.drv/cocoa_window.m @@ -62,6 +62,7 @@ @interface WineWindow () @property (nonatomic) BOOL disabled; @property (nonatomic) BOOL noActivate; +@property (nonatomic) BOOL floating; + (void) flipRect:(NSRect*)rect; @@ -80,7 +81,7 @@ - (BOOL) isFlipped @implementation WineWindow - @synthesize disabled, noActivate; + @synthesize disabled, noActivate, floating; + (WineWindow*) createWindowWithFeatures:(const struct macdrv_window_features*)wf windowFrame:(NSRect)window_frame @@ -147,8 +148,15 @@ - (void) setWindowFeatures:(const struct macdrv_window_features*)wf - (void) setMacDrvState:(const struct macdrv_window_state*)state { + NSInteger level; + self.disabled = state->disabled; self.noActivate = state->no_activate; + + self.floating = state->floating; + level = state->floating ? NSFloatingWindowLevel : NSNormalWindowLevel; + if (level != [self level]) + [self setLevel:level]; } /* Returns whether or not the window was ordered in, which depends on if diff --git a/dlls/winemac.drv/macdrv_cocoa.h b/dlls/winemac.drv/macdrv_cocoa.h index d91cd1a43b7..fa2e083b23f 100644 --- a/dlls/winemac.drv/macdrv_cocoa.h +++ b/dlls/winemac.drv/macdrv_cocoa.h @@ -128,6 +128,7 @@ struct macdrv_window_state { unsigned int disabled:1; unsigned int no_activate:1; + unsigned int floating:1; }; extern macdrv_window macdrv_create_cocoa_window(const struct macdrv_window_features* wf, diff --git a/dlls/winemac.drv/window.c b/dlls/winemac.drv/window.c index b813cdc2b2c..232c60ab1ab 100644 --- a/dlls/winemac.drv/window.c +++ b/dlls/winemac.drv/window.c @@ -103,6 +103,7 @@ static void get_cocoa_window_state(struct macdrv_win_data *data, memset(state, 0, sizeof(*state)); state->disabled = (style & WS_DISABLED) != 0; state->no_activate = !can_activate_window(data->hwnd); + state->floating = (ex_style & WS_EX_TOPMOST) != 0; }