Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix edge cases around macos draggability #1291

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/macos-titlebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ export function setupMacosTitleBar(window: BrowserWindow): void {
}

/* Mark the background as a drag handle only if no modal is open */
.mx_MatrixChat_wrapper[aria-hidden="false"] .mx_RoomView_wrapper {
.mx_MatrixChat_wrapper[aria-hidden="false"] .mx_RoomView_wrapper,
.mx_MatrixChat_wrapper[aria-hidden="false"] .mx_HomePage {
-webkit-app-region: drag;
}
/* Exclude content elements from being drag handles */
Expand All @@ -99,7 +100,9 @@ export function setupMacosTitleBar(window: BrowserWindow): void {
.mx_RightPanel_ResizeWrapper,
.mx_RoomPreviewCard,
.mx_LeftPanel,
.mx_RoomView {
.mx_RoomView,
.mx_SpaceRoomView,
.mx_AccessibleButton {
-webkit-app-region: no-drag;
}
/* Exclude context menus and their backgrounds */
Expand All @@ -123,10 +126,16 @@ export function setupMacosTitleBar(window: BrowserWindow): void {
-webkit-app-region: drag;
}

.mx_RoomView::before {
.mx_RoomView::before,
.mx_SpaceRoomView::before {
content: "";
-webkit-app-region: drag;
}

.mx_SpaceRoomView::before {
display: block;
height: 24px;
}

.mx_RoomView[data-room-header="new"]::before {
height: 13px;
Expand Down