Skip to content
This repository was archived by the owner on Jul 10, 2023. It is now read-only.

Commit 1180d27

Browse files
committed
Implement Android get_dimensions
1 parent 2d67c43 commit 1180d27

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "servo-glutin"
3-
version = "0.13.0"
3+
version = "0.13.1"
44
authors = ["The glutin contributors, Pierre Krieger <pierre.krieger1708@gmail.com>"]
55
description = "Cross-platform OpenGL context provider."
66
keywords = ["windowing", "opengl"]

src/api/android/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ impl MonitorId {
6464

6565
#[inline]
6666
pub fn get_dimensions(&self) -> (u32, u32) {
67-
unimplemented!()
67+
unsafe {
68+
let window = android_glue::get_native_window();
69+
(ffi::ANativeWindow_getWidth(window) as u32, ffi::ANativeWindow_getHeight(window) as u32)
70+
}
6871
}
6972
}
7073

0 commit comments

Comments
 (0)