Skip to content

Commit 5b97f99

Browse files
committed
osx hdpi fixes
1 parent 3f8494c commit 5b97f99

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

src/dlangui/core/events.d

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ struct Accelerator {
5252
version (OSX) {
5353
static if (true) {
5454
if (keyFlags & KeyFlag.Control)
55-
buf ~= "Ctrl+";
55+
buf ~= ""; //"Ctrl+";
5656
if (keyFlags & KeyFlag.Shift)
57-
buf ~= "Shift+";
57+
buf ~= ""; //"Shift+";
5858
if (keyFlags & KeyFlag.Option)
59-
buf ~= "Opt+";
59+
buf ~= ""; //"Opt+";
6060
if (keyFlags & KeyFlag.Command)
61-
buf ~= "Cmd+";
61+
buf ~= ""; //"Cmd+";
6262
} else {
6363
if (keyFlags & KeyFlag.Control)
6464
buf ~= "";

src/dlangui/core/types.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ private __gshared int PRIVATE_SCREEN_DPI_OVERRIDE = 0;
348348
return PRIVATE_SCREEN_DPI_OVERRIDE ? PRIVATE_SCREEN_DPI_OVERRIDE : PRIVATE_SCREEN_DPI;
349349
}
350350

351-
/// get screen DPI detection override value, if non 0 - this value is used instead of DPI detected by platform, if 0, value detected by platform will be used)
351+
/// get screen DPI detection override value, if non 0 - this value is used instead of DPI detected by platform, if 0, value detected by platform will be used
352352
@property int overrideScreenDPI() {
353353
return PRIVATE_SCREEN_DPI_OVERRIDE;
354354
}

src/dlangui/platforms/sdl/sdlapp.d

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,8 +1618,11 @@ bool sdlUpdateScreenDpi(int displayIndex = 0) {
16181618
if (numDisplays < displayIndex + 1)
16191619
return false;
16201620
float hdpi = 0;
1621-
if (SDL_GetDisplayDPI(displayIndex, null, &hdpi, null))
1621+
float ddpi = 0;
1622+
float vdpi = 0;
1623+
if (SDL_GetDisplayDPI(displayIndex, &ddpi, &hdpi, &vdpi))
16221624
return false;
1625+
Log.d("SDL_GetDisplayDPI(", displayIndex, ") : ddpi=", ddpi, " hdpi=", hdpi, " vdpi=", vdpi);
16231626
int idpi = cast(int)hdpi;
16241627
if (idpi < 32 || idpi > 2000)
16251628
return false;
@@ -1690,9 +1693,10 @@ int sdlmain(string[] args) {
16901693

16911694
Platform.setInstance(sdl);
16921695

1696+
sdlUpdateScreenDpi(0);
1697+
16931698
currentTheme = createDefaultTheme();
16941699

1695-
sdlUpdateScreenDpi(0);
16961700

16971701
Platform.instance.uiTheme = "theme_default";
16981702

0 commit comments

Comments
 (0)