Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
lunixbochs committed Feb 11, 2025
1 parent 14f83db commit 51ab7c6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 3 additions & 1 deletion src/platform_impl/apple/appkit/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,9 @@ impl WinitView {
fn mouse_click(&self, event: &NSEvent, button_state: ElementState) {
if !self.ivars().focusable.get() {
let mtm = MainThreadMarker::from(self);
unsafe { NSApplication::sharedApplication(mtm).preventWindowOrdering(); }
unsafe {
NSApplication::sharedApplication(mtm).preventWindowOrdering();
}
}
let position = self.mouse_view_point(event).to_physical(self.scale_factor());
let button = mouse_button(event);
Expand Down
3 changes: 1 addition & 2 deletions src/platform_impl/linux/wayland/window/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,7 @@ impl CoreWindow for Window {
None
}

pub fn set_focusable(&self, focusable: bool) {
}
pub fn set_focusable(&self, focusable: bool) {}

pub fn is_focusable(&self) -> Option<bool> {
None
Expand Down
7 changes: 4 additions & 3 deletions src/platform_impl/windows/window_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ use windows_sys::Win32::UI::WindowsAndMessaging::{
SWP_FRAMECHANGED, SWP_NOACTIVATE, SWP_NOMOVE, SWP_NOREPOSITION, SWP_NOSIZE, SWP_NOZORDER,
SW_HIDE, SW_MAXIMIZE, SW_MINIMIZE, SW_RESTORE, SW_SHOW, SW_SHOWNOACTIVATE, WINDOWPLACEMENT,
WINDOW_EX_STYLE, WINDOW_STYLE, WS_BORDER, WS_CAPTION, WS_CHILD, WS_CLIPCHILDREN,
WS_CLIPSIBLINGS, WS_EX_ACCEPTFILES, WS_EX_APPWINDOW, WS_EX_LAYERED, WS_EX_NOACTIVATE, WS_EX_NOREDIRECTIONBITMAP,
WS_EX_TOPMOST, WS_EX_TRANSPARENT, WS_EX_WINDOWEDGE, WS_MAXIMIZE, WS_MAXIMIZEBOX, WS_MINIMIZE,
WS_MINIMIZEBOX, WS_OVERLAPPEDWINDOW, WS_POPUP, WS_SIZEBOX, WS_SYSMENU, WS_VISIBLE,
WS_CLIPSIBLINGS, WS_EX_ACCEPTFILES, WS_EX_APPWINDOW, WS_EX_LAYERED, WS_EX_NOACTIVATE,
WS_EX_NOREDIRECTIONBITMAP, WS_EX_TOPMOST, WS_EX_TRANSPARENT, WS_EX_WINDOWEDGE, WS_MAXIMIZE,
WS_MAXIMIZEBOX, WS_MINIMIZE, WS_MINIMIZEBOX, WS_OVERLAPPEDWINDOW, WS_POPUP, WS_SIZEBOX,
WS_SYSMENU, WS_VISIBLE,
};

use crate::dpi::{PhysicalPosition, PhysicalSize, Size};
Expand Down
3 changes: 1 addition & 2 deletions src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -888,8 +888,7 @@ pub trait Window: AsAny + Send + Sync {
/// - **Windows:** Supported.
#[inline]
pub fn set_focusable(&self, focusable: bool) {
self.window
.maybe_queue_on_main(move |w| w.set_focusable(focusable))
self.window.maybe_queue_on_main(move |w| w.set_focusable(focusable))
}

/// Gets whether the window can be focused or not.
Expand Down

0 comments on commit 51ab7c6

Please sign in to comment.