|
3 | 3 | #include <dmsdk/dlib/array.h>
|
4 | 4 | #include <dmsdk/dlib/log.h>
|
5 | 5 | #include <dmsdk/dlib/mutex.h>
|
| 6 | +#include <dmsdk/graphics/graphics_native.h> |
6 | 7 | #include <dmsdk/script/script.h>
|
7 | 8 | #include <dmsdk/extension/extension.h>
|
8 | 9 |
|
@@ -175,10 +176,10 @@ int Platform_Create(lua_State* L, dmWebView::WebViewInfo* _info)
|
175 | 176 | WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc] init];
|
176 | 177 | WKWebView *view = [[WKWebView alloc] initWithFrame:screen.bounds configuration:configuration];
|
177 | 178 | #elif defined(DM_PLATFORM_OSX)
|
178 |
| - NSScreen* screen = [NSScreen mainScreen]; |
| 179 | + CGRect gameFrame = [dmGraphics::GetNativeOSXNSView() frame]; |
179 | 180 |
|
180 | 181 | WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc] init];
|
181 |
| - WKWebView *view = [[WKWebView alloc] initWithFrame:screen.visibleFrame configuration:configuration]; |
| 182 | + WKWebView *view = [[WKWebView alloc] initWithFrame:gameFrame configuration:configuration]; |
182 | 183 | #endif
|
183 | 184 | WebViewDelegate* navigationDelegate = [WebViewDelegate alloc];
|
184 | 185 | navigationDelegate->m_WebViewID = webview_id;
|
@@ -298,7 +299,7 @@ int Platform_SetPosition(lua_State* L, int webview_id, int x, int y, int width,
|
298 | 299 | #if defined(DM_PLATFORM_IOS)
|
299 | 300 | CGRect screenRect = [[UIScreen mainScreen] bounds];
|
300 | 301 | #elif defined(DM_PLATFORM_OSX)
|
301 |
| - CGRect screenRect = [[NSScreen mainScreen] visibleFrame]; |
| 302 | + CGRect screenRect = [dmGraphics::GetNativeOSXNSView() frame]; |
302 | 303 | #endif
|
303 | 304 | g_WebView.m_WebViews[webview_id].frame = CGRectMake(x, y, width >= 0 ? width : screenRect.size.width, height >= 0 ? height : screenRect.size.height);
|
304 | 305 | return 0;
|
|
0 commit comments