From 54f89bc2c23e7207fa65c299dedc76dca4aa5809 Mon Sep 17 00:00:00 2001 From: Pete Miller Date: Wed, 17 Jan 2018 22:15:21 -0800 Subject: [PATCH] Merge pull request #12676 from brave/fix/issue-11728 Restore disabled dragging and context menu for Bookmarks Bar on Windows --- .../components/bookmarks/bookmarksToolbar.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/renderer/components/bookmarks/bookmarksToolbar.js b/app/renderer/components/bookmarks/bookmarksToolbar.js index 792fe307298..8bf31313a64 100644 --- a/app/renderer/components/bookmarks/bookmarksToolbar.js +++ b/app/renderer/components/bookmarks/bookmarksToolbar.js @@ -179,8 +179,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) @@ -200,7 +199,8 @@ class BookmarksToolbar extends React.Component { showFavicon: this.props.showFavicon, showOnlyFavicon: this.props.showOnlyFavicon, [css(styles.bookmarksToolbar)]: true, - [css(this.props.shouldAllowWindowDrag && styles.bookmarksToolbar__allowDragging)]: true, + [css(this.props.shouldAllowWindowDrag && styles.bookmarksToolbar_allowDragging)]: true, + [css(!this.props.shouldAllowWindowDrag && styles.bookmarksToolbar_disallowDragging)]: true, [css(styles.bookmarksToolbar__showOnlyFavicon)]: true })} data-test-id='bookmarksToolbar' @@ -239,9 +239,13 @@ const styles = StyleSheet.create({ padding: `0 ${globalStyles.spacing.bookmarksToolbarPadding}`, margin: `${globalStyles.spacing.navbarMenubarMargin} 0` }, - bookmarksToolbar__allowDragging: { + bookmarksToolbar_allowDragging: { WebkitAppRegion: 'drag' }, + + bookmarksToolbar_disallowDragging: { + WebkitAppRegion: 'no-drag' + }, bookmarksToolbar__showOnlyFavicon: { padding: `0 0 0 ${globalStyles.spacing.bookmarksToolbarPadding}` },