Repository navigation
v0.24.0
DlangUI v0.24.0
OpenGL fixes for apps with several windows: X11 windows share their GL objects like SDL windows, GL objects of widgets are deleted with their context current, and the global GL objects are created again when a window opens after the last one was closed. Win32 window icons follow the monitor's DPI and the theme. Menu hotkeys skip disabled items and prefer the character of a non-Latin keyboard layout. Saved window sizes and positions are kept when a window is shown.
Behavior changes worth noting
UIAppMainthrough a pointer (#270, #1249):mixin APP_ENTRY_POINTpasses the application'sUIAppMainto the backend (uiAppMainFunction), and the backends call it throughcallUIAppMain().dub test --coveragewith DMD links when a module other than the main one imports dlangui. An app with its ownmainthat callsDLANGUImaindirectly must setuiAppMainFunction = &UIAppMain;first, otherwise it logs "UIAppMain is not set" and exits with 1.- Window teardown (#1250, #1253): the widget teardown of the
Windowdestructor moved intodestroyWidgets()(withcallOnClose()). On SDL and X11 the window destructor callsonClose, then destroys the widgets with the window's own GL context current, a few statements earlier than before. KeyEvent.texton KeyDown (#1245, #1256): a KeyDown may carry the character the key types in the current keyboard layout. Win32 gives it for Alt + a letter key whose letter isn't Latin.- Menu hotkeys (#1245, #1255, #1256, #1258): MainMenu tries a top-level item first, then a submenu item; at each level the layout's character before the key code's Latin letter. Disabled items, separators and the submenus of disabled items are skipped, and the items' action states are updated before an Alt hotkey is matched.
MeasureSizewindows keep a restored size (#1206, #1261): afterrestoreWindowState(), the firstshow()keeps the restored size, grown to the content if that needs more (all backends; newWindow.sizeWindowToContentOnShow()).
Fixes
- OpenGL:
- GL objects of widgets (
GLObject,GLVertexBuffer) are deleted with their context current; Win32 queues the ones deleted outside painting and deletes them after the next frame (#1250, #1253: example1 6 → 0 GL errors at exit, d3d 15 → 0). - X11: the windows' GL contexts share their objects; a second OpenGL window such as the file dialog got invalid program and texture names (#1252, #1266: about 244,000 GL errors with example1's file dialog). The cache of the bound GL program is reset each frame (one GL error in another window's first frame, X11 and SDL).
- X11, SDL: the global GL objects (GL caches, shader programs, GL texture and 3D effect caches) are created again for a window opened after the last OpenGL window was closed; SDL sets context sharing for each context, as it resets its GL attributes when the last GL window is gone (#1265, #1270).
- GL objects of widgets (
- Win32:
- Alt+letter with a non-Latin layout opens the menu item of the typed character (Alt+Ф: "&Файл") before a Latin hotkey of the key code ("Save &As") (#1245, #1256).
- Window icons are sized for the DPI of the window's monitor and created again when the DPI changes (#1185, #1260), and again on a theme change: SVG icons with
currentColorfollow the theme, and the theme's drawable mapping applies (#1259, #1269).
- X11: a position requested before a window is shown (
restoreWindowState(),moveWindow()) is kept by window managers that place new windows themselves (#1262, #1267). - SDL: a window minimized while maximized comes back maximized with its modal dialog (#1217, #1264).
- Menus: hotkeys skip disabled items (#1255, #1258).
- example1: the legacy OpenGL example (glxGears) draws again, and is disabled on core profile contexts (SDL) instead of logging GL errors (#620, #1251).
Compatibility
Minor release. New API: uiAppMainFunction, callUIAppMain(), Window.destroyWidgets(), Window.callOnClose(), Window.sizeWindowToContentOnShow(), glContextIsCurrentFunc, deleteGLObject(), deletePendingGLObjects(), releaseGLObjectsOfLastContext(), uninitGLSupport(), EffectCache.forgetAll(). See "Behavior changes worth noting" for DLANGUImain callers.