dlangide icon indicating copy to clipboard operation
dlangide copied to clipboard

wrong DPI setting used on macOS Retina display until Apply clicked in Preferences

Open denniscote opened this issue 8 years ago • 5 comments

dlangide uses 96 DPI for screen display when started on macOS using dmd and dub installed by Homebrew, and then the following dub commands to install and run dlangide. Note the user must manually install SDL2 in Homebrew before dlangide will build correctly.

dub install dlangide dub run dlangide

All text and icons are displayed very small. Open the Preferences dialog and you will see the screen resolution is displayed as "Use Screen DPI (192)", but the text and icons are displayed using 96 DPI until the user clicks the Apply button in the Preferences dialog.

The other screen resolution settings in the Preferences dialog can be used to verify the initial display is actually at 96 DPI.

I also noticed that the check boxes in the Text Editors and Common panes of the Preferences dialog look like they are always displayed at 96 DPI (ie very small size) even after the rest of the UI has changed to use the 192 DPI setting. They remain very small,

denniscote avatar Oct 13 '17 00:10 denniscote

Could you please attach ui.log of DlangIDE starting (while option override screen dpi is disabled - set to default). Use debug build - w/o --build=release dub run dlangide 2> ui.log

buggins avatar Oct 13 '17 06:10 buggins

I hope this is what you are looking for.

I noticed it detects the resolution as 108 DPI but the actual resolution is 218 DPI as reported by MacTracker for my iMac.

27-inch (diagonal) Retina 5K display with IPS technology 500 cd/m2 218 ppi Wide color gamut (P3) 5120 by 2880 pixels

Last login: Wed Oct 11 20:44:59 on ttys000 Denniss-iMac:~ dennis$ dub run dlangide Building package dlangide in /Users/dennis/.dub/packages/dlangide-0.8.6/dlangide/ Performing "debug" build using dmd for x86_64. emsi_containers 0.5.3: target for configuration "library" is up to date. libdparse 0.7.1: target for configuration "library" is up to date. dsymbol 0.2.9: target for configuration "library" is up to date. msgpack-d 1.0.0-beta.6: target for configuration "library" is up to date. dcd 0.9.1: target for configuration "library" is up to date. derelict-util 2.0.6: target for configuration "library" is up to date. derelict-ft 1.1.3: target for configuration "library" is up to date. derelict-gl3 1.0.23: target for configuration "library" is up to date. derelict-sdl2 2.0.2: target for configuration "library" is up to date. dlangui 0.9.160: target for configuration "default" is up to date. dlangide 0.8.6: target for configuration "default" is up to date. To force a rebuild of up-to-date targets, run again with --force. Running .dub/packages/dlangide-0.8.6/dlangide/bin/dlangide 2017-10-13 23:18:08.695 I Log level changed to Trace 2017-10-13 23:18:08.696 I Logger is initialized 2017-10-13 23:18:08.697 V DerelictFT: Loading FreeType library 2017-10-13 23:18:08.697 V DerelictFT: Missing symbols callback is registered 2017-10-13 23:18:08.702 V DerelictFT: Loaded 2017-10-13 23:18:08.702 V Initializing FreeType library 2017-10-13 23:18:08.733 I Getting list of fonts using FontConfig 2017-10-13 23:18:08.765 I FontConfig: 400 font files registered in 32ms 2017-10-13 23:18:08.766 D initResourceManagers() 2017-10-13 23:18:08.767 I Creating ImageCache 2017-10-13 23:18:08.767 I Creating DrawableCache 2017-10-13 23:18:08.767 D Calling initSharedResourceManagers() 2017-10-13 23:18:08.767 D Calling initStandardEditorActions() 2017-10-13 23:18:08.768 D Calling registerStandardWidgets() 2017-10-13 23:18:08.768 D Registering standard widgets for DML 2017-10-13 23:18:08.768 D initResourceManagers() -- finished 2017-10-13 23:18:08.866 D Creating default theme 2017-10-13 23:18:08.867 I sdlUpdateScreenDpi: SCREEN_DPI=108 2017-10-13 23:18:08.868 I sdlUpdateScreenDpi: SCREEN_DPI is changed from 96 to 108 2017-10-13 23:18:08.868 V uiTheme setting new theme theme_default 2017-10-13 23:18:08.871 I Applying loaded theme theme_default 2017-10-13 23:18:08.871 V uiTheme setting new theme ide_theme_default 2017-10-13 23:18:08.874 I Applying loaded theme ide_theme_default 2017-10-13 23:18:08.874 V setDefaultLanguageAndThemeIfNecessary : setting UI language 2017-10-13 23:18:08.874 V Loading language file 2017-10-13 23:18:08.874 D Loading string resources from file @embedded@/std_en.ini 2017-10-13 23:18:08.875 D Loading string resources from file @embedded@/en.ini 2017-10-13 23:18:08.876 V Calling onThemeChanged 2017-10-13 23:18:08.876 D Creating SDL window 2017-10-13 23:18:08.885 I Trying to create OpenGL 3.2 context 2017-10-13 23:18:08.900 I Created successfully 2017-10-13 23:18:08.900 V Reloading DerelictGL3 2017-10-13 23:18:08.901 V Reloading DerelictGL 2017-10-13 23:18:08.901 D glSupport not initialized: trying to create 2017-10-13 23:18:08.901 V Compiling solid fill program 2017-10-13 23:18:08.901 D compileShader: glslVersion = 4.10, type: GL_VERTEX_SHADER 2017-10-13 23:18:08.902 D compileShader: glslVersion = 4.10, type: GL_FRAGMENT_SHADER 2017-10-13 23:18:08.902 D Program linked successfully 2017-10-13 23:18:08.902 V Program is initialized successfully 2017-10-13 23:18:08.902 V Compiling texture program 2017-10-13 23:18:08.902 D compileShader: glslVersion = 4.10, type: GL_VERTEX_SHADER 2017-10-13 23:18:08.903 D compileShader: glslVersion = 4.10, type: GL_FRAGMENT_SHADER 2017-10-13 23:18:08.903 D Program linked successfully 2017-10-13 23:18:08.903 V Program is initialized successfully 2017-10-13 23:18:08.903 D Shaders compiled successfully 2017-10-13 23:18:08.903 V OpenGL is initialized ok 2017-10-13 23:18:08.903 I OpenGL is enabled 2017-10-13 23:18:08.904 D Loading image from file @embedded@/dlangui-logo1.png 2017-10-13 23:18:08.906 I sdlUpdateScreenDpi: SCREEN_DPI=108 2017-10-13 23:18:08.906 I sdlUpdateScreenDpi: SCREEN_DPI is changed from 192 to 108 2017-10-13 23:18:08.914 D Loading image from file @embedded@/list_item_selected.9.png 2017-10-13 23:18:08.914 D Loading image from file @embedded@/list_item_focused.9.png 2017-10-13 23:18:08.914 D Loading image from file @embedded@/list_item_hovered.9.png 2017-10-13 23:18:08.918 I ptty device created: /dev/ttys001 2017-10-13 23:18:08.919 D TerminalDevice threadProc() enter 2017-10-13 23:18:08.924 D Searching for compiler path: dmd 2017-10-13 23:18:08.932 D compiler output: /Users/dennis/.dlangide/tmp_dummy_file_to_get_import_paths.d(1): Error: module module_that_does_not_exist is in file 'module_that_does_not_exist.d' which cannot be read import path[0] = /usr/local/opt/dmd/include/dlang/dmd

2017-10-13 23:18:08.932 D import path found: /usr/local/opt/dmd/include/dlang/dmd 2017-10-13 23:18:08.932 D dmd imports:["/usr/local/opt/dmd/include/dlang/dmd"] 2017-10-13 23:18:08.932 D Searching for compiler path: ldc 2017-10-13 23:18:08.933 W Compiler executable not found for ldc 2017-10-13 23:18:08.935 D Shortcut actions loaded 2017-10-13 23:18:08.935 D DrawableCache.clear() 2017-10-13 23:18:08.935 D updating theme after UI font change 2017-10-13 23:18:08.936 D SDLWindow.show() - Dlang IDE 2017-10-13 23:18:08.937 D Loading image from file @embedded@/main_menu_background.9.png 2017-10-13 23:18:08.937 D Loading image from file @embedded@/main_menu_item_background_selected.9.png 2017-10-13 23:18:08.937 D Loading image from file @embedded@/main_menu_item_background_hover.9.png 2017-10-13 23:18:08.938 D creating color drawable #eceffa 2017-10-13 23:18:08.938 D Loading image from file @embedded@/toolbar_background.9.png 2017-10-13 23:18:08.938 D Loading image from file @embedded@/document-open.png 2017-10-13 23:18:08.939 D Loading image from file @embedded@/toolbar_button_hover.9.png 2017-10-13 23:18:08.939 D Loading image from file @embedded@/toolbar_button_pressed.9.png 2017-10-13 23:18:08.939 D Loading image from file @embedded@/document-save.png 2017-10-13 23:18:08.939 D Loading image from file @embedded@/toolbar_separator.png 2017-10-13 23:18:08.939 D Loading image from file @embedded@/debug-run.png 2017-10-13 23:18:08.939 D Loading image from file @embedded@/toolbar_control_disabled.9.png 2017-10-13 23:18:08.939 D Loading image from file @embedded@/toolbar_control_normal.9.png 2017-10-13 23:18:08.940 D Loading image from file @embedded@/scrollbar_btn_down.png 2017-10-13 23:18:08.940 D Loading image from file @embedded@/btn_pressed.9.png 2017-10-13 23:18:08.941 D Loading image from file @embedded@/btn_hover.9.png 2017-10-13 23:18:08.942 D Loading image from file @embedded@/run-build.png 2017-10-13 23:18:08.942 D Loading image from file @embedded@/run-rdmd.png 2017-10-13 23:18:08.942 D Loading image from file @embedded@/edit-copy.png 2017-10-13 23:18:08.942 D Loading image from file @embedded@/edit-paste.png 2017-10-13 23:18:08.942 D Loading image from file @embedded@/edit-cut.png 2017-10-13 23:18:08.942 D Loading image from file @embedded@/edit-undo.png 2017-10-13 23:18:08.942 D Loading image from file @embedded@/edit-redo.png 2017-10-13 23:18:08.943 D Loading image from file @embedded@/edit-indent.png 2017-10-13 23:18:08.943 D Loading image from file @embedded@/edit-unindent.png 2017-10-13 23:18:08.943 D Loading image from file @embedded@/debug-stop.png 2017-10-13 23:18:08.943 D Loading image from file @embedded@/debug-pause.png 2017-10-13 23:18:08.943 D Loading image from file @embedded@/debug-restart.png 2017-10-13 23:18:08.943 D Loading image from file @embedded@/debug-step-into.png 2017-10-13 23:18:08.943 D Loading image from file @embedded@/debug-step-over.png 2017-10-13 23:18:08.943 D Loading image from file @embedded@/debug-step-out.png 2017-10-13 23:18:08.943 D Loading image from file @embedded@/dock_window_background_focused.9.png 2017-10-13 23:18:08.943 D Loading image from file @embedded@/dock_window_background_normal.9.png 2017-10-13 23:18:08.943 D Loading image from file @embedded@/dock_window_caption_background_focused.9.png 2017-10-13 23:18:08.943 D Loading image from file @embedded@/dock_window_caption_background_normal.9.png 2017-10-13 23:18:08.943 D Loading image from file @embedded@/tab_more.png 2017-10-13 23:18:08.944 D Loading image from file @embedded@/tab_btn_dark_up_focused_selected.9.png 2017-10-13 23:18:08.944 D Loading image from file @embedded@/tab_btn_dark_up_focused_hover.9.png 2017-10-13 23:18:08.944 D Loading image from file @embedded@/tab_btn_dark_up_focused.9.png 2017-10-13 23:18:08.944 D Loading image from file @embedded@/tab_btn_dark_up_selected.9.png 2017-10-13 23:18:08.944 D Loading image from file @embedded@/tab_btn_dark_up_hover.9.png 2017-10-13 23:18:08.944 D Loading image from file @embedded@/tab_btn_dark_up_normal.9.png 2017-10-13 23:18:08.946 D Loading image from file @embedded@/close.png 2017-10-13 23:18:08.946 D Loading image from file @embedded@/scrollbar_btn_left.png 2017-10-13 23:18:08.946 D Loading image from file @embedded@/scrollbar_btn_background_pressed.9.png 2017-10-13 23:18:08.946 D Loading image from file @embedded@/scrollbar_btn_background_normal.9.png 2017-10-13 23:18:08.946 D Loading image from file @embedded@/scrollbar_btn_background_hover.9.png 2017-10-13 23:18:08.946 D Loading image from file @embedded@/scrollbar_btn_right.png 2017-10-13 23:18:08.946 D Loading image from file @embedded@/scrollbar_indicator_horizontal.png 2017-10-13 23:18:08.946 D Loading image from file @embedded@/scrollbar_btn_background_disabled.9.png 2017-10-13 23:18:08.946 D Loading image from file @embedded@/scrollbar_btn_up.png 2017-10-13 23:18:08.946 D Loading image from file @embedded@/scrollbar_indicator_vertical.png 2017-10-13 23:18:08.949 D Loading image from file @embedded@/dock_window_caption_background_focused_down.9.png 2017-10-13 23:18:08.949 D Loading image from file @embedded@/dock_window_caption_background_normal_down.9.png 2017-10-13 23:18:08.949 D Loading image from file @embedded@/tab_btn_dark_down_focused_selected.9.png 2017-10-13 23:18:08.949 D Loading image from file @embedded@/tab_btn_dark_down_focused_hover.9.png 2017-10-13 23:18:08.949 D Loading image from file @embedded@/tab_btn_dark_down_focused.9.png 2017-10-13 23:18:08.949 D Loading image from file @embedded@/tab_btn_dark_down_selected.9.png 2017-10-13 23:18:08.949 D Loading image from file @embedded@/tab_btn_dark_down_hover.9.png 2017-10-13 23:18:08.949 D Loading image from file @embedded@/tab_btn_dark_down_normal.9.png 2017-10-13 23:18:08.956 D onResize 3600x2630 2017-10-13 23:18:08.956 D resize: measure took 0 ms 2017-10-13 23:18:08.960 D Loading image from file @embedded@/btn_default.9.png 2017-10-13 23:18:08.960 D Loading image from file @embedded@/btn_normal.9.png 2017-10-13 23:18:08.960 D Loading image from file @embedded@/btn_disabled.9.png 2017-10-13 23:18:08.962 D found hdpi resource hdpi_applications-internet.png 2017-10-13 23:18:08.962 D Loading image from file @embedded@/applications-internet.png 2017-10-13 23:18:08.964 D resize: layout took 8 ms 2017-10-13 23:18:08.964 I entering message loop 2017-10-13 23:18:09.039 D Loading image from file @embedded@/toolbar_button_null.9.png 2017-10-13 23:18:09.039 V created image cache page 1024x1024 2017-10-13 23:18:09.043 V created glyph cache page 1024x1024 2017-10-13 23:18:09.049 D updateTexture - new texture id=1 2017-10-13 23:18:09.049 D updateTexture for cache page - setting image 1024x1024 tx=1 2017-10-13 23:18:09.051 D updateTexture - new texture id=2 2017-10-13 23:18:09.052 D updateTexture for cache page - setting image 1024x1024 tx=2

denniscote avatar Oct 14 '17 05:10 denniscote

Thank you! I hope this will help me to prepare a fix.

buggins avatar Oct 16 '17 08:10 buggins

I tried the latest dlangide code from git and got several deprecation warnings. See dlangide.log file attached. This version reports as v0.8.10 when started.

dlangide.log

I also noticed that the button icons on the toolbar are not resized when the screen resolution is changed to 300 DPI to make the menu and console text large enough to read. See the screen capture file attached. These buttons remain too small to be used.

dlangide screenshot

I also attached a log of dlangide starting up a second time after the initial build. See file dlangide2.log attached.

dlangide2.log

I would like to try to help with the dlangide/dlangui development if I can. I'm fairly new to D but have been programming for many years in C and C++. I'm skimming through the dlangide source files to see what I can figure out.

denniscote avatar Feb 06 '18 03:02 denniscote

Yes there are some hdpi issues you can read more about it here: https://github.com/buggins/dlangui/issues/529.

I would like to try to help with the dlangide/dlangui development if I can. I'm fairly new to D but have been programming for many years in C and C++. I'm skimming through the dlangide source files to see what I can figure out.

I think most D programmers are new ;) Reading D code is much easier than C++. I am waiting for your first PR :)

and3md avatar Feb 06 '18 14:02 and3md