X11+Windows: Guess initial DPI factor (#583)

* X11: Guess initial DPI factor

* Windows: Guess initial DPI factor
This commit is contained in:
Francesca Frangipane 2018-07-01 11:01:46 -04:00 committed by GitHub
parent 85ee422acd
commit 2f7321a076
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 183 additions and 82 deletions

View file

@ -3,6 +3,9 @@ use std::str;
use super::*;
use events::ModifiersState;
pub const VIRTUAL_CORE_POINTER: c_int = 2;
pub const VIRTUAL_CORE_KEYBOARD: c_int = 3;
// A base buffer size of 1kB uses a negligible amount of RAM while preventing us from having to
// re-allocate (and make another round-trip) in the *vast* majority of cases.
// To test if `lookup_utf8` works correctly, set this to 1.
@ -24,8 +27,8 @@ pub struct PointerState<'a> {
xconn: &'a XConnection,
root: ffi::Window,
child: ffi::Window,
root_x: c_double,
root_y: c_double,
pub root_x: c_double,
pub root_y: c_double,
win_x: c_double,
win_y: c_double,
buttons: ffi::XIButtonState,