fix: window drag taking precedence on windows

This commit is contained in:
Andrew Bastin
2023-11-08 20:07:13 +05:30
parent 9d1d369f37
commit de725337d6

View File

@@ -20,7 +20,10 @@ import { ioDef } from "./platform/io"
const headerPaddingLeft = ref("0px") const headerPaddingLeft = ref("0px")
const headerPaddingTop = ref("0px") const headerPaddingTop = ref("0px")
createHoppApp("#app", { ;(async () => {
const platform = await type()
createHoppApp("#app", {
ui: { ui: {
additionalFooterMenuItems: stdFooterItems, additionalFooterMenuItems: stdFooterItems,
additionalSupportOptionsMenuItems: stdSupportOptionItems, additionalSupportOptionsMenuItems: stdSupportOptionItems,
@@ -28,9 +31,11 @@ createHoppApp("#app", {
paddingLeft: headerPaddingLeft, paddingLeft: headerPaddingLeft,
paddingTop: headerPaddingTop, paddingTop: headerPaddingTop,
onHeaderAreaClick() { onHeaderAreaClick() {
if (platform === "Darwin") {
// Drag thw window when the user drags the header area // Drag thw window when the user drags the header area
// TODO: Ignore click on headers and fields // TODO: Ignore click on headers and fields
appWindow.startDragging() appWindow.startDragging()
}
}, },
}, },
}, },
@@ -59,9 +64,9 @@ createHoppApp("#app", {
cookiesEnabled: true, cookiesEnabled: true,
promptAsUsingCookies: false, promptAsUsingCookies: false,
}, },
}) })
watch( watch(
useSettingStatic("BG_COLOR")[0], useSettingStatic("BG_COLOR")[0],
async () => { async () => {
await nextTick() await nextTick()
@@ -74,9 +79,7 @@ watch(
) )
}, },
{ immediate: true } { immediate: true }
) )
;(async () => {
const platform = await type()
if (platform === "Darwin") { if (platform === "Darwin") {
listen("will-enter-fullscreen", () => { listen("will-enter-fullscreen", () => {