From 476f408a13df84e380568e59299697ead31fa192 Mon Sep 17 00:00:00 2001 From: Nariman Jelveh Date: Sat, 15 Jun 2024 22:58:24 -0700 Subject: [PATCH] Take into account the menubar height when positioning the contextmenu via puter.js --- src/IPC.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/IPC.js b/src/IPC.js index 1f1f3e81..5072f30c 100644 --- a/src/IPC.js +++ b/src/IPC.js @@ -373,6 +373,12 @@ window.addEventListener('message', async (event) => { // get window position const window_position = $(el_window).position(); + // does this window have a menubar? + const $menubar = $(el_window).find('.window-menubar'); + if($menubar.length > 0){ + y += $menubar.height(); + } + // update mouse position update_mouse_position(x + window_position.left, y + window_position.top + 25); }