Skip to content

Commit 8762dfd

Browse files
umutsatirclaude
andcommitted
fix: add window:allow-start-dragging permission for drag to work
getCurrentWindow().startDragging() silently fails without this capability. Also switch drag handlers from onMouseDown to onPointerDown with stopPropagation to prevent dnd-kit interference. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 4381c01 commit 8762dfd

5 files changed

Lines changed: 10 additions & 5 deletions

File tree

src-tauri/capabilities/default.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"windows": ["main"],
66
"permissions": [
77
"core:default",
8+
"core:window:allow-start-dragging",
89
"opener:default",
910
"sql:allow-execute",
1011
"sql:allow-load",

src/components/brain-dump/BrainDump.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ export function BrainDump() {
2121
>
2222
<div
2323
data-tauri-drag-region
24-
onMouseDown={(e) => {
24+
onPointerDown={(e) => {
2525
const target = e.target as HTMLElement;
2626
if (!target.closest('button, input, a, [role="button"]')) {
27+
e.stopPropagation();
2728
getCurrentWindow().startDragging();
2829
}
2930
}}

src/components/timebox/Timebox.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,10 @@ export function Timebox() {
222222
{/* Header */}
223223
<div
224224
data-tauri-drag-region
225-
onMouseDown={(e) => {
225+
onPointerDown={(e) => {
226226
const target = e.target as HTMLElement;
227227
if (!target.closest('button, input, a, [role="button"]')) {
228+
e.stopPropagation();
228229
getCurrentWindow().startDragging();
229230
}
230231
}}

src/components/today/TodayTaskList.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ export function TodayTaskList() {
2727
>
2828
<div
2929
data-tauri-drag-region
30-
onMouseDown={(e) => {
30+
onPointerDown={(e) => {
3131
const target = e.target as HTMLElement;
3232
if (!target.closest('button, input, a, [role="button"]')) {
33+
e.stopPropagation();
3334
getCurrentWindow().startDragging();
3435
}
3536
}}

src/components/weekly/WeekNav.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import { useT } from '../../hooks/useT';
55
import { useDateLocale } from '../../hooks/useDateLocale';
66
import { SettingsButton } from '../layout/SettingsButton';
77

8-
function handleDragRegionMouseDown(e: React.MouseEvent) {
8+
function handleDragRegionPointerDown(e: React.PointerEvent) {
99
const target = e.target as HTMLElement;
1010
if (!target.closest('button, input, a, [role="button"]')) {
11+
e.stopPropagation(); // prevent dnd-kit from capturing this pointer event
1112
getCurrentWindow().startDragging();
1213
}
1314
}
@@ -46,7 +47,7 @@ export function WeekNav({ onTodayClick }: Props) {
4647
return (
4748
<div
4849
data-tauri-drag-region
49-
onMouseDown={handleDragRegionMouseDown}
50+
onPointerDown={handleDragRegionPointerDown}
5051
className="flex items-center gap-2 border-b flex-shrink-0"
5152
style={{
5253
height: 52,

0 commit comments

Comments
 (0)