2017-01-03 01:05:30 +03:00
/*
* Copyright 2016 Smith AR < audoban @ openmailbox . org >
* Michail Vourlakos < mvourlakos @ gmail . com >
*
* This file is part of Latte - Dock
*
* Latte - Dock is free software ; you can redistribute it and / or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation ; either version 2 of
* the License , or ( at your option ) any later version .
*
* Latte - Dock is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program . If not , see < http : //www.gnu.org/licenses/>.
*/
2016-12-25 10:25:27 +03:00
# include "visibilitymanager.h"
2018-02-03 12:34:13 +03:00
2018-12-02 03:05:52 +03:00
// local
2018-11-29 22:30:00 +03:00
# include "positioner.h"
2018-03-28 20:39:52 +03:00
# include "screenedgeghostwindow.h"
2018-12-06 13:15:58 +03:00
# include "view.h"
2019-06-08 17:36:14 +03:00
# include "windowstracker/currentscreentracker.h"
2018-12-06 15:35:34 +03:00
# include "../lattecorona.h"
2018-08-02 14:23:01 +03:00
# include "../screenpool.h"
2019-05-09 17:12:57 +03:00
# include "../layouts/manager.h"
2019-05-11 15:43:10 +03:00
# include "../wm/abstractwindowinterface.h"
2018-12-07 19:55:35 +03:00
# include "../../liblatte2/extras.h"
2016-12-25 10:25:27 +03:00
2018-12-02 03:05:52 +03:00
// Qt
# include <QDebug>
// KDE
2019-04-12 19:08:00 +03:00
# include <KWindowSystem>
2018-03-28 20:39:52 +03:00
# include <KWayland/Client/plasmashell.h>
# include <KWayland/Client/surface.h>
2019-07-30 18:00:33 +03:00
//! Hide Timer can create cases that when it is low it does not allow the
//! view to be show. For example !compositing+kwin_edges+hide inteval<50ms
const int HIDEMINIMUMINTERVAL = 50 ;
2016-12-29 08:40:35 +03:00
namespace Latte {
2018-12-09 01:29:35 +03:00
namespace ViewPart {
2016-12-25 10:25:27 +03:00
2018-12-20 19:59:38 +03:00
//! BEGIN: VisiblityManager implementation
VisibilityManager : : VisibilityManager ( PlasmaQuick : : ContainmentView * view )
: QObject ( view )
2016-12-29 08:40:35 +03:00
{
2018-12-20 19:59:38 +03:00
qDebug ( ) < < " VisibilityManager creating... " ;
2018-12-06 13:51:15 +03:00
m_latteView = qobject_cast < Latte : : View * > ( view ) ;
2018-12-06 15:35:34 +03:00
m_corona = qobject_cast < Latte : : Corona * > ( view - > corona ( ) ) ;
2019-04-23 10:54:53 +03:00
m_wm = m_corona - > wm ( ) ;
2017-01-16 22:07:49 +03:00
2019-05-02 00:10:29 +03:00
connect ( this , & VisibilityManager : : slideInFinished , this , & VisibilityManager : : updateHiddenState ) ;
2019-05-11 09:08:18 +03:00
connect ( this , & VisibilityManager : : slideOutFinished , this , & VisibilityManager : : updateHiddenState ) ;
2019-05-02 00:10:29 +03:00
2019-07-16 14:06:26 +03:00
connect ( this , & VisibilityManager : : enableKWinEdgesChanged , this , & VisibilityManager : : updateKWinEdgesSupport ) ;
connect ( this , & VisibilityManager : : modeChanged , this , & VisibilityManager : : updateKWinEdgesSupport ) ;
2018-12-06 13:51:15 +03:00
if ( m_latteView ) {
2018-12-20 19:59:38 +03:00
connect ( m_latteView , & Latte : : View : : eventTriggered , this , & VisibilityManager : : viewEventManager ) ;
2019-06-20 10:25:18 +03:00
connect ( m_latteView , & Latte : : View : : byPassWMChanged , this , & VisibilityManager : : updateKWinEdgesSupport ) ;
2019-04-23 10:41:35 +03:00
connect ( m_latteView , & Latte : : View : : absoluteGeometryChanged , this , [ & ] ( ) {
if ( m_mode = = Types : : AlwaysVisible & & m_latteView - > screen ( ) ) {
updateStrutsBasedOnLayoutsAndActivities ( ) ;
}
} ) ;
2019-12-26 22:58:21 +03:00
connect ( m_latteView , & Latte : : View : : inEditModeChanged , this , & VisibilityManager : : initViewFlags ) ;
2017-01-16 22:07:49 +03:00
2019-04-12 18:55:45 +03:00
connect ( this , & VisibilityManager : : modeChanged , this , [ & ] ( ) {
2019-12-28 14:59:36 +03:00
emit m_latteView - > availableScreenRectChangedFrom ( m_latteView ) ;
2019-04-12 18:55:45 +03:00
} ) ;
2018-12-20 19:59:38 +03:00
}
m_timerStartUp . setInterval ( 5000 ) ;
m_timerStartUp . setSingleShot ( true ) ;
m_timerShow . setSingleShot ( true ) ;
m_timerHide . setSingleShot ( true ) ;
2019-02-07 21:24:52 +03:00
2018-12-20 19:59:38 +03:00
connect ( & m_timerShow , & QTimer : : timeout , this , [ & ] ( ) {
2019-12-27 14:38:22 +03:00
if ( m_isHidden | | m_isBelowLayer ) {
2017-01-28 20:34:03 +03:00
// qDebug() << "must be shown";
2018-12-20 19:59:38 +03:00
emit mustBeShown ( ) ;
2017-01-02 09:04:10 +03:00
}
} ) ;
2018-12-20 19:59:38 +03:00
connect ( & m_timerHide , & QTimer : : timeout , this , [ & ] ( ) {
2019-12-27 14:38:22 +03:00
if ( ! m_blockHiding & & ! m_isHidden & & ! m_isBelowLayer & & ! m_dragEnter ) {
2017-01-28 20:34:03 +03:00
// qDebug() << "must be hide";
2018-12-20 19:59:38 +03:00
emit mustBeHide ( ) ;
2017-01-02 09:04:10 +03:00
}
} ) ;
2019-04-23 10:20:08 +03:00
2017-02-27 02:43:48 +03:00
restoreConfig ( ) ;
2016-12-29 08:40:35 +03:00
}
2016-12-25 10:25:27 +03:00
2018-12-20 19:59:38 +03:00
VisibilityManager : : ~ VisibilityManager ( )
2016-12-25 10:25:27 +03:00
{
2018-12-20 19:59:38 +03:00
qDebug ( ) < < " VisibilityManager deleting... " ;
2019-04-23 10:54:53 +03:00
m_wm - > removeViewStruts ( * m_latteView ) ;
2018-03-28 20:39:52 +03:00
2019-04-23 10:54:53 +03:00
if ( m_edgeGhostWindow ) {
m_edgeGhostWindow - > deleteLater ( ) ;
2018-03-28 20:39:52 +03:00
}
2016-12-25 10:25:27 +03:00
}
2018-12-20 19:59:38 +03:00
Types : : Visibility VisibilityManager : : mode ( ) const
2016-12-25 10:25:27 +03:00
{
2018-12-20 19:59:38 +03:00
return m_mode ;
}
2019-12-26 22:58:21 +03:00
void VisibilityManager : : initViewFlags ( )
{
2019-12-27 14:38:22 +03:00
if ( ( m_mode = = Types : : WindowsCanCover | | m_mode = = Types : : WindowsAlwaysCover ) & & ( ! m_latteView - > inEditMode ( ) ) ) {
setViewOnBackLayer ( ) ;
2019-12-26 22:58:21 +03:00
} else {
2019-12-27 14:38:22 +03:00
setViewOnFrontLayer ( ) ;
2019-12-26 22:58:21 +03:00
}
}
2019-12-27 14:38:22 +03:00
void VisibilityManager : : setViewOnBackLayer ( )
{
m_wm - > setViewExtraFlags ( m_latteView , false , Types : : WindowsAlwaysCover ) ;
setIsBelowLayer ( true ) ;
}
void VisibilityManager : : setViewOnFrontLayer ( )
{
m_wm - > setViewExtraFlags ( m_latteView , true ) ;
setIsBelowLayer ( false ) ;
}
2018-12-20 19:59:38 +03:00
void VisibilityManager : : setMode ( Latte : : Types : : Visibility mode )
{
if ( m_mode = = mode )
2016-12-30 10:17:38 +03:00
return ;
2017-01-16 22:07:49 +03:00
2019-05-01 20:19:39 +03:00
Q_ASSERT_X ( mode ! = Types : : None , staticMetaObject . className ( ) , " set visibility to Types::None " ) ;
2017-02-27 02:43:48 +03:00
2016-12-30 10:17:38 +03:00
// clear mode
2019-04-23 10:54:53 +03:00
for ( auto & c : m_connections ) {
2016-12-30 10:17:38 +03:00
disconnect ( c ) ;
}
2017-01-16 22:07:49 +03:00
2019-04-23 10:20:08 +03:00
int base { 0 } ;
2019-05-01 23:26:56 +03:00
m_publishedStruts = QRect ( ) ;
2018-12-20 19:59:38 +03:00
if ( m_mode = = Types : : AlwaysVisible ) {
2019-04-23 10:20:08 +03:00
//! remove struts for old always visible mode
2019-04-23 10:54:53 +03:00
m_wm - > removeViewStruts ( * m_latteView ) ;
2019-04-23 10:20:08 +03:00
}
m_timerShow . stop ( ) ;
m_timerHide . stop ( ) ;
m_mode = mode ;
2019-12-26 22:58:21 +03:00
initViewFlags ( ) ;
2019-12-26 22:10:11 +03:00
2019-04-23 10:20:08 +03:00
if ( mode ! = Types : : AlwaysVisible & & mode ! = Types : : WindowsGoBelow ) {
2019-05-11 15:43:10 +03:00
m_connections [ 0 ] = connect ( m_wm , & WindowSystem : : AbstractWindowInterface : : currentDesktopChanged , this , [ & ] {
2019-04-23 10:54:53 +03:00
if ( m_raiseOnDesktopChange ) {
2018-12-06 17:17:35 +03:00
raiseViewTemporarily ( ) ;
2019-04-23 10:54:53 +03:00
}
2017-03-12 12:01:27 +03:00
} ) ;
2019-05-11 15:43:10 +03:00
m_connections [ 1 ] = connect ( m_wm , & WindowSystem : : AbstractWindowInterface : : currentActivityChanged , this , [ & ] ( ) {
2019-04-23 10:54:53 +03:00
if ( m_raiseOnActivityChange ) {
2018-12-06 17:17:35 +03:00
raiseViewTemporarily ( ) ;
2019-04-23 10:54:53 +03:00
} else {
2017-03-12 23:14:30 +03:00
updateHiddenState ( ) ;
2019-04-23 10:54:53 +03:00
}
2017-03-12 12:01:27 +03:00
} ) ;
2019-04-23 10:20:08 +03:00
base = 2 ;
}
2017-01-16 22:07:49 +03:00
2018-12-20 19:59:38 +03:00
switch ( m_mode ) {
2019-05-01 21:31:33 +03:00
case Types : : AlwaysVisible : {
if ( m_latteView - > containment ( ) & & m_latteView - > screen ( ) ) {
updateStrutsBasedOnLayoutsAndActivities ( ) ;
}
2019-08-08 09:46:23 +03:00
m_connections [ base ] = connect ( m_latteView , & Latte : : View : : normalThicknessChanged , this , [ & ] ( ) {
updateStrutsBasedOnLayoutsAndActivities ( ) ;
} ) ;
2019-05-01 21:31:33 +03:00
2019-08-08 09:46:23 +03:00
m_connections [ base + 1 ] = connect ( m_corona - > layoutsManager ( ) , & Layouts : : Manager : : currentLayoutNameChanged , this , [ & ] ( ) {
2019-05-09 17:12:57 +03:00
if ( m_corona & & m_corona - > layoutsManager ( ) - > memoryUsage ( ) = = Types : : MultipleLayouts ) {
2019-05-14 17:56:22 +03:00
updateStrutsBasedOnLayoutsAndActivities ( true ) ;
2017-03-23 08:03:45 +03:00
}
2019-05-01 21:31:33 +03:00
} ) ;
2017-01-16 22:07:49 +03:00
2019-08-08 09:46:23 +03:00
m_connections [ base + 2 ] = connect ( m_latteView , & Latte : : View : : activitiesChanged , this , [ & ] ( ) {
2019-05-09 17:12:57 +03:00
if ( m_corona & & m_corona - > layoutsManager ( ) - > memoryUsage ( ) = = Types : : MultipleLayouts ) {
2019-05-14 17:56:22 +03:00
updateStrutsBasedOnLayoutsAndActivities ( true ) ;
2018-01-13 20:27:32 +03:00
}
2019-05-01 21:31:33 +03:00
} ) ;
2018-01-13 20:27:32 +03:00
2019-05-01 21:31:33 +03:00
raiseView ( true ) ;
2016-12-30 10:17:38 +03:00
break ;
2019-05-01 21:31:33 +03:00
}
2017-01-16 22:07:49 +03:00
2019-05-01 21:31:33 +03:00
case Types : : AutoHide : {
m_connections [ base ] = connect ( this , & VisibilityManager : : containsMouseChanged , this , [ & ] ( ) {
2018-12-20 19:59:38 +03:00
raiseView ( m_containsMouse ) ;
2019-05-01 21:31:33 +03:00
} ) ;
raiseView ( m_containsMouse ) ;
2016-12-30 10:17:38 +03:00
break ;
2019-05-01 21:31:33 +03:00
}
2017-01-16 22:07:49 +03:00
2019-05-01 21:31:33 +03:00
case Types : : DodgeActive : {
m_connections [ base ] = connect ( this , & VisibilityManager : : containsMouseChanged
, this , & VisibilityManager : : dodgeActive ) ;
2019-06-08 17:36:14 +03:00
m_connections [ base + 1 ] = connect ( m_latteView - > windowsTracker ( ) - > currentScreen ( ) , & TrackerPart : : CurrentScreenTracker : : activeWindowTouchingChanged
2019-05-01 21:31:33 +03:00
, this , & VisibilityManager : : dodgeActive ) ;
2019-04-23 09:58:06 +03:00
2019-05-01 21:31:33 +03:00
dodgeActive ( ) ;
2016-12-30 10:24:04 +03:00
break ;
2019-05-01 21:31:33 +03:00
}
2017-01-16 22:07:49 +03:00
2019-05-01 21:31:33 +03:00
case Types : : DodgeMaximized : {
m_connections [ base ] = connect ( this , & VisibilityManager : : containsMouseChanged
, this , & VisibilityManager : : dodgeMaximized ) ;
2019-06-08 17:36:14 +03:00
m_connections [ base + 1 ] = connect ( m_latteView - > windowsTracker ( ) - > currentScreen ( ) , & TrackerPart : : CurrentScreenTracker : : activeWindowMaximizedChanged
2019-06-03 19:20:06 +03:00
, this , & VisibilityManager : : dodgeMaximized ) ;
2019-04-23 09:58:06 +03:00
2019-05-01 21:31:33 +03:00
dodgeMaximized ( ) ;
2016-12-30 10:24:04 +03:00
break ;
2019-05-01 21:31:33 +03:00
}
2017-01-16 22:07:49 +03:00
2019-05-01 21:31:33 +03:00
case Types : : DodgeAllWindows : {
m_connections [ base ] = connect ( this , & VisibilityManager : : containsMouseChanged
, this , & VisibilityManager : : dodgeAllWindows ) ;
2017-01-16 22:07:49 +03:00
2019-06-08 17:36:14 +03:00
m_connections [ base + 1 ] = connect ( m_latteView - > windowsTracker ( ) - > currentScreen ( ) , & TrackerPart : : CurrentScreenTracker : : existsWindowTouchingChanged
2019-05-01 21:31:33 +03:00
, this , & VisibilityManager : : dodgeAllWindows ) ;
2019-06-03 19:16:48 +03:00
dodgeAllWindows ( ) ;
2017-02-12 11:01:12 +03:00
break ;
2019-05-01 21:31:33 +03:00
}
2017-06-04 02:43:52 +03:00
2019-05-01 21:31:33 +03:00
case Types : : WindowsGoBelow :
2019-04-23 10:20:08 +03:00
break ;
2017-06-09 01:10:49 +03:00
2019-12-26 22:10:11 +03:00
case Types : : WindowsCanCover :
2019-12-27 14:38:22 +03:00
m_connections [ base ] = connect ( this , & VisibilityManager : : containsMouseChanged , this , [ & ] ( ) {
2019-12-27 15:20:31 +03:00
if ( m_containsMouse ) {
emit mustBeShown ( ) ;
} else {
raiseView ( false ) ;
}
2019-12-27 14:38:22 +03:00
} ) ;
raiseView ( m_containsMouse ) ;
2019-12-26 22:10:11 +03:00
break ;
2019-12-26 18:21:03 +03:00
case Types : : WindowsAlwaysCover :
break ;
2019-05-01 21:31:33 +03:00
default :
2019-04-23 10:20:08 +03:00
break ;
2016-12-30 10:17:38 +03:00
}
2017-01-16 22:07:49 +03:00
2018-12-20 19:59:38 +03:00
m_latteView - > containment ( ) - > config ( ) . writeEntry ( " visibility " , static_cast < int > ( m_mode ) ) ;
2017-03-12 12:01:27 +03:00
2018-03-28 20:39:52 +03:00
updateKWinEdgesSupport ( ) ;
2018-12-20 19:59:38 +03:00
emit modeChanged ( ) ;
2017-03-12 12:01:27 +03:00
}
2019-05-14 17:56:22 +03:00
void VisibilityManager : : updateStrutsBasedOnLayoutsAndActivities ( bool forceUpdate )
2018-01-13 21:00:03 +03:00
{
2019-05-09 17:12:57 +03:00
bool multipleLayoutsAndCurrent = ( m_corona - > layoutsManager ( ) - > memoryUsage ( ) = = Types : : MultipleLayouts
2019-05-08 23:42:06 +03:00
& & m_latteView - > layout ( ) & & ! m_latteView - > positioner ( ) - > inLocationChangeAnimation ( )
& & m_latteView - > layout ( ) - > isCurrent ( ) ) ;
2018-01-13 21:00:03 +03:00
2019-05-09 17:12:57 +03:00
if ( m_corona - > layoutsManager ( ) - > memoryUsage ( ) = = Types : : SingleLayout | | multipleLayoutsAndCurrent ) {
2019-05-01 23:04:39 +03:00
QRect computedStruts = acceptableStruts ( ) ;
2019-05-14 17:56:22 +03:00
if ( m_publishedStruts ! = computedStruts | | forceUpdate ) {
//! Force update is needed when very important events happen in DE and there is a chance
//! that previously even though struts where sent the DE did not accept them.
//! Such a case is when STOPPING an Activity and windows faulty become invisible even
//! though they should not. In such case setting struts when the windows are hidden
//! the struts do not take any effect
2019-05-01 23:04:39 +03:00
m_publishedStruts = computedStruts ;
m_wm - > setViewStruts ( * m_latteView , m_publishedStruts , m_latteView - > location ( ) ) ;
}
2018-01-13 21:00:03 +03:00
} else {
2019-05-03 02:39:21 +03:00
m_publishedStruts = QRect ( ) ;
2019-04-23 10:54:53 +03:00
m_wm - > removeViewStruts ( * m_latteView ) ;
2018-01-13 21:00:03 +03:00
}
}
2019-05-01 23:04:39 +03:00
QRect VisibilityManager : : acceptableStruts ( )
{
QRect calcs ;
2019-12-24 21:35:48 +03:00
int screenEdgeMargin = ( m_latteView - > behaveAsPlasmaPanel ( ) & & m_latteView - > screenEdgeMarginEnabled ( ) ) ? m_latteView - > screenEdgeMargin ( ) : 0 ;
int shownThickness = m_latteView - > normalThickness ( ) + screenEdgeMargin ;
2019-05-01 23:04:39 +03:00
switch ( m_latteView - > location ( ) ) {
2019-07-30 18:00:33 +03:00
case Plasma : : Types : : TopEdge : {
2019-12-24 21:35:48 +03:00
calcs = QRect ( m_latteView - > x ( ) , m_latteView - > y ( ) , m_latteView - > width ( ) , shownThickness ) ;
2019-07-30 18:00:33 +03:00
break ;
}
2019-05-01 23:04:39 +03:00
2019-07-30 18:00:33 +03:00
case Plasma : : Types : : BottomEdge : {
2019-12-24 21:35:48 +03:00
int y = m_latteView - > y ( ) + m_latteView - > height ( ) - shownThickness ;
calcs = QRect ( m_latteView - > x ( ) , y , m_latteView - > width ( ) , shownThickness ) ;
2019-07-30 18:00:33 +03:00
break ;
}
2019-05-01 23:04:39 +03:00
2019-07-30 18:00:33 +03:00
case Plasma : : Types : : LeftEdge : {
2019-12-24 21:35:48 +03:00
calcs = QRect ( m_latteView - > x ( ) , m_latteView - > y ( ) , shownThickness , m_latteView - > height ( ) ) ;
2019-07-30 18:00:33 +03:00
break ;
}
2019-05-01 23:04:39 +03:00
2019-07-30 18:00:33 +03:00
case Plasma : : Types : : RightEdge : {
2019-12-24 21:35:48 +03:00
int x = m_latteView - > x ( ) + m_latteView - > width ( ) - shownThickness ;
calcs = QRect ( x , m_latteView - > y ( ) , shownThickness , m_latteView - > height ( ) ) ;
2019-07-30 18:00:33 +03:00
break ;
}
2019-05-01 23:04:39 +03:00
}
return calcs ;
}
2018-12-20 19:59:38 +03:00
bool VisibilityManager : : raiseOnDesktop ( ) const
{
2019-04-23 10:54:53 +03:00
return m_raiseOnDesktopChange ;
2018-12-20 19:59:38 +03:00
}
void VisibilityManager : : setRaiseOnDesktop ( bool enable )
2017-03-12 12:01:27 +03:00
{
2019-04-23 10:54:53 +03:00
if ( enable = = m_raiseOnDesktopChange )
2017-03-12 12:01:27 +03:00
return ;
2019-04-23 10:54:53 +03:00
m_raiseOnDesktopChange = enable ;
2018-12-20 19:59:38 +03:00
emit raiseOnDesktopChanged ( ) ;
2017-03-12 12:01:27 +03:00
}
2018-12-20 19:59:38 +03:00
bool VisibilityManager : : raiseOnActivity ( ) const
{
2019-04-23 10:54:53 +03:00
return m_raiseOnActivityChange ;
2018-12-20 19:59:38 +03:00
}
void VisibilityManager : : setRaiseOnActivity ( bool enable )
2017-03-12 12:01:27 +03:00
{
2019-04-23 10:54:53 +03:00
if ( enable = = m_raiseOnActivityChange )
2017-03-12 12:01:27 +03:00
return ;
2019-04-23 10:54:53 +03:00
m_raiseOnActivityChange = enable ;
2018-12-20 19:59:38 +03:00
emit raiseOnActivityChanged ( ) ;
}
2019-12-27 14:38:22 +03:00
bool VisibilityManager : : isBelowLayer ( ) const
{
return m_isBelowLayer ;
}
void VisibilityManager : : setIsBelowLayer ( bool below )
{
if ( m_isBelowLayer = = below ) {
return ;
}
m_isBelowLayer = below ;
2020-01-02 18:06:50 +03:00
updateGhostWindowState ( ) ;
2019-12-27 14:38:22 +03:00
emit isBelowLayerChanged ( ) ;
}
2018-12-20 19:59:38 +03:00
bool VisibilityManager : : isHidden ( ) const
{
return m_isHidden ;
2016-12-25 10:25:27 +03:00
}
2018-12-20 19:59:38 +03:00
void VisibilityManager : : setIsHidden ( bool isHidden )
2016-12-25 10:25:27 +03:00
{
2018-12-20 19:59:38 +03:00
if ( m_isHidden = = isHidden )
2016-12-30 10:17:38 +03:00
return ;
2017-01-16 22:07:49 +03:00
2018-12-26 18:53:17 +03:00
if ( m_blockHiding & & isHidden ) {
2017-01-02 11:06:47 +03:00
qWarning ( ) < < " isHidden property is blocked, ignoring update " ;
return ;
}
2017-01-16 22:07:49 +03:00
2018-12-20 19:59:38 +03:00
m_isHidden = isHidden ;
2018-03-28 20:39:52 +03:00
2020-01-02 19:40:44 +03:00
updateGhostWindowState ( ) ;
2018-03-28 20:39:52 +03:00
2018-12-20 19:59:38 +03:00
emit isHiddenChanged ( ) ;
2016-12-29 08:40:35 +03:00
}
2016-12-25 10:25:27 +03:00
2018-12-20 19:59:38 +03:00
bool VisibilityManager : : blockHiding ( ) const
2017-01-02 11:06:47 +03:00
{
2018-12-20 19:59:38 +03:00
return m_blockHiding ;
}
void VisibilityManager : : setBlockHiding ( bool blockHiding )
{
if ( m_blockHiding = = blockHiding ) {
2017-01-02 11:06:47 +03:00
return ;
2018-12-20 19:59:38 +03:00
}
2017-01-16 22:07:49 +03:00
2018-12-20 19:59:38 +03:00
m_blockHiding = blockHiding ;
2017-01-28 20:34:03 +03:00
// qDebug() << "blockHiding:" << blockHiding;
2017-01-16 22:07:49 +03:00
2018-12-20 19:59:38 +03:00
if ( m_blockHiding ) {
m_timerHide . stop ( ) ;
2017-01-16 22:07:49 +03:00
2018-12-20 19:59:38 +03:00
if ( m_isHidden ) {
emit mustBeShown ( ) ;
2017-01-04 03:52:31 +03:00
}
2017-01-02 11:06:47 +03:00
} else {
updateHiddenState ( ) ;
}
2017-01-16 22:07:49 +03:00
2018-12-20 19:59:38 +03:00
emit blockHidingChanged ( ) ;
}
int VisibilityManager : : timerShow ( ) const
{
return m_timerShow . interval ( ) ;
}
void VisibilityManager : : setTimerShow ( int msec )
{
2019-07-30 18:00:33 +03:00
if ( m_timerShow . interval ( ) = = msec ) {
return ;
}
2018-12-20 19:59:38 +03:00
m_timerShow . setInterval ( msec ) ;
emit timerShowChanged ( ) ;
}
int VisibilityManager : : timerHide ( ) const
{
return m_timerHide . interval ( ) ;
2017-01-02 11:06:47 +03:00
}
2018-12-20 19:59:38 +03:00
void VisibilityManager : : setTimerHide ( int msec )
2016-12-25 10:25:27 +03:00
{
2019-07-30 18:00:33 +03:00
int interval = qMax ( HIDEMINIMUMINTERVAL , msec ) ;
if ( m_timerHide . interval ( ) = = interval ) {
return ;
}
m_timerHide . setInterval ( interval ) ;
2018-12-20 19:59:38 +03:00
emit timerHideChanged ( ) ;
2016-12-25 10:25:27 +03:00
}
2018-12-20 19:59:38 +03:00
bool VisibilityManager : : supportsKWinEdges ( ) const
2016-12-25 10:25:27 +03:00
{
2019-04-23 10:54:53 +03:00
return ( m_edgeGhostWindow ! = nullptr ) ;
2016-12-25 10:25:27 +03:00
}
2019-02-24 20:09:48 +03:00
void VisibilityManager : : updateGhostWindowState ( )
{
if ( supportsKWinEdges ( ) ) {
2019-05-09 17:12:57 +03:00
bool inCurrentLayout = ( m_corona - > layoutsManager ( ) - > memoryUsage ( ) = = Types : : SingleLayout | |
( m_corona - > layoutsManager ( ) - > memoryUsage ( ) = = Types : : MultipleLayouts
2019-05-08 23:42:06 +03:00
& & m_latteView - > layout ( ) & & ! m_latteView - > positioner ( ) - > inLocationChangeAnimation ( )
2019-07-16 14:06:26 +03:00
& & m_latteView - > layout ( ) - > isCurrent ( ) ) ) ;
2019-02-24 20:09:48 +03:00
if ( inCurrentLayout ) {
2019-12-27 14:38:22 +03:00
if ( m_mode = = Latte : : Types : : WindowsCanCover ) {
2020-01-03 14:32:08 +03:00
m_wm - > setActiveEdge ( m_edgeGhostWindow , m_isBelowLayer & & ! m_containsMouse ) ;
2019-12-27 14:38:22 +03:00
} else {
2020-01-02 19:40:44 +03:00
bool viewIsFloatingAndMouseOnEdge =
m_latteView - > behaveAsPlasmaPanel ( )
& & m_latteView - > screenEdgeMarginEnabled ( )
& & m_latteView - > screenEdgeMargin ( ) > 0
& & m_edgeGhostWindow - > containsMouse ( ) ;
2020-01-03 14:32:08 +03:00
m_wm - > setActiveEdge ( m_edgeGhostWindow , ( m_isHidden & & ! m_containsMouse ) | | viewIsFloatingAndMouseOnEdge ) ;
2019-12-27 14:38:22 +03:00
}
2019-02-24 20:09:48 +03:00
} else {
2020-01-03 14:32:08 +03:00
m_wm - > setActiveEdge ( m_edgeGhostWindow , false ) ;
2019-02-24 20:09:48 +03:00
}
}
}
2019-04-12 19:08:00 +03:00
void VisibilityManager : : hide ( )
{
if ( KWindowSystem : : isPlatformX11 ( ) ) {
2019-07-15 19:39:21 +03:00
m_latteView - > hide ( ) ;
2019-04-12 19:08:00 +03:00
}
}
void VisibilityManager : : show ( )
{
if ( KWindowSystem : : isPlatformX11 ( ) ) {
2019-07-15 19:39:21 +03:00
m_latteView - > show ( ) ;
2019-04-12 19:08:00 +03:00
}
}
2018-12-20 19:59:38 +03:00
void VisibilityManager : : raiseView ( bool raise )
2016-12-25 10:25:27 +03:00
{
2018-12-20 19:59:38 +03:00
if ( m_blockHiding )
2017-03-12 20:16:23 +03:00
return ;
2016-12-29 08:40:35 +03:00
if ( raise ) {
2018-12-20 19:59:38 +03:00
m_timerHide . stop ( ) ;
2017-01-16 22:07:49 +03:00
2018-12-20 19:59:38 +03:00
if ( ! m_timerShow . isActive ( ) ) {
m_timerShow . start ( ) ;
2016-12-30 14:46:56 +03:00
}
2019-04-23 10:54:53 +03:00
} else if ( ! m_dragEnter ) {
2018-12-20 19:59:38 +03:00
m_timerShow . stop ( ) ;
2017-01-16 22:07:49 +03:00
2019-04-23 10:54:53 +03:00
if ( m_hideNow ) {
m_hideNow = false ;
2018-12-20 19:59:38 +03:00
emit mustBeHide ( ) ;
} else if ( ! m_timerHide . isActive ( ) ) {
m_timerHide . start ( ) ;
2018-11-13 20:06:33 +03:00
}
2016-12-29 08:40:35 +03:00
}
2016-12-25 10:25:27 +03:00
}
2018-12-20 19:59:38 +03:00
void VisibilityManager : : raiseViewTemporarily ( )
2017-02-12 11:01:12 +03:00
{
2019-04-23 10:54:53 +03:00
if ( m_raiseTemporarily )
2017-02-12 11:01:12 +03:00
return ;
2019-04-23 10:54:53 +03:00
m_raiseTemporarily = true ;
2018-12-20 19:59:38 +03:00
m_timerHide . stop ( ) ;
m_timerShow . stop ( ) ;
2017-02-12 11:01:12 +03:00
2018-12-20 19:59:38 +03:00
if ( m_isHidden )
emit mustBeShown ( ) ;
2017-02-12 11:01:12 +03:00
2018-12-20 19:59:38 +03:00
QTimer : : singleShot ( qBound ( 1800 , 2 * m_timerHide . interval ( ) , 3000 ) , this , [ & ] ( ) {
2019-04-23 10:54:53 +03:00
m_raiseTemporarily = false ;
m_hideNow = true ;
2017-03-08 00:26:09 +03:00
updateHiddenState ( ) ;
2017-02-12 11:01:12 +03:00
} ) ;
}
2018-12-20 19:59:38 +03:00
void VisibilityManager : : updateHiddenState ( )
2017-01-02 11:06:47 +03:00
{
2019-04-23 10:54:53 +03:00
if ( m_dragEnter )
2017-01-03 20:36:40 +03:00
return ;
2017-01-16 22:07:49 +03:00
2018-12-20 19:59:38 +03:00
switch ( m_mode ) {
2019-05-01 21:31:33 +03:00
case Types : : AutoHide :
2019-12-27 14:38:22 +03:00
case Types : : WindowsCanCover :
2020-01-02 19:40:44 +03:00
raiseView ( m_containsMouse | | ( m_edgeGhostWindow & & m_edgeGhostWindow - > containsMouse ( ) ) ) ;
2019-05-01 21:31:33 +03:00
break ;
2017-01-16 22:07:49 +03:00
2019-05-01 21:31:33 +03:00
case Types : : DodgeActive :
dodgeActive ( ) ;
break ;
2017-01-16 22:07:49 +03:00
2019-05-01 21:31:33 +03:00
case Types : : DodgeMaximized :
dodgeMaximized ( ) ;
break ;
2017-01-16 22:07:49 +03:00
2019-05-01 21:31:33 +03:00
case Types : : DodgeAllWindows :
dodgeAllWindows ( ) ;
break ;
2017-08-13 13:00:46 +03:00
2019-05-01 21:31:33 +03:00
default :
break ;
2017-01-02 11:06:47 +03:00
}
}
2018-12-20 19:59:38 +03:00
void VisibilityManager : : applyActivitiesToHiddenWindows ( const QStringList & activities )
2018-03-28 20:39:52 +03:00
{
2019-04-23 10:54:53 +03:00
if ( m_edgeGhostWindow ) {
m_wm - > setWindowOnActivities ( * m_edgeGhostWindow , activities ) ;
2018-03-28 20:39:52 +03:00
}
}
2019-04-23 09:58:06 +03:00
void VisibilityManager : : dodgeActive ( )
2016-12-25 10:25:27 +03:00
{
2019-04-23 10:54:53 +03:00
if ( m_raiseTemporarily )
2017-02-12 11:01:12 +03:00
return ;
2018-12-06 17:17:35 +03:00
//!don't send false raiseView signal when containing mouse
2018-12-20 19:59:38 +03:00
if ( m_containsMouse ) {
2018-12-06 17:17:35 +03:00
raiseView ( true ) ;
2017-08-13 13:24:32 +03:00
return ;
}
2019-06-08 17:36:14 +03:00
raiseView ( ! m_latteView - > windowsTracker ( ) - > currentScreen ( ) - > activeWindowTouching ( ) ) ;
2016-12-25 10:25:27 +03:00
}
2019-04-23 09:58:06 +03:00
void VisibilityManager : : dodgeMaximized ( )
2016-12-25 10:25:27 +03:00
{
2019-04-23 10:54:53 +03:00
if ( m_raiseTemporarily )
2017-02-12 11:01:12 +03:00
return ;
2018-12-06 17:17:35 +03:00
//!don't send false raiseView signal when containing mouse
2018-12-20 19:59:38 +03:00
if ( m_containsMouse ) {
2018-12-06 17:17:35 +03:00
raiseView ( true ) ;
2017-08-13 13:24:32 +03:00
return ;
}
2019-06-08 17:36:14 +03:00
raiseView ( ! m_latteView - > windowsTracker ( ) - > currentScreen ( ) - > activeWindowMaximized ( ) ) ;
2016-12-25 10:25:27 +03:00
}
2019-02-07 21:24:52 +03:00
void VisibilityManager : : dodgeAllWindows ( )
2016-12-25 10:25:27 +03:00
{
2019-04-23 10:54:53 +03:00
if ( m_raiseTemporarily )
2017-02-12 11:01:12 +03:00
return ;
2018-12-20 19:59:38 +03:00
if ( m_containsMouse ) {
2018-12-06 17:17:35 +03:00
raiseView ( true ) ;
2017-08-13 13:24:32 +03:00
}
2019-06-08 17:36:14 +03:00
bool windowIntersects { m_latteView - > windowsTracker ( ) - > currentScreen ( ) - > activeWindowTouching ( ) | | m_latteView - > windowsTracker ( ) - > currentScreen ( ) - > existsWindowTouching ( ) } ;
2017-01-16 22:07:49 +03:00
2019-02-07 21:24:52 +03:00
raiseView ( ! windowIntersects ) ;
2016-12-25 10:25:27 +03:00
}
2018-12-20 19:59:38 +03:00
void VisibilityManager : : saveConfig ( )
2016-12-25 10:25:27 +03:00
{
2018-12-20 19:59:38 +03:00
if ( ! m_latteView - > containment ( ) )
2016-12-30 10:17:38 +03:00
return ;
2017-01-16 22:07:49 +03:00
2018-12-20 19:59:38 +03:00
auto config = m_latteView - > containment ( ) - > config ( ) ;
2017-04-02 08:23:47 +03:00
2019-04-23 10:54:53 +03:00
config . writeEntry ( " enableKWinEdges " , m_enableKWinEdgesFromUser ) ;
2018-12-20 19:59:38 +03:00
config . writeEntry ( " timerShow " , m_timerShow . interval ( ) ) ;
config . writeEntry ( " timerHide " , m_timerHide . interval ( ) ) ;
2019-04-23 10:54:53 +03:00
config . writeEntry ( " raiseOnDesktopChange " , m_raiseOnDesktopChange ) ;
config . writeEntry ( " raiseOnActivityChange " , m_raiseOnActivityChange ) ;
2018-03-28 20:39:52 +03:00
2018-12-20 19:59:38 +03:00
m_latteView - > containment ( ) - > configNeedsSaving ( ) ;
2016-12-25 10:25:27 +03:00
}
2018-12-20 19:59:38 +03:00
void VisibilityManager : : restoreConfig ( )
2016-12-25 10:25:27 +03:00
{
2018-12-20 19:59:38 +03:00
if ( ! m_latteView | | ! m_latteView - > containment ( ) ) {
2016-12-30 10:24:04 +03:00
return ;
2018-12-20 19:59:38 +03:00
}
2017-01-16 22:07:49 +03:00
2018-12-20 19:59:38 +03:00
auto config = m_latteView - > containment ( ) - > config ( ) ;
m_timerShow . setInterval ( config . readEntry ( " timerShow " , 0 ) ) ;
2019-07-30 18:00:33 +03:00
m_timerHide . setInterval ( qMax ( HIDEMINIMUMINTERVAL , config . readEntry ( " timerHide " , 700 ) ) ) ;
2018-12-20 19:59:38 +03:00
emit timerShowChanged ( ) ;
emit timerHideChanged ( ) ;
2017-02-11 08:55:22 +03:00
2019-04-23 10:54:53 +03:00
m_enableKWinEdgesFromUser = config . readEntry ( " enableKWinEdges " , true ) ;
2018-12-20 19:59:38 +03:00
emit enableKWinEdgesChanged ( ) ;
2018-03-28 20:39:52 +03:00
2017-03-26 00:17:41 +03:00
setRaiseOnDesktop ( config . readEntry ( " raiseOnDesktopChange " , false ) ) ;
setRaiseOnActivity ( config . readEntry ( " raiseOnActivityChange " , false ) ) ;
2018-12-20 19:59:38 +03:00
auto storedMode = static_cast < Types : : Visibility > ( m_latteView - > containment ( ) - > config ( ) . readEntry ( " visibility " , static_cast < int > ( Types : : DodgeActive ) ) ) ;
2017-04-02 08:23:47 +03:00
2018-12-20 19:59:38 +03:00
if ( storedMode = = Types : : AlwaysVisible ) {
qDebug ( ) < < " Loading visibility mode: Always Visible , on startup... " ;
2018-12-07 19:55:35 +03:00
setMode ( Types : : AlwaysVisible ) ;
2017-02-12 11:01:12 +03:00
} else {
2018-12-20 19:59:38 +03:00
connect ( & m_timerStartUp , & QTimer : : timeout , this , [ & ] ( ) {
2019-05-27 10:57:16 +03:00
if ( ! m_latteView | | ! m_latteView - > containment ( ) ) {
return ;
}
2018-12-20 19:59:38 +03:00
auto fMode = static_cast < Types : : Visibility > ( m_latteView - > containment ( ) - > config ( ) . readEntry ( " visibility " , static_cast < int > ( Types : : DodgeActive ) ) ) ;
qDebug ( ) < < " Loading visibility mode: " < < fMode < < " on startup... " ;
setMode ( fMode ) ;
2017-02-11 08:55:22 +03:00
} ) ;
2018-12-20 19:59:38 +03:00
connect ( m_latteView - > containment ( ) , & Plasma : : Containment : : userConfiguringChanged
2019-05-01 21:31:33 +03:00
, this , [ & ] ( bool configuring ) {
2018-12-20 19:59:38 +03:00
if ( configuring & & m_timerStartUp . isActive ( ) )
m_timerStartUp . start ( 100 ) ;
2017-04-02 12:24:49 +03:00
} ) ;
2018-12-20 19:59:38 +03:00
m_timerStartUp . start ( ) ;
2017-02-11 08:55:22 +03:00
}
2017-03-12 12:01:27 +03:00
2018-12-20 19:59:38 +03:00
connect ( m_latteView - > containment ( ) , & Plasma : : Containment : : userConfiguringChanged
2019-05-01 21:31:33 +03:00
, this , [ & ] ( bool configuring ) {
2018-12-20 19:59:38 +03:00
if ( ! configuring ) {
2017-03-12 21:30:54 +03:00
saveConfig ( ) ;
2018-12-20 19:59:38 +03:00
}
2017-03-12 12:01:27 +03:00
} ) ;
2016-12-25 10:25:27 +03:00
}
2018-12-20 19:59:38 +03:00
bool VisibilityManager : : containsMouse ( ) const
2016-12-25 10:25:27 +03:00
{
2018-12-20 19:59:38 +03:00
return m_containsMouse ;
}
void VisibilityManager : : setContainsMouse ( bool contains )
{
if ( m_containsMouse = = contains ) {
2018-11-13 20:06:33 +03:00
return ;
}
2017-01-16 22:07:49 +03:00
2018-12-20 19:59:38 +03:00
m_containsMouse = contains ;
emit containsMouseChanged ( ) ;
2017-01-16 22:07:49 +03:00
2018-12-20 19:59:38 +03:00
if ( contains & & m_mode ! = Types : : AlwaysVisible ) {
2018-12-06 17:17:35 +03:00
raiseView ( true ) ;
2018-11-13 20:06:33 +03:00
}
}
2017-01-16 22:07:49 +03:00
2018-12-20 19:59:38 +03:00
void VisibilityManager : : viewEventManager ( QEvent * ev )
2018-11-13 20:06:33 +03:00
{
switch ( ev - > type ( ) ) {
2019-05-01 21:31:33 +03:00
case QEvent : : Enter :
setContainsMouse ( true ) ;
break ;
2017-01-16 22:07:49 +03:00
2019-05-01 21:31:33 +03:00
case QEvent : : Leave :
2019-07-10 16:23:06 +03:00
m_dragEnter = false ;
2019-05-01 21:31:33 +03:00
setContainsMouse ( false ) ;
break ;
2017-01-16 22:07:49 +03:00
2019-05-01 21:31:33 +03:00
case QEvent : : DragEnter :
m_dragEnter = true ;
2017-03-12 23:14:30 +03:00
2019-07-10 16:23:06 +03:00
if ( m_isHidden ) {
2019-05-01 21:31:33 +03:00
emit mustBeShown ( ) ;
2019-07-10 16:23:06 +03:00
}
2017-03-12 21:09:38 +03:00
2019-05-01 21:31:33 +03:00
break ;
2017-01-16 22:07:49 +03:00
2019-05-01 21:31:33 +03:00
case QEvent : : DragLeave :
case QEvent : : Drop :
m_dragEnter = false ;
updateHiddenState ( ) ;
break ;
2017-01-16 22:07:49 +03:00
2019-05-01 21:31:33 +03:00
default :
break ;
2016-12-25 10:25:27 +03:00
}
}
2017-12-24 21:54:45 +03:00
2018-03-28 20:39:52 +03:00
//! KWin Edges Support functions
2018-12-20 19:59:38 +03:00
bool VisibilityManager : : enableKWinEdges ( ) const
{
2019-04-23 10:54:53 +03:00
return m_enableKWinEdgesFromUser ;
2018-12-20 19:59:38 +03:00
}
void VisibilityManager : : setEnableKWinEdges ( bool enable )
2018-03-28 20:39:52 +03:00
{
2019-04-23 10:54:53 +03:00
if ( m_enableKWinEdgesFromUser = = enable ) {
2018-03-28 20:39:52 +03:00
return ;
}
2019-04-23 10:54:53 +03:00
m_enableKWinEdgesFromUser = enable ;
2018-03-28 20:39:52 +03:00
2018-12-20 19:59:38 +03:00
emit enableKWinEdgesChanged ( ) ;
2018-03-28 20:39:52 +03:00
}
2018-12-20 19:59:38 +03:00
void VisibilityManager : : updateKWinEdgesSupport ( )
2018-03-28 20:39:52 +03:00
{
2019-06-20 10:25:18 +03:00
if ( ( m_mode = = Types : : AutoHide
2019-07-30 18:00:33 +03:00
| | m_mode = = Types : : DodgeActive
| | m_mode = = Types : : DodgeAllWindows
2019-12-27 15:20:31 +03:00
| | m_mode = = Types : : DodgeMaximized )
& & ! m_latteView - > byPassWM ( ) ) {
2019-04-23 10:54:53 +03:00
if ( m_enableKWinEdgesFromUser ) {
2018-03-28 20:39:52 +03:00
createEdgeGhostWindow ( ) ;
2019-04-23 10:54:53 +03:00
} else if ( ! m_enableKWinEdgesFromUser ) {
2018-03-28 20:39:52 +03:00
deleteEdgeGhostWindow ( ) ;
}
2019-12-27 15:20:31 +03:00
} else if ( m_mode = = Types : : WindowsCanCover ) {
createEdgeGhostWindow ( ) ;
2019-12-27 14:38:22 +03:00
} else {
2018-03-28 20:39:52 +03:00
deleteEdgeGhostWindow ( ) ;
}
}
2018-12-20 19:59:38 +03:00
void VisibilityManager : : createEdgeGhostWindow ( )
2018-03-28 20:39:52 +03:00
{
2019-04-23 10:54:53 +03:00
if ( ! m_edgeGhostWindow ) {
m_edgeGhostWindow = new ScreenEdgeGhostWindow ( m_latteView ) ;
2018-03-28 20:39:52 +03:00
2019-04-23 10:54:53 +03:00
connect ( m_edgeGhostWindow , & ScreenEdgeGhostWindow : : containsMouseChanged , this , [ = ] ( bool contains ) {
2018-11-13 20:06:33 +03:00
if ( contains ) {
2019-02-24 20:09:48 +03:00
raiseView ( true ) ;
} else {
m_timerShow . stop ( ) ;
updateGhostWindowState ( ) ;
2018-11-13 20:06:33 +03:00
}
2018-03-28 20:39:52 +03:00
} ) ;
2019-07-10 16:23:06 +03:00
connect ( m_edgeGhostWindow , & ScreenEdgeGhostWindow : : dragEntered , this , [ & ] ( ) {
if ( m_isHidden ) {
emit mustBeShown ( ) ;
}
} ) ;
2019-05-11 15:43:10 +03:00
m_connectionsKWinEdges [ 0 ] = connect ( m_wm , & WindowSystem : : AbstractWindowInterface : : currentActivityChanged ,
2019-05-01 21:31:33 +03:00
this , [ & ] ( ) {
2019-05-09 17:12:57 +03:00
bool inCurrentLayout = ( m_corona - > layoutsManager ( ) - > memoryUsage ( ) = = Types : : SingleLayout | |
( m_corona - > layoutsManager ( ) - > memoryUsage ( ) = = Types : : MultipleLayouts
2019-05-08 23:42:06 +03:00
& & m_latteView - > layout ( ) & & ! m_latteView - > positioner ( ) - > inLocationChangeAnimation ( )
2019-07-16 14:06:26 +03:00
& & m_latteView - > layout ( ) - > isCurrent ( ) ) ) ;
2018-03-28 20:39:52 +03:00
2019-04-23 10:54:53 +03:00
if ( m_edgeGhostWindow ) {
2018-03-28 20:39:52 +03:00
if ( inCurrentLayout ) {
2020-01-03 14:32:08 +03:00
m_wm - > setActiveEdge ( m_edgeGhostWindow , m_isHidden ) ;
2018-03-28 20:39:52 +03:00
} else {
2020-01-03 14:32:08 +03:00
m_wm - > setActiveEdge ( m_edgeGhostWindow , false ) ;
2018-03-28 20:39:52 +03:00
}
}
} ) ;
2018-12-20 19:59:38 +03:00
emit supportsKWinEdgesChanged ( ) ;
2018-03-28 20:39:52 +03:00
}
}
2018-12-20 19:59:38 +03:00
void VisibilityManager : : deleteEdgeGhostWindow ( )
2018-03-28 20:39:52 +03:00
{
2019-04-23 10:54:53 +03:00
if ( m_edgeGhostWindow ) {
m_edgeGhostWindow - > deleteLater ( ) ;
m_edgeGhostWindow = nullptr ;
2018-03-28 20:39:52 +03:00
2019-04-23 10:54:53 +03:00
for ( auto & c : m_connectionsKWinEdges ) {
2018-03-28 20:39:52 +03:00
disconnect ( c ) ;
}
2018-12-20 19:59:38 +03:00
emit supportsKWinEdgesChanged ( ) ;
2018-03-28 20:39:52 +03:00
}
}
2018-10-28 11:03:22 +03:00
2016-12-29 08:40:35 +03:00
//! END: VisibilityManager implementation
2018-10-28 11:03:22 +03:00
2016-12-25 10:25:27 +03:00
}
2018-12-09 01:29:35 +03:00
}