Skip to content

Commit 6af2f7a

Browse files
mitchmindtreekosyak
authored and
kosyak
committed
[Rebased] [x11-backend] Retrieve DPI from Xft.dpi XResource (rust-windowing#824)
* [x11-backend] Retrieve DPI from Xft.dpi XResource * Update CHANGELOG.md * Update window.rs * Update CHANGELOG.md
1 parent 19d8e49 commit 6af2f7a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
- On Windows, fix `CursorMoved(0, 0)` getting dispatched on window focus.
4242
- On macOS, fix command key event left and right reverse.
4343
- On FreeBSD, NetBSD, and OpenBSD, fix build of X11 backend.
44+
- On X11, change DPI scaling factor behavior. First, winit tries to read it from "Xft.dpi" XResource, and uses DPI calculation from xrandr dimensions as fallback behavior.
4445

4546
# Version 0.19.0 (2019-03-06)
4647

src/window.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ impl Window {
477477
///
478478
/// ## Platform-specific
479479
///
480-
/// - **X11:** Can be overridden using the `WINIT_HIDPI_FACTOR` environment variable.
480+
/// - **X11:** This respects Xft.dpi, and can be overridden using the `WINIT_HIDPI_FACTOR` environment variable.
481481
/// - **Android:** Always returns 1.0.
482482
#[inline]
483483
pub fn get_hidpi_factor(&self) -> f64 {

0 commit comments

Comments
 (0)