winemac: Change macdrv_create_view() to not add the new view to a window's content view.
Callers can use macdrv_set_view_superview() to do that separately. Signed-off-by: Ken Thomases <ken@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ca49b8070c
commit
eef99122f7
@ -3212,14 +3212,13 @@ void macdrv_set_window_min_max_sizes(macdrv_window w, CGSize min_size, CGSize ma
|
|||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* macdrv_create_view
|
* macdrv_create_view
|
||||||
*
|
*
|
||||||
* Creates and returns a view in the specified rect of the window. The
|
* Creates and returns a view with the specified frame rect. The
|
||||||
* caller is responsible for calling macdrv_dispose_view() on the view
|
* caller is responsible for calling macdrv_dispose_view() on the view
|
||||||
* when it is done with it.
|
* when it is done with it.
|
||||||
*/
|
*/
|
||||||
macdrv_view macdrv_create_view(macdrv_window w, CGRect rect)
|
macdrv_view macdrv_create_view(CGRect rect)
|
||||||
{
|
{
|
||||||
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
|
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
|
||||||
WineWindow* window = (WineWindow*)w;
|
|
||||||
__block WineContentView* view;
|
__block WineContentView* view;
|
||||||
|
|
||||||
if (CGRectIsNull(rect)) rect = CGRectZero;
|
if (CGRectIsNull(rect)) rect = CGRectZero;
|
||||||
@ -3238,8 +3237,6 @@ macdrv_view macdrv_create_view(macdrv_window w, CGRect rect)
|
|||||||
selector:@selector(updateGLContexts)
|
selector:@selector(updateGLContexts)
|
||||||
name:NSApplicationDidChangeScreenParametersNotification
|
name:NSApplicationDidChangeScreenParametersNotification
|
||||||
object:NSApp];
|
object:NSApp];
|
||||||
[[window contentView] addSubview:view];
|
|
||||||
[window updateForGLSubviews];
|
|
||||||
});
|
});
|
||||||
|
|
||||||
[pool release];
|
[pool release];
|
||||||
|
@ -511,7 +511,7 @@ extern void macdrv_clear_window_color_key(macdrv_window w) DECLSPEC_HIDDEN;
|
|||||||
extern void macdrv_window_use_per_pixel_alpha(macdrv_window w, int use_per_pixel_alpha) DECLSPEC_HIDDEN;
|
extern void macdrv_window_use_per_pixel_alpha(macdrv_window w, int use_per_pixel_alpha) DECLSPEC_HIDDEN;
|
||||||
extern void macdrv_give_cocoa_window_focus(macdrv_window w, int activate) DECLSPEC_HIDDEN;
|
extern void macdrv_give_cocoa_window_focus(macdrv_window w, int activate) DECLSPEC_HIDDEN;
|
||||||
extern void macdrv_set_window_min_max_sizes(macdrv_window w, CGSize min_size, CGSize max_size) DECLSPEC_HIDDEN;
|
extern void macdrv_set_window_min_max_sizes(macdrv_window w, CGSize min_size, CGSize max_size) DECLSPEC_HIDDEN;
|
||||||
extern macdrv_view macdrv_create_view(macdrv_window w, CGRect rect) DECLSPEC_HIDDEN;
|
extern macdrv_view macdrv_create_view(CGRect rect) DECLSPEC_HIDDEN;
|
||||||
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;
|
||||||
|
@ -1600,13 +1600,14 @@ static BOOL set_win_format(struct macdrv_win_data *data, int format)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
data->gl_view = macdrv_create_view(cocoa_window, cgrect_from_rect(data->gl_rect));
|
data->gl_view = macdrv_create_view(cgrect_from_rect(data->gl_rect));
|
||||||
if (!data->gl_view)
|
if (!data->gl_view)
|
||||||
{
|
{
|
||||||
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);
|
macdrv_set_view_hidden(data->gl_view, FALSE);
|
||||||
|
macdrv_set_view_superview(data->gl_view, NULL, cocoa_window, NULL, NULL);
|
||||||
|
|
||||||
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));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user