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

winemac: Create views hidden initially and add macdrv_set_view_hidden() to change that.

parent 587bdb8d
...@@ -506,6 +506,8 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi ...@@ -506,6 +506,8 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi
- (BOOL) _hasGLDescendant - (BOOL) _hasGLDescendant
{ {
if ([self isHidden])
return NO;
if ([self hasGLContext]) if ([self hasGLContext])
return YES; return YES;
for (WineContentView* view in [self subviews]) for (WineContentView* view in [self subviews])
...@@ -624,6 +626,12 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi ...@@ -624,6 +626,12 @@ static CVReturn WineDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTi
[super willRemoveSubview:subview]; [super willRemoveSubview:subview];
} }
- (void) setHidden:(BOOL)hidden
{
[super setHidden:hidden];
[self invalidateHasGLDescendant];
}
/* /*
* ---------- NSTextInputClient methods ---------- * ---------- NSTextInputClient methods ----------
*/ */
...@@ -3221,6 +3229,7 @@ macdrv_view macdrv_create_view(macdrv_window w, CGRect rect) ...@@ -3221,6 +3229,7 @@ macdrv_view macdrv_create_view(macdrv_window w, CGRect rect)
view = [[WineContentView alloc] initWithFrame:NSRectFromCGRect(cgrect_mac_from_win(rect))]; view = [[WineContentView alloc] initWithFrame:NSRectFromCGRect(cgrect_mac_from_win(rect))];
[view setAutoresizesSubviews:NO]; [view setAutoresizesSubviews:NO];
[view setHidden:YES];
[nc addObserver:view [nc addObserver:view
selector:@selector(updateGLContexts) selector:@selector(updateGLContexts)
name:NSViewGlobalFrameDidChangeNotification name:NSViewGlobalFrameDidChangeNotification
...@@ -3355,6 +3364,21 @@ void macdrv_set_view_superview(macdrv_view v, macdrv_view s, macdrv_window w, ma ...@@ -3355,6 +3364,21 @@ void macdrv_set_view_superview(macdrv_view v, macdrv_view s, macdrv_window w, ma
} }
/*********************************************************************** /***********************************************************************
* macdrv_set_view_hidden
*/
void macdrv_set_view_hidden(macdrv_view v, int hidden)
{
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
WineContentView* view = (WineContentView*)v;
OnMainThread(^{
[view setHidden:hidden];
});
[pool release];
}
/***********************************************************************
* macdrv_add_view_opengl_context * macdrv_add_view_opengl_context
* *
* Add an OpenGL context to the list being tracked for each view. * Add an OpenGL context to the list being tracked for each view.
......
...@@ -515,6 +515,7 @@ extern macdrv_view macdrv_create_view(macdrv_window w, CGRect rect) DECLSPEC_HID ...@@ -515,6 +515,7 @@ extern macdrv_view macdrv_create_view(macdrv_window w, CGRect rect) DECLSPEC_HID
extern void macdrv_dispose_view(macdrv_view v) DECLSPEC_HIDDEN; extern void macdrv_dispose_view(macdrv_view v) DECLSPEC_HIDDEN;
extern void macdrv_set_view_frame(macdrv_view v, CGRect rect) DECLSPEC_HIDDEN; extern void macdrv_set_view_frame(macdrv_view v, CGRect rect) DECLSPEC_HIDDEN;
extern void macdrv_set_view_superview(macdrv_view v, macdrv_view s, macdrv_window w, macdrv_view p, macdrv_view n) DECLSPEC_HIDDEN; extern void macdrv_set_view_superview(macdrv_view v, macdrv_view s, macdrv_window w, macdrv_view p, macdrv_view n) DECLSPEC_HIDDEN;
extern void macdrv_set_view_hidden(macdrv_view v, int hidden) DECLSPEC_HIDDEN;
extern void macdrv_add_view_opengl_context(macdrv_view v, macdrv_opengl_context c) DECLSPEC_HIDDEN; extern void macdrv_add_view_opengl_context(macdrv_view v, macdrv_opengl_context c) DECLSPEC_HIDDEN;
extern void macdrv_remove_view_opengl_context(macdrv_view v, macdrv_opengl_context c) DECLSPEC_HIDDEN; extern void macdrv_remove_view_opengl_context(macdrv_view v, macdrv_opengl_context c) DECLSPEC_HIDDEN;
extern int macdrv_get_view_backing_size(macdrv_view v, int backing_size[2]) DECLSPEC_HIDDEN; extern int macdrv_get_view_backing_size(macdrv_view v, int backing_size[2]) DECLSPEC_HIDDEN;
......
...@@ -1606,6 +1606,7 @@ static BOOL set_win_format(struct macdrv_win_data *data, int format) ...@@ -1606,6 +1606,7 @@ static BOOL set_win_format(struct macdrv_win_data *data, int format)
WARN("failed to create GL view for window %p rect %s\n", cocoa_window, wine_dbgstr_rect(&data->gl_rect)); WARN("failed to create GL view for window %p rect %s\n", cocoa_window, wine_dbgstr_rect(&data->gl_rect));
return FALSE; return FALSE;
} }
macdrv_set_view_hidden(data->gl_view, FALSE);
TRACE("created GL view %p in window %p at %s\n", data->gl_view, cocoa_window, TRACE("created GL view %p in window %p at %s\n", data->gl_view, cocoa_window,
wine_dbgstr_rect(&data->gl_rect)); wine_dbgstr_rect(&data->gl_rect));
......
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