Skip to content

Commit 765a1b3

Browse files
committed
Fix: workaround for compatibility issue of -webkit-app-region.
1 parent 7adbdc4 commit 765a1b3

File tree

2 files changed

+1350
-1326
lines changed

2 files changed

+1350
-1326
lines changed

bridge/webui.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,14 @@ class WebuiBridge {
172172
if (!this.#isDragging) {
173173
let target = e.target;
174174
while (target) {
175-
if (window.getComputedStyle(target).getPropertyValue("-webkit-app-region") === "drag") {
175+
let computedStyle = window.getComputedStyle(target);
176+
177+
let webkitComputed = computedStyle.getPropertyValue("-webkit-app-region").trim();
178+
179+
/* Compatibility for platforms without `-webkit-app-region` */
180+
let webuiComputed = computedStyle.getPropertyValue("--webui-app-region").trim();
181+
182+
if (webkitComputed === "drag" || webuiComputed === "drag") {
176183
this.#initialMouseX = e.screenX;
177184
this.#initialMouseY = e.screenY;
178185
this.#initialWindowX = this.#currentWindowX;

0 commit comments

Comments
 (0)