Skip to content

Commit 3b73f3f

Browse files
nedtwiggclaude
andcommitted
Disable Tauri OS drag-drop so panes can be rearranged in standalone.
Tauri 2's default `dragDropEnabled: true` captures OS drag-drop natively and blocks HTML5 drag events on Windows, which broke Dockview pane reordering in the standalone app. Setting it to false restores pane drag at the cost of file/image-drop-to-paste, which is now tracked at #38 (blocked on tauri-apps/tauri#14373). The file-drop wiring is left in place as inert stubs so re-enabling is a small change once upstream offers a way to receive paths without blocking webview drag events. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 7a1a05d commit 3b73f3f

5 files changed

Lines changed: 6 additions & 2 deletions

File tree

lib/src/components/wall/use-session-persistence.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ export function useSessionPersistence({
9797
platform.onRequestSessionFlush(handleSessionFlushRequest);
9898
window.addEventListener('pagehide', handlePageHide);
9999

100+
// Inert in Tauri standalone today; see diffplug/mouseterm#38 and tauri-apps/tauri#14373.
100101
const unsubFilesDropped = platform.onFilesDropped?.((paths) => {
101102
if (paths.length === 0) return;
102103
const sid = selectedTypeRef.current === 'pane' ? selectedIdRef.current : null;

lib/src/lib/platform/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export interface PlatformAdapter {
2929
// Clipboard support for file references and raw images.
3030
readClipboardFilePaths(): Promise<string[] | null>;
3131
readClipboardImageAsFilePath(): Promise<string | null>;
32-
// Only present on adapters with a native (non-DOM) drag-drop source.
32+
// Only present on adapters with a native (non-DOM) drag-drop source. Currently inert in Tauri; see diffplug/mouseterm#38 and tauri-apps/tauri#14373.
3333
onFilesDropped?(handler: (paths: string[]) => void): () => void;
3434

3535
// PTY event listeners

standalone/src-tauri/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@ pub fn run() {
508508
let refs: Vec<&dyn tauri::menu::IsMenuItem<_>> = items.iter().map(|b| b.as_ref()).collect();
509509
Menu::with_items(handle, &refs)
510510
})
511+
// Inert while tauri.conf.json sets dragDropEnabled=false (needed for HTML5 pane drag). See diffplug/mouseterm#38 and tauri-apps/tauri#14373.
511512
.on_window_event(|window, event| {
512513
if let WindowEvent::DragDrop(DragDropEvent::Drop { paths, .. }) = event {
513514
let payload: Vec<String> = paths

standalone/src-tauri/tauri.conf.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"hiddenTitle": true,
1818
"width": 1200,
1919
"height": 800,
20-
"resizable": true
20+
"resizable": true,
21+
"dragDropEnabled": false
2122
}
2223
],
2324
"security": {

standalone/src/tauri-adapter.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export class TauriAdapter implements PlatformAdapter {
7878
}),
7979
);
8080

81+
// Inert while dragDropEnabled=false in tauri.conf.json. See diffplug/mouseterm#38 and tauri-apps/tauri#14373.
8182
this.unlistenFns.push(
8283
await listen<{ paths: string[] }>("mouseterm://files-dropped", (event) => {
8384
const paths = event.payload.paths ?? [];

0 commit comments

Comments
 (0)