-
Notifications
You must be signed in to change notification settings - Fork 903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename "inner size" to "surface size" #3889
Changes from all commits
6ba3171
a560dfb
528f939
faa2d95
8305a7c
ed16345
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ use crate::application::ApplicationHandler; | |
use crate::cursor::Cursor; | ||
use crate::dpi::{PhysicalPosition, PhysicalSize, Position, Size}; | ||
use crate::error::{self, EventLoopError, ExternalError, NotSupportedError}; | ||
use crate::event::{self, Force, InnerSizeWriter, StartCause}; | ||
use crate::event::{self, Force, StartCause, SurfaceSizeWriter}; | ||
use crate::event_loop::{ | ||
ActiveEventLoop as RootActiveEventLoop, ControlFlow, DeviceEvents, | ||
EventLoopProxy as RootEventLoopProxy, OwnedDisplayHandle as RootOwnedDisplayHandle, | ||
|
@@ -201,11 +201,11 @@ impl EventLoop { | |
let old_scale_factor = scale_factor(&self.android_app); | ||
let scale_factor = scale_factor(&self.android_app); | ||
if (scale_factor - old_scale_factor).abs() < f64::EPSILON { | ||
let new_inner_size = Arc::new(Mutex::new(screen_size(&self.android_app))); | ||
let new_surface_size = Arc::new(Mutex::new(screen_size(&self.android_app))); | ||
Comment on lines
203
to
+204
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the surface size in pixels on Android affected by a scale factor, or has it been observed to change when the scale factor changed)? |
||
let window_id = window::WindowId(WindowId); | ||
let event = event::WindowEvent::ScaleFactorChanged { | ||
inner_size_writer: InnerSizeWriter::new(Arc::downgrade( | ||
&new_inner_size, | ||
surface_size_writer: SurfaceSizeWriter::new(Arc::downgrade( | ||
&new_surface_size, | ||
)), | ||
scale_factor, | ||
}; | ||
|
@@ -287,7 +287,7 @@ impl EventLoop { | |
PhysicalSize::new(0, 0) | ||
}; | ||
let window_id = window::WindowId(WindowId); | ||
let event = event::WindowEvent::Resized(size); | ||
let event = event::WindowEvent::SurfaceResized(size); | ||
app.window_event(&self.window_target, window_id, event); | ||
} | ||
|
||
|
@@ -808,27 +808,27 @@ impl CoreWindow for Window { | |
// no effect | ||
} | ||
|
||
fn inner_size(&self) -> PhysicalSize<u32> { | ||
fn surface_size(&self) -> PhysicalSize<u32> { | ||
self.outer_size() | ||
Comment on lines
+811
to
812
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we invert this - make There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suspect "inner_size" here may refer to the safe area, and "outer size" to without safe area? Not sure though There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure either, but that could be how we intend to do it later in which case we better leave the I was thinking of this in terms like Windows' windows for a while, where the drawable area/surface excludes the window decorations AFAIK. Android has a floating-window mode as well but that "outer size" is probably not easily exposed, not via the NDK at least... |
||
} | ||
|
||
fn request_inner_size(&self, _size: Size) -> Option<PhysicalSize<u32>> { | ||
Some(self.inner_size()) | ||
fn request_surface_size(&self, _size: Size) -> Option<PhysicalSize<u32>> { | ||
Some(self.surface_size()) | ||
} | ||
|
||
fn outer_size(&self) -> PhysicalSize<u32> { | ||
screen_size(&self.app) | ||
} | ||
|
||
fn set_min_inner_size(&self, _: Option<Size>) {} | ||
fn set_min_surface_size(&self, _: Option<Size>) {} | ||
|
||
fn set_max_inner_size(&self, _: Option<Size>) {} | ||
fn set_max_surface_size(&self, _: Option<Size>) {} | ||
|
||
fn resize_increments(&self) -> Option<PhysicalSize<u32>> { | ||
fn surface_resize_increments(&self) -> Option<PhysicalSize<u32>> { | ||
None | ||
} | ||
|
||
fn set_resize_increments(&self, _increments: Option<Size>) {} | ||
fn set_surface_resize_increments(&self, _increments: Option<Size>) {} | ||
|
||
fn set_title(&self, _title: &str) {} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Barring race conditions, this function appears reentrant and would always return the same value?