winemac: Change macdrv_set_view_window_and_frame() to macdrv_set_view_frame().

Remove the no-longer-used functionality of potentially moving the view from one
window to another.  That has been taken over by macdrv_set_view_superview().

Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Ken Thomases 2016-05-12 18:50:41 -05:00 committed by Alexandre Julliard
parent 8223756ba4
commit 587bdb8db7
3 changed files with 7 additions and 27 deletions

View File

@ -3266,39 +3266,22 @@ void macdrv_dispose_view(macdrv_view v)
}
/***********************************************************************
* macdrv_set_view_window_and_frame
*
* Move a view to a new window and/or position within its window. If w
* is NULL, leave the view in its current window and just change its
* frame.
* macdrv_set_view_frame
*/
void macdrv_set_view_window_and_frame(macdrv_view v, macdrv_window w, CGRect rect)
void macdrv_set_view_frame(macdrv_view v, CGRect rect)
{
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
WineContentView* view = (WineContentView*)v;
WineWindow* window = (WineWindow*)w;
if (CGRectIsNull(rect)) rect = CGRectZero;
OnMainThread(^{
BOOL changedWindow = (window && window != [view window]);
NSRect newFrame = NSRectFromCGRect(cgrect_mac_from_win(rect));
NSRect oldFrame = [view frame];
BOOL needUpdateWindowForGLSubviews = FALSE;
if (changedWindow)
{
WineWindow* oldWindow = (WineWindow*)[view window];
[view removeFromSuperview];
[oldWindow updateForGLSubviews];
[[window contentView] addSubview:view];
needUpdateWindowForGLSubviews = TRUE;
}
if (!NSEqualRects(oldFrame, newFrame))
{
if (!changedWindow)
[[view superview] setNeedsDisplayInRect:oldFrame];
[[view superview] setNeedsDisplayInRect:oldFrame];
if (NSEqualPoints(oldFrame.origin, newFrame.origin))
[view setFrameSize:newFrame.size];
else if (NSEqualSizes(oldFrame.size, newFrame.size))
@ -3306,17 +3289,14 @@ void macdrv_set_view_window_and_frame(macdrv_view v, macdrv_window w, CGRect rec
else
[view setFrame:newFrame];
[view setNeedsDisplay:YES];
needUpdateWindowForGLSubviews = TRUE;
if (retina_enabled)
{
int backing_size[2] = { 0 };
[view wine_setBackingSize:backing_size];
}
}
if (needUpdateWindowForGLSubviews)
[(WineWindow*)[view window] updateForGLSubviews];
}
});
[pool release];

View File

@ -513,7 +513,7 @@ extern void macdrv_set_window_color_key(macdrv_window w, CGFloat keyRed, CGFloat
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 void macdrv_dispose_view(macdrv_view v) DECLSPEC_HIDDEN;
extern void macdrv_set_view_window_and_frame(macdrv_view v, macdrv_window w, 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_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;

View File

@ -1736,7 +1736,7 @@ void set_gl_view_parent(HWND hwnd, HWND parent)
}
macdrv_set_view_superview(data->gl_view, NULL, cocoa_window, NULL, NULL);
macdrv_set_view_window_and_frame(data->gl_view, NULL, cgrect_from_rect(data->gl_rect));
macdrv_set_view_frame(data->gl_view, cgrect_from_rect(data->gl_rect));
mark_contexts_for_moved_view(data->gl_view);
}
@ -4430,7 +4430,7 @@ void sync_gl_view(struct macdrv_win_data *data)
if (get_gl_view_window_rect(data, NULL, &rect) && memcmp(&data->gl_rect, &rect, sizeof(rect)))
{
TRACE("Setting GL view %p frame to %s\n", data->gl_view, wine_dbgstr_rect(&rect));
macdrv_set_view_window_and_frame(data->gl_view, NULL, cgrect_from_rect(rect));
macdrv_set_view_frame(data->gl_view, cgrect_from_rect(rect));
data->gl_rect = rect;
mark_contexts_for_moved_view(data->gl_view);
}