winemac: Implement support for WS_EX_TOPMOST windows.
This commit is contained in:
parent
9d29ea42e1
commit
429732ce1a
|
@ -26,6 +26,7 @@ @interface WineWindow : NSPanel <NSWindowDelegate>
|
|||
NSUInteger normalStyleMask;
|
||||
BOOL disabled;
|
||||
BOOL noActivate;
|
||||
BOOL floating;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue