Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Restore disabled dragging and context menu for Bookmarks Bar on Windows
Browse files Browse the repository at this point in the history
Previously it was enough to not add 'drag' to the bookmarks bar on Windows, but now that it is added at a higher level in the DOM (so that dragging works in the margin between the bars) via #10512, we have to explicitly set it to 'no-drag' on each child.

Fix #11728
  • Loading branch information
petemill committed Jan 17, 2018
1 parent 18040b9 commit 79b93e1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/renderer/components/bookmarks/bookmarksToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,7 @@ class BookmarksToolbar extends React.Component {
// used in renderer
props.showOnlyFavicon = bookmarkUtil.showOnlyFavicon()
props.showFavicon = bookmarkUtil.showFavicon()
props.shouldAllowWindowDrag = windowState.shouldAllowWindowDrag(state, currentWindow, activeFrame, isFocused(state)) &&
!isWindows
props.shouldAllowWindowDrag = !isWindows && windowState.shouldAllowWindowDrag(state, currentWindow, activeFrame, isFocused(state))
props.visibleBookmarks = bookmarkToolbarState.getToolbar(state, currentWindowId)
props.hiddenBookmarks = bookmarkToolbarState.getOther(state, currentWindowId)

Expand All @@ -196,6 +195,7 @@ class BookmarksToolbar extends React.Component {
return <div className={css(
styles.bookmarksToolbar,
this.props.shouldAllowWindowDrag && styles.bookmarksToolbar_allowDragging,
!this.props.shouldAllowWindowDrag && styles.bookmarksToolbar_disallowDragging,
this.props.showOnlyFavicon && styles.bookmarksToolbar_showOnlyFavicon
)}
data-test-id='bookmarksToolbar'
Expand Down Expand Up @@ -242,6 +242,10 @@ const styles = StyleSheet.create({
WebkitAppRegion: 'drag'
},

bookmarksToolbar_disallowDragging: {
WebkitAppRegion: 'no-drag'
},

bookmarksToolbar_showOnlyFavicon: {
padding: `0 0 0 ${globalStyles.spacing.bookmarksToolbarPadding}`
},
Expand Down

0 comments on commit 79b93e1

Please sign in to comment.