mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 10:41:04 +00:00
[320/906] fix position and content rect
This commit is contained in:
parent
b5778a90d7
commit
37b29ac10c
1 changed files with 16 additions and 2 deletions
|
@ -175,8 +175,8 @@ gst_gl_window_new (gint width, gint height)
|
||||||
pool = [[NSAutoreleasePool alloc] init];
|
pool = [[NSAutoreleasePool alloc] init];
|
||||||
[NSApplication sharedApplication];
|
[NSApplication sharedApplication];
|
||||||
|
|
||||||
rect.origin.x = x;
|
rect.origin.x = 0;
|
||||||
rect.origin.y = y;
|
rect.origin.y = 0;
|
||||||
rect.size.width = width;
|
rect.size.width = width;
|
||||||
rect.size.height = height;
|
rect.size.height = height;
|
||||||
|
|
||||||
|
@ -184,6 +184,20 @@ gst_gl_window_new (gint width, gint height)
|
||||||
styleMask: (NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask | NSMiniaturizableWindowMask)
|
styleMask: (NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask | NSMiniaturizableWindowMask)
|
||||||
backing: NSBackingStoreBuffered defer: NO screen: nil gstWin: priv];
|
backing: NSBackingStoreBuffered defer: NO screen: nil gstWin: priv];
|
||||||
|
|
||||||
|
if (priv->internal_win_id) {
|
||||||
|
NSRect mainRect = [[NSScreen mainScreen] visibleFrame];
|
||||||
|
GST_DEBUG ("main screen rect: %d %d %d %d", (int) mainRect.origin.x, (int) mainRect.origin.y,
|
||||||
|
(int) mainRect.size.width, (int) mainRect.size.height);
|
||||||
|
|
||||||
|
NSRect windowRect = [priv->internal_win_id frame];
|
||||||
|
GST_DEBUG ("window rect: %d %d %d %d", (int) windowRect.origin.x, (int) windowRect.origin.y,
|
||||||
|
(int) windowRect.size.width, (int) windowRect.size.height);
|
||||||
|
|
||||||
|
windowRect.origin.x += x;
|
||||||
|
windowRect.origin.y += mainRect.size.height > y ? (mainRect.size.height - y) * 0.5 : y;
|
||||||
|
[priv->internal_win_id setFrame:windowRect display:NO];
|
||||||
|
}
|
||||||
|
|
||||||
[pool release];
|
[pool release];
|
||||||
|
|
||||||
return window;
|
return window;
|
||||||
|
|
Loading…
Reference in a new issue