From 0da5ec88d6d417b5472e3f2efab1a2607077bc0c Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 17 Aug 2023 05:20:58 +0100 Subject: [PATCH] Improve selectors for macos app draggable regions (#1170) Disable background drag handles when modals are open as they interfere through the modal body --- src/macos-titlebar.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/macos-titlebar.ts b/src/macos-titlebar.ts index 587b27c..1fa8170 100644 --- a/src/macos-titlebar.ts +++ b/src/macos-titlebar.ts @@ -81,18 +81,24 @@ export function setupMacosTitleBar(window: BrowserWindow): void { -webkit-app-region: drag; -webkit-user-select: none; } + .mx_ImageView_panel { + -webkit-app-region: drag; + } /* Exclude header interactive elements from being drag handles */ .mx_RoomHeader .mx_DecoratedRoomAvatar, .mx_RoomHeader_name, .mx_LegacyRoomHeader .mx_LegacyRoomHeader_avatar, .mx_LegacyRoomHeader .mx_E2EIcon, .mx_LegacyRoomHeader .mx_RoomTopic, - .mx_LegacyRoomHeader .mx_AccessibleButton { + .mx_LegacyRoomHeader .mx_AccessibleButton, + .mx_ImageView_panel > .mx_ImageView_info_wrapper, + .mx_ImageView_panel > .mx_ImageView_title, + .mx_ImageView_panel > .mx_ImageView_toolbar > * { -webkit-app-region: no-drag; } - /* Mark the background as a drag handle */ - .mx_RoomView_wrapper { + /* Mark the background as a drag handle only if no modal is open */ + .mx_MatrixChat_wrapper[aria-hidden="false"] .mx_RoomView_wrapper { -webkit-app-region: drag; } /* Exclude content elements from being drag handles */