fix issue GUI is blurry when using retina displays #72

This commit is contained in:
Vadim Lopatin 2015-03-10 17:44:41 +03:00
parent 556bae77a9
commit 23bc6f9187
2 changed files with 17 additions and 3 deletions

View File

@ -167,6 +167,16 @@ class SDLWindow : Window {
return true;
}
void doResize(int width, int height) {
int w = 0;
int h = 0;
SDL_GL_GetDrawableSize(_win, &w, &h);
if (w != width || h != height) {
Log.d("SDL_GL_GetDrawableSize returned ", w, "x", h, " while resize event reports ", width, "x", height);
}
onResize(w, h);
}
@property uint windowId() {
if (_win)
return SDL_GetWindowID(_win);
@ -920,13 +930,13 @@ class SDLPlatform : Platform {
case SDL_WINDOWEVENT_RESIZED:
debug(DebugSDL) Log.d("SDL_WINDOWEVENT_RESIZED win=", event.window.windowID, " pos=", event.window.data1,
",", event.window.data2);
w.onResize(event.window.data1, event.window.data2);
w.doResize(event.window.data1, event.window.data2);
w.redraw();
break;
case SDL_WINDOWEVENT_SIZE_CHANGED:
debug(DebugSDL) Log.d("SDL_WINDOWEVENT_SIZE_CHANGED win=", event.window.windowID, " pos=", event.window.data1,
",", event.window.data2);
w.onResize(event.window.data1, event.window.data2);
w.doResize(event.window.data1, event.window.data2);
w.redraw();
break;
case SDL_WINDOWEVENT_CLOSE:
@ -1102,7 +1112,8 @@ version (Windows) {
Runtime.initialize();
result = myWinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
Log.i("calling Runtime.terminate()");
Runtime.terminate();
// commented out to fix hanging runtime.terminate when there are background threads
//Runtime.terminate();
}
catch (Throwable e) // catch any uncaught exceptions
{

View File

@ -650,6 +650,9 @@ class TabWidget : VerticalLayout, TabHandler, TabCloseHandler {
focusGroup = true;
}
TabControl tabControl() { return _tabControl; }
TabHost tabHost() { return _tabHost; }
/// signal of tab change (e.g. by clicking on tab header)
Signal!TabHandler onTabChangedListener;
/// signal on tab close button