Skip to content

Commit 1889e04

Browse files
committed
Adding --webui-app-region to Frameless Example
1 parent 9cfb77f commit 1889e04

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

bridge/webui.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class WebuiBridge {
164164
});
165165
// Frameless Dragging
166166
document.addEventListener("mousemove", (e) => {
167-
// WebUI `-webkit-app-region: drag;` custom implementation
167+
// WebUI Webkit App-Region Custom Implementation
168168
if (e.buttons !== 1) {
169169
this.#isDragging = false;
170170
return;
@@ -173,12 +173,8 @@ class WebuiBridge {
173173
let target = e.target;
174174
while (target) {
175175
let computedStyle = window.getComputedStyle(target);
176-
177176
let webkitComputed = computedStyle.getPropertyValue("-webkit-app-region").trim();
178-
179-
/* Compatibility for platforms without `-webkit-app-region` */
180177
let webuiComputed = computedStyle.getPropertyValue("--webui-app-region").trim();
181-
182178
if (webkitComputed === "drag" || webuiComputed === "drag") {
183179
this.#initialMouseX = e.screenX;
184180
this.#initialMouseY = e.screenY;

examples/C/frameless/main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const char* html =
2020
" padding: 0 15px;"
2121
" box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);"
2222
" -webkit-app-region: drag;"
23+
" --webui-app-region: drag;"
2324
" font-family: Arial, sans-serif;"
2425
" }"
2526
" #title { font-size: 16px; font-weight: bold; }"

0 commit comments

Comments
 (0)