Skip to content

Commit 17867c2

Browse files
committed
拖拽资源到应用程序时将应用程序窗口放置到最前面
1 parent a9098ae commit 17867c2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src-tauri/src/api/window_api.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ pub fn handle_window_event(window: &tauri::Window, event: &tauri::WindowEvent) {
123123
}
124124
tauri::WindowEvent::DragDrop(drag_drop_event) => match drag_drop_event {
125125
DragDropEvent::Drop { paths, .. } if !paths.is_empty() => {
126+
let _ = window.set_focus();
126127
let _ = EventDispatcher::<DragDropResource>::send_event(
127128
window.app_handle(),
128129
DragDropResourcePaylod {

0 commit comments

Comments
 (0)