From 03407feeb9b102ac6fd2a573b3a566166b360401 Mon Sep 17 00:00:00 2001 From: MrSphay Date: Fri, 1 May 2026 20:35:35 +0200 Subject: [PATCH] Make window controls fire on pointer down --- src/App.tsx | 23 ++++++++++------------- src/styles.css | 9 +++++++++ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 539a0ab..c23a67a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -15,7 +15,7 @@ import { X } from "lucide-react"; import { useEffect, useMemo, useState } from "react"; -import type { ReactNode } from "react"; +import type { PointerEvent, ReactNode } from "react"; import packageInfo from "../package.json"; import { transformEnv } from "./env"; import type { EnvDefault } from "./env"; @@ -328,6 +328,12 @@ export default function App() { setDefaults((current) => current.filter((_, entryIndex) => entryIndex !== index)); } + function runWindowControl(event: PointerEvent, action?: () => void) { + event.preventDefault(); + event.stopPropagation(); + action?.(); + } + return (
@@ -340,10 +346,7 @@ export default function App() {