@@ -115,6 +115,8 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
115
115
document . documentElement . setAttribute ( 'zen-private-window' , 'true' ) ;
116
116
}
117
117
118
+ this . popupOpenHandler = this . _popupOpenHandler . bind ( this ) ;
119
+
118
120
window . addEventListener ( 'resize' , this . onWindowResize . bind ( this ) ) ;
119
121
this . addPopupListeners ( ) ;
120
122
@@ -646,11 +648,22 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
646
648
document . documentElement . removeAttribute ( 'swipe-gesture' ) ;
647
649
gZenUIManager . tabsWrapper . style . removeProperty ( 'scrollbar-width' ) ;
648
650
this . updateTabsContainers ( ) ;
651
+ document . removeEventListener ( 'popupshown' , this . popupOpenHandler , { once : true } ) ;
649
652
} ,
650
653
true
651
654
) ;
652
655
}
653
656
657
+ _popupOpenHandler ( event ) {
658
+ // If a popup is opened, we should stop the swipe gesture
659
+ if ( this . _swipeState ?. isGestureActive ) {
660
+ document . documentElement . removeAttribute ( 'swipe-gesture' ) ;
661
+ gZenUIManager . tabsWrapper . style . removeProperty ( 'scrollbar-width' ) ;
662
+ this . updateTabsContainers ( ) ;
663
+ this . _cancelSwipeAnimation ( ) ;
664
+ }
665
+ }
666
+
654
667
_handleSwipeMayStart ( event ) {
655
668
if ( this . privateWindowOrDisabled || this . _inChangingWorkspace ) return ;
656
669
if ( event . target . closest ( '#zen-sidebar-foot-buttons' ) ) return ;
@@ -669,6 +682,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
669
682
if ( ! this . workspaceEnabled ) return ;
670
683
671
684
document . documentElement . setAttribute ( 'swipe-gesture' , 'true' ) ;
685
+ document . addEventListener ( 'popupshown' , this . popupOpenHandler , { once : true } ) ;
672
686
673
687
event . preventDefault ( ) ;
674
688
event . stopPropagation ( ) ;
@@ -842,6 +856,14 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
842
856
}
843
857
844
858
async workspaceBookmarks ( ) {
859
+ if ( this . privateWindowOrDisabled ) {
860
+ this . _workspaceBookmarksCache = {
861
+ bookmarks : [ ] ,
862
+ lastChangeTimestamp : 0 ,
863
+ } ;
864
+ return this . _workspaceBookmarksCache ;
865
+ }
866
+
845
867
if ( this . _workspaceBookmarksCache ) {
846
868
return this . _workspaceBookmarksCache ;
847
869
}
0 commit comments