Browse Source

Platform: don't assert on X11 DEs that don't have RESOURCE_MANAGER.

pull/297/head
Vladimír Vondruš 8 years ago
parent
commit
89f7a5ee75
  1. 3
      doc/changelog.dox
  2. 3
      src/Magnum/Platform/Implementation/dpiScaling.hpp

3
doc/changelog.dox

@ -45,6 +45,9 @@ See also:
as an alternative to `--magnum-dpi-scaling` command-line parameter. It was as an alternative to `--magnum-dpi-scaling` command-line parameter. It was
also not documented anywhere. Besides that, the default `--magnum-dpi-scaling` also not documented anywhere. Besides that, the default `--magnum-dpi-scaling`
value should have been `default` as documented, not `virtual`. value should have been `default` as documented, not `virtual`.
- Don't assert in DPI scaling detection in @ref Platform::Sdl2Application and
@ref Platform::GlfwApplication on X11 DEs that don't create any
`RESOURCE_MANAGER` (see [mosra/magnum#290](https://github.com/mosra/magnum/issues/290))
@section changelog-2018-10 2018.10 @section changelog-2018-10 2018.10

3
src/Magnum/Platform/Implementation/dpiScaling.hpp

@ -102,7 +102,7 @@ inline Float x11DpiScaling() {
Containers::ScopedExit closeDisplay{display, xCloseDisplay}; Containers::ScopedExit closeDisplay{display, xCloseDisplay};
const char* rms = xResourceManagerString(display); const char* rms = xResourceManagerString(display);
CORRADE_INTERNAL_ASSERT(rms); if(rms) {
XrmDatabase db = xrmGetStringDatabase(rms); XrmDatabase db = xrmGetStringDatabase(rms);
CORRADE_INTERNAL_ASSERT(db); CORRADE_INTERNAL_ASSERT(db);
Containers::ScopedExit closeDb{db, xrmDestroyDatabase}; Containers::ScopedExit closeDb{db, xrmDestroyDatabase};
@ -116,6 +116,7 @@ inline Float x11DpiScaling() {
return scaling; return scaling;
} }
} }
}
Warning{} << "Platform: can't get Xft.dpi property for virtual DPI scaling, falling back to physical DPI"; Warning{} << "Platform: can't get Xft.dpi property for virtual DPI scaling, falling back to physical DPI";
return {}; return {};

Loading…
Cancel
Save