Skip to content

Commit e79b74a

Browse files
authored
Merge pull request #579 from konakona418-forked/drag-drop-compatibility
Drag drop compatibility
2 parents 7adbdc4 + 765a1b3 commit e79b74a

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)