@@ -39,8 +39,6 @@ const TIME_DELTA = 1500;
3939
4040const APPLETS_DROP_ANIMATION_TIME = 0.2 ;
4141
42- const PANEL_PEEK_TIME = 1500 ;
43-
4442const EDIT_MODE_MIN_BOX_SIZE = 25 ;
4543const VALID_ICON_SIZE_VALUES = [ - 1 , 0 , 16 , 22 , 24 , 32 , 48 ] ;
4644
@@ -2091,6 +2089,7 @@ Panel.prototype = {
20912089 this . _destroyed = false ;
20922090 this . _positionChanged = false ;
20932091 this . _monitorsChanged = false ;
2092+ this . _mouseEntered = null ;
20942093 this . _signalManager = new SignalManager . SignalManager ( null ) ;
20952094 this . height = 0 ;
20962095 this . margin_top = 0 ;
@@ -2103,7 +2102,6 @@ Panel.prototype = {
21032102 this . _bottomPanelBarrier = 0 ;
21042103 this . _shadowBox = null ;
21052104 this . _panelZoneSizes = this . _createEmptyZoneSizes ( ) ;
2106- this . _peeking = false ;
21072105
21082106 this . themeSettings = new Gio . Settings ( { schema_id : 'org.cinnamon.theme' } ) ;
21092107
@@ -2373,24 +2371,8 @@ Panel.prototype = {
23732371 return ;
23742372 } ,
23752373
2376-
2374+ /* deprecated */
23772375 peekPanel : function ( ) {
2378- if ( ! this . _hidden || this . _peeking )
2379- return ;
2380-
2381- if ( this . _showHideTimer > 0 ) {
2382- Mainloop . source_remove ( this . _showHideTimer ) ;
2383- this . _showHideTimer = 0 ;
2384- }
2385-
2386- this . _peeking = true ;
2387- this . _showPanel ( ) ;
2388-
2389- Mainloop . timeout_add ( PANEL_PEEK_TIME , ( ) => {
2390- this . _peeking = false ;
2391- this . _updatePanelVisibility ( ) ;
2392- return false ;
2393- } ) ;
23942376 } ,
23952377
23962378 /**
@@ -2973,7 +2955,7 @@ Panel.prototype = {
29732955 if ( this . _positionChanged ) {
29742956 panelChanged = true ;
29752957 this . _positionChanged = false ;
2976- this . _hidden = false ;
2958+ this . _showPanel ( ) ;
29772959 }
29782960
29792961 // if the monitors changed, force update in case the position needs updating
@@ -3667,6 +3649,8 @@ Panel.prototype = {
36673649
36683650 for ( let i = 0 ; i < global . menuStack . length ; i ++ ) {
36693651 let menu = global . menuStack [ i ] ;
3652+ if ( menu . customStyleClass && menu . customStyleClass . includes ( "thumbnail" ) )
3653+ continue ;
36703654 if ( menu . getPanel ( ) === this . actor ) {
36713655 return true ;
36723656 }
@@ -3685,7 +3669,8 @@ Panel.prototype = {
36853669 * true = autohide, false = always show, intel = Intelligent
36863670 */
36873671 _updatePanelVisibility : function ( ) {
3688- if ( this . _panelEditMode || this . _peeking || this . _panelHasOpenMenus ( ) )
3672+ this . _mouseEntered = this . _mouseOnPanel ( ) ;
3673+ if ( this . _panelEditMode || this . _highlighted || this . _panelHasOpenMenus ( ) )
36893674 this . _shouldShow = true ;
36903675 else {
36913676 switch ( this . _autohideSettings ) {
@@ -3742,6 +3727,20 @@ Panel.prototype = {
37423727 } // end of switch on autohidesettings
37433728 }
37443729
3730+ const focusedWindow = global . display . get_focus_window ( ) ;
3731+ if ( focusedWindow && focusedWindow . is_fullscreen ( ) && focusedWindow . get_monitor ( ) === this . monitorIndex
3732+ && this . _panelHasOpenMenus ( ) ) {
3733+ // An applet has been opened by shortcut key over a fullscreened window so remove
3734+ // focus from fullscreened window so that chrome remains visible until fullscreened
3735+ // window is focused again by user.
3736+ this . _focusDesktop ( ) ;
3737+ } else if ( focusedWindow && focusedWindow . get_monitor ( ) !== this . monitorIndex
3738+ && global . display . get_monitor_in_fullscreen ( this . monitorIndex ) && this . _panelHasOpenMenus ( ) ) {
3739+ // Focused window is on other monitor but this monitor has a fullscreened window so
3740+ // remove focus from other window so that chrome remains visible until a window is focused
3741+ this . _focusDesktop ( ) ;
3742+ }
3743+
37453744 this . _queueShowHidePanel ( ) ;
37463745 } ,
37473746
@@ -3774,30 +3773,43 @@ Panel.prototype = {
37743773 }
37753774 } ,
37763775
3777- _enterPanel : function ( actor = null , event = null ) {
3778- this . _mouseEntered = true ;
3779- this . _updatePanelVisibility ( ) ;
3780- } ,
3776+ _focusDesktop : function ( ) {
3777+ const windows = global . display . list_windows ( 0 ) ;
37813778
3782- _leavePanel :function ( actor = null , event = null ) {
3783- if ( event !== null && this . _eventOnPanelStrip ( ...event . get_coords ( ) ) ) {
3784- return ;
3779+ for ( let i = 0 ; i < windows . length ; i ++ ) {
3780+ let window = windows [ i ] ;
3781+ if ( window . get_window_type ( ) === Meta . WindowType . DESKTOP && window . get_monitor ( ) === this . monitorIndex ) {
3782+ window . activate ( global . display . get_current_time ( ) ) ;
3783+ return ;
3784+ }
37853785 }
3786+ } ,
37863787
3787- this . _mouseEntered = false ;
3788- this . _updatePanelVisibility ( ) ;
3788+ _mouseOnPanel : function ( ) {
3789+ this . actor . sync_hover ( ) ;
3790+ const [ x , y ] = global . get_pointer ( ) ;
3791+
3792+ return ( this . actor . x <= x && x <= this . actor . x + this . actor . width &&
3793+ this . actor . y <= y && y <= this . actor . y + this . actor . height ) ;
37893794 } ,
37903795
3791- _eventOnPanelStrip : function ( x , y ) {
3792- switch ( this . panelPosition ) {
3793- case PanelLoc . top :
3794- return y === this . monitor . y ;
3795- case PanelLoc . bottom :
3796- return y === this . monitor . y + this . monitor . height - 1 ;
3797- case PanelLoc . left :
3798- return x === this . monitor . x ;
3799- case PanelLoc . right :
3800- return x === this . monitor . x + this . monitor . width - 1 ;
3796+ _enterPanel : function ( actor = null , event = null ) {
3797+ if ( ! this . _mouseEntered ) {
3798+ this . _updatePanelVisibility ( ) ;
3799+ }
3800+ } ,
3801+
3802+ _leavePanel :function ( actor = null , event = null ) {
3803+ // Panel gives false leave-event's when mouse is still on panel so we determine this._mouseEntered
3804+ // manually with this._mouseOnPanel() in this._updatePanelVisibility()
3805+
3806+ if ( this . _mouseEntered ) {
3807+ this . _updatePanelVisibility ( ) ;
3808+ if ( this . isHideable ( ) && event !== null && this . _mouseOnPanel ( ) ) {
3809+ // Since we get false leave-event's and reported mouse position is often still
3810+ // on panel even if left, we check again a short while later to make sure.
3811+ setTimeout ( this . _updatePanelVisibility . bind ( this ) , 250 ) ;
3812+ }
38013813 }
38023814 } ,
38033815
@@ -3809,7 +3821,6 @@ Panel.prototype = {
38093821 */
38103822 disable : function ( ) {
38113823 this . _disabled = true ;
3812- this . _leavePanel ( ) ;
38133824 this . actor . ease ( {
38143825 opacity : 0 ,
38153826 duration : AUTOHIDE_ANIMATION_TIME * 1000 ,
@@ -3904,18 +3915,14 @@ Panel.prototype = {
39043915
39053916 /**
39063917 * _hidePanel:
3907- * @force (boolean): whether or not to force the hide.
39083918 *
3909- * This hides the panel unless this._shouldShow is false. This behaviour is
3910- * overridden if the @force argument is set to true. However, the panel
3911- * will always not be hidden if a menu is open, regardless of the value of
3912- * @force .
3919+ * This hides the panel.
39133920 */
3914- _hidePanel : function ( force ) {
3921+ _hidePanel : function ( ) {
39153922 if ( this . _destroyed ) return ;
39163923 this . _showHideTimer = 0 ;
39173924
3918- if ( ( this . _shouldShow && ! force ) || this . _panelHasOpenMenus ( ) ) return ;
3925+ if ( this . _hidden ) return ;
39193926
39203927 // setup panel tween - slide out the monitor edge leaving one pixel
39213928 // if horizontal panel, animation on y. if vertical, animation on x.
@@ -3973,7 +3980,7 @@ Panel.prototype = {
39733980 } ,
39743981
39753982 getIsVisible : function ( ) {
3976- return ! this . _hidden ;
3983+ return ! this . _hidden || this . _shouldShow ;
39773984 } ,
39783985
39793986 resetDNDZones : function ( ) {
0 commit comments