Skip to content

Commit 0d3220f

Browse files
committed
Revert "fix(window): handle window movement across monitors with different scaling (#3675)"
This reverts commit 400d5b9.
1 parent 3aba087 commit 0d3220f

File tree

5 files changed

+0
-294
lines changed

5 files changed

+0
-294
lines changed

backend/tauri/src/ipc.rs

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -985,38 +985,6 @@ pub async fn get_clash_ws_connections_state(
985985
Ok(ws_connector.state())
986986
}
987987

988-
/// Move window to another monitor
989-
#[tauri::command]
990-
#[specta::specta]
991-
pub fn move_window_to_other_monitor(
992-
window: tauri::Window,
993-
target_monitor_index: usize,
994-
) -> Result<()> {
995-
crate::utils::window_manager::move_window_to_other_monitor(window, target_monitor_index)?;
996-
Ok(())
997-
}
998-
999-
/// Center window on current monitor
1000-
#[tauri::command]
1001-
#[specta::specta]
1002-
pub fn center_window(window: tauri::Window) -> Result<()> {
1003-
crate::utils::window_manager::center_window(&window)?;
1004-
Ok(())
1005-
}
1006-
1007-
/// Get available monitors
1008-
#[tauri::command]
1009-
#[specta::specta]
1010-
pub fn get_available_monitors(
1011-
window: tauri::Window,
1012-
) -> Result<Vec<crate::utils::window_manager::MonitorInfo>> {
1013-
let monitors = crate::utils::window_manager::get_available_monitors(window)?;
1014-
Ok(monitors
1015-
.iter()
1016-
.map(|(id, monitor)| ((*id, monitor)).into())
1017-
.collect())
1018-
}
1019-
1020988
// Updater block
1021989

1022990
#[derive(Default, Clone, serde::Serialize, serde::Deserialize, specta::Type)]

backend/tauri/src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,6 @@ pub fn run() -> std::io::Result<()> {
272272
ipc::get_core_dir,
273273
// clash layer
274274
ipc::get_clash_ws_connections_state,
275-
// window management
276-
ipc::move_window_to_other_monitor,
277-
ipc::center_window,
278-
ipc::get_available_monitors,
279275
// updater layer
280276
ipc::check_update,
281277
])

backend/tauri/src/utils/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ pub mod open;
1717

1818
pub mod dock;
1919
pub mod sudo;
20-
pub mod window_manager;
2120

2221
#[cfg(test)]
2322
#[cfg(windows)]

backend/tauri/src/utils/window_manager.rs

Lines changed: 0 additions & 204 deletions
This file was deleted.

frontend/interface/src/ipc/bindings.ts

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -720,49 +720,6 @@ export const commands = {
720720
else return { status: 'error', error: e as any }
721721
}
722722
},
723-
/**
724-
* Move window to another monitor
725-
*/
726-
async moveWindowToOtherMonitor(
727-
targetMonitorIndex: number,
728-
): Promise<Result<null, string>> {
729-
try {
730-
return {
731-
status: 'ok',
732-
data: await TAURI_INVOKE('move_window_to_other_monitor', {
733-
targetMonitorIndex,
734-
}),
735-
}
736-
} catch (e) {
737-
if (e instanceof Error) throw e
738-
else return { status: 'error', error: e as any }
739-
}
740-
},
741-
/**
742-
* Center window on current monitor
743-
*/
744-
async centerWindow(): Promise<Result<null, string>> {
745-
try {
746-
return { status: 'ok', data: await TAURI_INVOKE('center_window') }
747-
} catch (e) {
748-
if (e instanceof Error) throw e
749-
else return { status: 'error', error: e as any }
750-
}
751-
},
752-
/**
753-
* Get available monitors
754-
*/
755-
async getAvailableMonitors(): Promise<Result<MonitorInfo[], string>> {
756-
try {
757-
return {
758-
status: 'ok',
759-
data: await TAURI_INVOKE('get_available_monitors'),
760-
}
761-
} catch (e) {
762-
if (e instanceof Error) throw e
763-
else return { status: 'error', error: e as any }
764-
}
765-
},
766723
async checkUpdate(): Promise<Result<UpdateWrapper | null, string>> {
767724
try {
768725
return { status: 'ok', data: await TAURI_INVOKE('check_update') }
@@ -1216,16 +1173,6 @@ export type MergeProfileBuilder = {
12161173
*/
12171174
updated: number | null
12181175
}
1219-
/**
1220-
* Simplified monitor information for IPC
1221-
*/
1222-
export type MonitorInfo = {
1223-
id: number
1224-
name: string
1225-
position: [number, number]
1226-
size: [number, number]
1227-
scale_factor: number
1228-
}
12291176
export type NetworkStatisticWidgetConfig =
12301177
| { kind: 'disabled' }
12311178
| { kind: 'enabled'; value: StatisticWidgetVariant }

0 commit comments

Comments
 (0)