1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-01-22 06:03:55 +03:00

468 lines
16 KiB
C
Raw Normal View History

/*
2021-05-27 15:01:00 +00:00
SPDX-FileCopyrightText: 2016 Smith AR <audoban@openmailbox.org>
SPDX-FileCopyrightText: 2016 Michail Vourlakos <mvourlakos@gmail.com>
SPDX-License-Identifier: GPL-2.0-or-later
2017-01-02 17:05:30 -05:00
*/
#ifndef VIEW_H
#define VIEW_H
2018-12-02 02:05:52 +02:00
// local
#include <coretypes.h>
#include "containmentinterface.h"
#include "effects.h"
#include "parabolic.h"
#include "positioner.h"
2020-12-29 19:32:25 +02:00
#include "eventssink.h"
#include "visibilitymanager.h"
#include "indicator/indicator.h"
#include "settings/primaryconfigview.h"
#include "windowstracker/windowstracker.h"
#include "../data/viewdata.h"
#include "../shortcuts/globalshortcuts.h"
#include "../layout/genericlayout.h"
#include "../plasma/quick/containmentview.h"
#include "../plasma/quick/configview.h"
2018-12-02 02:05:52 +02:00
// C++
#include <array>
2018-12-02 02:05:52 +02:00
// Qt
#include <QQuickView>
#include <QMenu>
#include <QMetaObject>
#include <QMimeData>
#include <QScreen>
#include <QPointer>
#include <QTimer>
namespace Plasma {
class Types;
class Corona;
class Containment;
}
namespace PlasmaQuick {
class AppletQuickItem;
}
namespace KWayland {
namespace Client {
class PlasmaShellSurface;
}
}
2016-12-30 02:20:06 -05:00
namespace Latte {
2019-04-12 18:55:45 +03:00
class Corona;
class Interfaces;
class GenericLayout;
}
namespace Latte {
class View : public PlasmaQuick::ContainmentView
2018-07-03 22:15:45 +03:00
{
Q_OBJECT
fix #96,FEATURE:AllScreens and AllSecondaryScreens --This is a HUGE FEATURE and so important for multi-screens users. It is introduced as one single commit because it reimplements plenty of infrastructure changes and it will be easier to identify newly introduced bugs. --Users can now choose for their docks and panels to belong at various screen groups. The first two screen groups introduced are AllScreens and AllSecondayScreens. In the future it might be possible to provide CustomScreensGroup that the user will be able to define specific screens in which a dock or panel should be always present. --Current solution specifies an Original dock or panel and clones/copies itself automatically to other screens. So docks and panels in other screens are just real docks and panels that reference themselves to original docks and panels. --Clones are destroyed during layout startup and are automaticaly recreated. It is suggested to export your layouts through the official Layouts Editor in order to share them because in that case clones are not included in the new generated layout file. If in any case you do not this and you share your layout with any previous versions then your clones will just appear as separate docks and panels that belong to specific screens. --Automatic syncing was introduced in order to keep up-to-date the configuration of Original docks and panels with their referenced Clones. --Automatic syncing currently works for all docks and panels settings, for all normal applets configurations and for all subcontaiments configuration such as systrays. --Automatic syncing does not work for applets inside subcontainments such as Group Plasmoid. In such case it is suggested to configure your applets inside your Group Plasmoid in the original dock or panel and afterwards to trigger a recreation for the relevant clones --Manual recreation of clones is easily possible by just choosing the dock or panel to be OnPrimary or OnSpecificScreen and rechoosing afterwards the AllScreensGroup or AllSecondaryScreensGroup
2021-12-11 17:39:44 +02:00
Q_PROPERTY(int groupId READ groupId NOTIFY groupIdChanged)
Q_PROPERTY(Latte::Types::ViewType type READ type WRITE setType NOTIFY typeChanged)
Q_PROPERTY(bool alternativesIsShown READ alternativesIsShown NOTIFY alternativesIsShownChanged)
Q_PROPERTY(bool behaveAsPlasmaPanel READ behaveAsPlasmaPanel WRITE setBehaveAsPlasmaPanel NOTIFY behaveAsPlasmaPanelChanged)
Q_PROPERTY(bool byPassWM READ byPassWM WRITE setByPassWM NOTIFY byPassWMChanged)
Q_PROPERTY(bool containsDrag READ containsDrag NOTIFY containsDragChanged)
Q_PROPERTY(bool inSettingsAdvancedMode READ inSettingsAdvancedMode NOTIFY inSettingsAdvancedModeChanged)
Q_PROPERTY(bool inEditMode READ inEditMode NOTIFY inEditModeChanged)
Q_PROPERTY(bool isPreferredForShortcuts READ isPreferredForShortcuts WRITE setIsPreferredForShortcuts NOTIFY isPreferredForShortcutsChanged)
Q_PROPERTY(bool onPrimary READ onPrimary WRITE setOnPrimary NOTIFY onPrimaryChanged)
Q_PROPERTY(bool screenEdgeMarginEnabled READ screenEdgeMarginEnabled WRITE setScreenEdgeMarginEnabled NOTIFY screenEdgeMarginEnabledChanged)
2017-01-16 14:07:49 -05:00
//! values to be used from Smart surrounding Views
Q_PROPERTY(bool isTouchingBottomViewAndIsBusy READ isTouchingBottomViewAndIsBusy WRITE setIsTouchingBottomViewAndIsBusy NOTIFY isTouchingBottomViewAndIsBusyChanged)
Q_PROPERTY(bool isTouchingTopViewAndIsBusy READ isTouchingTopViewAndIsBusy WRITE setIsTouchingTopViewAndIsBusy NOTIFY isTouchingTopViewAndIsBusyChanged)
Q_PROPERTY(int alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged)
Q_PROPERTY(int fontPixelSize READ fontPixelSize WRITE setFontPixelSize NOTIFY fontPixelSizeChanged)
Q_PROPERTY(int x READ x NOTIFY xChanged)
Q_PROPERTY(int y READ y NOTIFY yChanged)
2017-01-12 18:54:23 -05:00
Q_PROPERTY(int width READ width NOTIFY widthChanged)
Q_PROPERTY(int height READ height NOTIFY heightChanged)
Q_PROPERTY(int editThickness READ editThickness NOTIFY editThicknessChanged)
Q_PROPERTY(int maxThickness READ maxThickness WRITE setMaxThickness NOTIFY maxThicknessChanged)
Q_PROPERTY(int normalThickness READ normalThickness WRITE setNormalThickness NOTIFY normalThicknessChanged)
2021-01-06 21:43:15 +02:00
Q_PROPERTY(int maxNormalThickness READ maxNormalThickness WRITE setMaxNormalThickness NOTIFY maxNormalThicknessChanged)
Q_PROPERTY(int headThicknessGap READ headThicknessGap WRITE setHeadThicknessGap NOTIFY headThicknessGapChanged)
Q_PROPERTY(int screenEdgeMargin READ screenEdgeMargin WRITE setScreenEdgeMargin NOTIFY screenEdgeMarginChanged)
Q_PROPERTY(float maxLength READ maxLength WRITE setMaxLength NOTIFY maxLengthChanged)
Q_PROPERTY(float offset READ offset WRITE setOffset NOTIFY offsetChanged)
2021-04-01 11:00:59 +03:00
Q_PROPERTY(QString name READ name NOTIFY nameChanged)
Q_PROPERTY(QQuickItem *colorizer READ colorizer WRITE setColorizer NOTIFY colorizerChanged)
Q_PROPERTY(QQuickItem *metrics READ metrics WRITE setMetrics NOTIFY metricsChanged)
Q_PROPERTY(QVariantList containmentActions READ containmentActions NOTIFY containmentActionsChanged)
Q_PROPERTY(Latte::Layout::GenericLayout *layout READ layout WRITE setLayout NOTIFY layoutChanged)
Q_PROPERTY(Latte::ViewPart::Effects *effects READ effects NOTIFY effectsChanged)
Q_PROPERTY(Latte::ViewPart::ContainmentInterface *extendedInterface READ extendedInterface NOTIFY extendedInterfaceChanged)
Q_PROPERTY(Latte::ViewPart::Indicator *indicator READ indicator NOTIFY indicatorChanged)
Q_PROPERTY(Latte::ViewPart::Parabolic *parabolic READ parabolic NOTIFY parabolicChanged)
Q_PROPERTY(Latte::ViewPart::Positioner *positioner READ positioner NOTIFY positionerChanged)
2020-12-29 19:32:25 +02:00
Q_PROPERTY(Latte::ViewPart::EventsSink *sink READ sink NOTIFY sinkChanged)
Q_PROPERTY(Latte::ViewPart::VisibilityManager *visibility READ visibility NOTIFY visibilityChanged)
Q_PROPERTY(Latte::ViewPart::WindowsTracker *windowsTracker READ windowsTracker NOTIFY windowsTrackerChanged)
Q_PROPERTY(Latte::Interfaces *interfacesGraphicObj READ interfacesGraphicObj WRITE setInterfacesGraphicObj NOTIFY interfacesGraphicObjChanged)
Q_PROPERTY(QRect absoluteGeometry READ absoluteGeometry NOTIFY absoluteGeometryChanged)
2017-03-09 15:49:24 +02:00
Q_PROPERTY(QRect localGeometry READ localGeometry WRITE setLocalGeometry NOTIFY localGeometryChanged)
Q_PROPERTY(QRect screenGeometry READ screenGeometry NOTIFY screenGeometryChanged)
public:
View(Plasma::Corona *corona, QScreen *targetScreen = nullptr, bool byPassX11WM = false);
virtual ~View();
2017-01-16 14:07:49 -05:00
void init(Plasma::Containment *plasma_containment = nullptr);
2017-01-16 14:07:49 -05:00
Types::ViewType type() const;
void setType(Types::ViewType type);
bool alternativesIsShown() const;
void setAlternativesIsShown(bool show);
bool inDelete() const;
bool inReadyState() const;
bool onPrimary() const;
void setOnPrimary(bool flag);
bool behaveAsPlasmaPanel() const;
void setBehaveAsPlasmaPanel(bool behavior);
bool containsDrag() const;
bool containsMouse() const;
bool byPassWM() const;
void setByPassWM(bool bypass);
bool inEditMode() const;
2020-07-28 23:50:05 +03:00
bool isFloatingPanel() const;
fix #96,FEATURE:AllScreens and AllSecondaryScreens --This is a HUGE FEATURE and so important for multi-screens users. It is introduced as one single commit because it reimplements plenty of infrastructure changes and it will be easier to identify newly introduced bugs. --Users can now choose for their docks and panels to belong at various screen groups. The first two screen groups introduced are AllScreens and AllSecondayScreens. In the future it might be possible to provide CustomScreensGroup that the user will be able to define specific screens in which a dock or panel should be always present. --Current solution specifies an Original dock or panel and clones/copies itself automatically to other screens. So docks and panels in other screens are just real docks and panels that reference themselves to original docks and panels. --Clones are destroyed during layout startup and are automaticaly recreated. It is suggested to export your layouts through the official Layouts Editor in order to share them because in that case clones are not included in the new generated layout file. If in any case you do not this and you share your layout with any previous versions then your clones will just appear as separate docks and panels that belong to specific screens. --Automatic syncing was introduced in order to keep up-to-date the configuration of Original docks and panels with their referenced Clones. --Automatic syncing currently works for all docks and panels settings, for all normal applets configurations and for all subcontaiments configuration such as systrays. --Automatic syncing does not work for applets inside subcontainments such as Group Plasmoid. In such case it is suggested to configure your applets inside your Group Plasmoid in the original dock or panel and afterwards to trigger a recreation for the relevant clones --Manual recreation of clones is easily possible by just choosing the dock or panel to be OnPrimary or OnSpecificScreen and rechoosing afterwards the AllScreensGroup or AllSecondaryScreensGroup
2021-12-11 17:39:44 +02:00
virtual bool isPreferredForShortcuts() const;
void setIsPreferredForShortcuts(bool preferred);
bool inSettingsAdvancedMode() const;
bool isTouchingBottomViewAndIsBusy() const;
void setIsTouchingBottomViewAndIsBusy(bool touchAndBusy);
bool isTouchingTopViewAndIsBusy() const;
void setIsTouchingTopViewAndIsBusy(bool touchAndBusy);
bool screenEdgeMarginEnabled() const;
void setScreenEdgeMarginEnabled(bool enabled);
fix #96,FEATURE:AllScreens and AllSecondaryScreens --This is a HUGE FEATURE and so important for multi-screens users. It is introduced as one single commit because it reimplements plenty of infrastructure changes and it will be easier to identify newly introduced bugs. --Users can now choose for their docks and panels to belong at various screen groups. The first two screen groups introduced are AllScreens and AllSecondayScreens. In the future it might be possible to provide CustomScreensGroup that the user will be able to define specific screens in which a dock or panel should be always present. --Current solution specifies an Original dock or panel and clones/copies itself automatically to other screens. So docks and panels in other screens are just real docks and panels that reference themselves to original docks and panels. --Clones are destroyed during layout startup and are automaticaly recreated. It is suggested to export your layouts through the official Layouts Editor in order to share them because in that case clones are not included in the new generated layout file. If in any case you do not this and you share your layout with any previous versions then your clones will just appear as separate docks and panels that belong to specific screens. --Automatic syncing was introduced in order to keep up-to-date the configuration of Original docks and panels with their referenced Clones. --Automatic syncing currently works for all docks and panels settings, for all normal applets configurations and for all subcontaiments configuration such as systrays. --Automatic syncing does not work for applets inside subcontainments such as Group Plasmoid. In such case it is suggested to configure your applets inside your Group Plasmoid in the original dock or panel and afterwards to trigger a recreation for the relevant clones --Manual recreation of clones is easily possible by just choosing the dock or panel to be OnPrimary or OnSpecificScreen and rechoosing afterwards the AllScreensGroup or AllSecondaryScreensGroup
2021-12-11 17:39:44 +02:00
virtual int groupId() const;
int fontPixelSize() const;
void setFontPixelSize(int size);
int editThickness() const;
2017-01-12 18:54:23 -05:00
int maxThickness() const;
void setMaxThickness(int thickness);
2017-01-16 14:07:49 -05:00
int normalThickness() const;
void setNormalThickness(int thickness);
2021-01-06 21:43:15 +02:00
int maxNormalThickness() const;
void setMaxNormalThickness(int thickness);
int headThicknessGap() const;
void setHeadThicknessGap(int thickness);
int screenEdgeMargin() const;
void setScreenEdgeMargin(int margin);
int alignment() const;
void setAlignment(int alignment);
float maxLength() const;
void setMaxLength(float length);
float offset() const;
void setOffset(float offset);
QRect absoluteGeometry() const;
QRect screenGeometry() const;
2017-03-09 15:49:24 +02:00
QRect localGeometry() const;
void setLocalGeometry(const QRect &geometry);
QString validTitle() const;
2021-04-01 11:00:59 +03:00
QString name() const;
void setName(const QString &newname);
bool isOnActivity(const QString &activity) const;
bool isOnAllActivities() const;
QStringList activities() const;
void setActivities(const QStringList &ids);
bool settingsWindowIsShown();
void showSettingsWindow();
QQuickItem *colorizer() const;
void setColorizer(QQuickItem *colorizer);
QQuickItem *metrics() const;
void setMetrics(QQuickItem *metrics);
fix #96,FEATURE:AllScreens and AllSecondaryScreens --This is a HUGE FEATURE and so important for multi-screens users. It is introduced as one single commit because it reimplements plenty of infrastructure changes and it will be easier to identify newly introduced bugs. --Users can now choose for their docks and panels to belong at various screen groups. The first two screen groups introduced are AllScreens and AllSecondayScreens. In the future it might be possible to provide CustomScreensGroup that the user will be able to define specific screens in which a dock or panel should be always present. --Current solution specifies an Original dock or panel and clones/copies itself automatically to other screens. So docks and panels in other screens are just real docks and panels that reference themselves to original docks and panels. --Clones are destroyed during layout startup and are automaticaly recreated. It is suggested to export your layouts through the official Layouts Editor in order to share them because in that case clones are not included in the new generated layout file. If in any case you do not this and you share your layout with any previous versions then your clones will just appear as separate docks and panels that belong to specific screens. --Automatic syncing was introduced in order to keep up-to-date the configuration of Original docks and panels with their referenced Clones. --Automatic syncing currently works for all docks and panels settings, for all normal applets configurations and for all subcontaiments configuration such as systrays. --Automatic syncing does not work for applets inside subcontainments such as Group Plasmoid. In such case it is suggested to configure your applets inside your Group Plasmoid in the original dock or panel and afterwards to trigger a recreation for the relevant clones --Manual recreation of clones is easily possible by just choosing the dock or panel to be OnPrimary or OnSpecificScreen and rechoosing afterwards the AllScreensGroup or AllSecondaryScreensGroup
2021-12-11 17:39:44 +02:00
virtual bool isCloned() const = 0; //means that this view is a clone of an original view
virtual bool isOriginal() const = 0; //means that this view is an original view that can be autocloned to other screens
virtual bool isSingle() const = 0; //means that this view is not related to clones and screen groups in any way
virtual Latte::Types::ScreensGroup screensGroup() const = 0;
QVariantList containmentActions() const;
QQuickView *configView();
fix #96,FEATURE:AllScreens and AllSecondaryScreens --This is a HUGE FEATURE and so important for multi-screens users. It is introduced as one single commit because it reimplements plenty of infrastructure changes and it will be easier to identify newly introduced bugs. --Users can now choose for their docks and panels to belong at various screen groups. The first two screen groups introduced are AllScreens and AllSecondayScreens. In the future it might be possible to provide CustomScreensGroup that the user will be able to define specific screens in which a dock or panel should be always present. --Current solution specifies an Original dock or panel and clones/copies itself automatically to other screens. So docks and panels in other screens are just real docks and panels that reference themselves to original docks and panels. --Clones are destroyed during layout startup and are automaticaly recreated. It is suggested to export your layouts through the official Layouts Editor in order to share them because in that case clones are not included in the new generated layout file. If in any case you do not this and you share your layout with any previous versions then your clones will just appear as separate docks and panels that belong to specific screens. --Automatic syncing was introduced in order to keep up-to-date the configuration of Original docks and panels with their referenced Clones. --Automatic syncing currently works for all docks and panels settings, for all normal applets configurations and for all subcontaiments configuration such as systrays. --Automatic syncing does not work for applets inside subcontainments such as Group Plasmoid. In such case it is suggested to configure your applets inside your Group Plasmoid in the original dock or panel and afterwards to trigger a recreation for the relevant clones --Manual recreation of clones is easily possible by just choosing the dock or panel to be OnPrimary or OnSpecificScreen and rechoosing afterwards the AllScreensGroup or AllSecondaryScreensGroup
2021-12-11 17:39:44 +02:00
virtual Latte::Data::View data() const;
ViewPart::Effects *effects() const;
ViewPart::ContainmentInterface *extendedInterface() const;
fix #96,FEATURE:AllScreens and AllSecondaryScreens --This is a HUGE FEATURE and so important for multi-screens users. It is introduced as one single commit because it reimplements plenty of infrastructure changes and it will be easier to identify newly introduced bugs. --Users can now choose for their docks and panels to belong at various screen groups. The first two screen groups introduced are AllScreens and AllSecondayScreens. In the future it might be possible to provide CustomScreensGroup that the user will be able to define specific screens in which a dock or panel should be always present. --Current solution specifies an Original dock or panel and clones/copies itself automatically to other screens. So docks and panels in other screens are just real docks and panels that reference themselves to original docks and panels. --Clones are destroyed during layout startup and are automaticaly recreated. It is suggested to export your layouts through the official Layouts Editor in order to share them because in that case clones are not included in the new generated layout file. If in any case you do not this and you share your layout with any previous versions then your clones will just appear as separate docks and panels that belong to specific screens. --Automatic syncing was introduced in order to keep up-to-date the configuration of Original docks and panels with their referenced Clones. --Automatic syncing currently works for all docks and panels settings, for all normal applets configurations and for all subcontaiments configuration such as systrays. --Automatic syncing does not work for applets inside subcontainments such as Group Plasmoid. In such case it is suggested to configure your applets inside your Group Plasmoid in the original dock or panel and afterwards to trigger a recreation for the relevant clones --Manual recreation of clones is easily possible by just choosing the dock or panel to be OnPrimary or OnSpecificScreen and rechoosing afterwards the AllScreensGroup or AllSecondaryScreensGroup
2021-12-11 17:39:44 +02:00
virtual ViewPart::Indicator *indicator() const;
ViewPart::Parabolic *parabolic() const;
ViewPart::Positioner *positioner() const;
2020-12-29 19:32:25 +02:00
ViewPart::EventsSink *sink() const;
ViewPart::VisibilityManager *visibility() const;
ViewPart::WindowsTracker *windowsTracker() const;
2017-01-16 14:07:49 -05:00
Latte::Interfaces *interfacesGraphicObj() const;
void setInterfacesGraphicObj(Latte::Interfaces *ifaces);
Layout::GenericLayout *layout() const;
void setLayout(Layout::GenericLayout *layout);
KWayland::Client::PlasmaShellSurface *surface();
//! release grab and restore mouse state
void unblockMouse(int x, int y);
fix #96,FEATURE:AllScreens and AllSecondaryScreens --This is a HUGE FEATURE and so important for multi-screens users. It is introduced as one single commit because it reimplements plenty of infrastructure changes and it will be easier to identify newly introduced bugs. --Users can now choose for their docks and panels to belong at various screen groups. The first two screen groups introduced are AllScreens and AllSecondayScreens. In the future it might be possible to provide CustomScreensGroup that the user will be able to define specific screens in which a dock or panel should be always present. --Current solution specifies an Original dock or panel and clones/copies itself automatically to other screens. So docks and panels in other screens are just real docks and panels that reference themselves to original docks and panels. --Clones are destroyed during layout startup and are automaticaly recreated. It is suggested to export your layouts through the official Layouts Editor in order to share them because in that case clones are not included in the new generated layout file. If in any case you do not this and you share your layout with any previous versions then your clones will just appear as separate docks and panels that belong to specific screens. --Automatic syncing was introduced in order to keep up-to-date the configuration of Original docks and panels with their referenced Clones. --Automatic syncing currently works for all docks and panels settings, for all normal applets configurations and for all subcontaiments configuration such as systrays. --Automatic syncing does not work for applets inside subcontainments such as Group Plasmoid. In such case it is suggested to configure your applets inside your Group Plasmoid in the original dock or panel and afterwards to trigger a recreation for the relevant clones --Manual recreation of clones is easily possible by just choosing the dock or panel to be OnPrimary or OnSpecificScreen and rechoosing afterwards the AllScreensGroup or AllSecondaryScreensGroup
2021-12-11 17:39:44 +02:00
virtual void reconsiderScreen();
2017-01-16 14:07:49 -05:00
//! these are signals that create crashes, such a example is the availableScreenRectChanged from corona
//! when its containment is destroyed
void disconnectSensitiveSignals();
//! used from ViewSettingsFactory in order to move Configuration Windows to different View
void releaseConfigView();
public slots:
Q_INVOKABLE void newView(const QString &templateFile);
Q_INVOKABLE void removeView();
2021-02-28 17:27:04 +02:00
Q_INVOKABLE void duplicateView();
Q_INVOKABLE void exportTemplate();
Q_INVOKABLE bool mimeContainsPlasmoid(QMimeData *mimeData, QString name);
void updateAbsoluteGeometry(bool bypassChecks = false);
Q_INVOKABLE bool isHighestPriorityView();
Q_INVOKABLE QAction *action(const QString &name);
protected slots:
void showConfigurationInterface(Plasma::Applet *applet) override;
2021-01-16 19:12:42 +02:00
void showWidgetExplorer(const QPointF &point);
2017-01-16 14:07:49 -05:00
protected:
bool event(QEvent *ev) override;
2017-01-16 14:07:49 -05:00
signals:
void eventTriggered(QEvent *ev);
void mousePressed(const QPoint pos, const int button);
void mouseReleased(const QPoint pos, const int button);
void wheelScrolled(const QPoint pos, const QPoint angleDelta, const int buttons);
2017-01-16 14:07:49 -05:00
void activitiesChanged();
void alternativesIsShownChanged();
void alignmentChanged();
void behaveAsPlasmaPanelChanged();
void byPassWMChanged();
void colorizerChanged();
void configWindowGeometryChanged(); // is called from config windows
void containmentActionsChanged();
void containsDragChanged();
void dockLocationChanged();
void editThicknessChanged();
void effectsChanged();
void extendedInterfaceChanged();
void fontPixelSizeChanged();
void forcedShown(); //[workaround] forced shown to avoid a KWin issue that hides windows when closing activities
void geometryChanged();
fix #96,FEATURE:AllScreens and AllSecondaryScreens --This is a HUGE FEATURE and so important for multi-screens users. It is introduced as one single commit because it reimplements plenty of infrastructure changes and it will be easier to identify newly introduced bugs. --Users can now choose for their docks and panels to belong at various screen groups. The first two screen groups introduced are AllScreens and AllSecondayScreens. In the future it might be possible to provide CustomScreensGroup that the user will be able to define specific screens in which a dock or panel should be always present. --Current solution specifies an Original dock or panel and clones/copies itself automatically to other screens. So docks and panels in other screens are just real docks and panels that reference themselves to original docks and panels. --Clones are destroyed during layout startup and are automaticaly recreated. It is suggested to export your layouts through the official Layouts Editor in order to share them because in that case clones are not included in the new generated layout file. If in any case you do not this and you share your layout with any previous versions then your clones will just appear as separate docks and panels that belong to specific screens. --Automatic syncing was introduced in order to keep up-to-date the configuration of Original docks and panels with their referenced Clones. --Automatic syncing currently works for all docks and panels settings, for all normal applets configurations and for all subcontaiments configuration such as systrays. --Automatic syncing does not work for applets inside subcontainments such as Group Plasmoid. In such case it is suggested to configure your applets inside your Group Plasmoid in the original dock or panel and afterwards to trigger a recreation for the relevant clones --Manual recreation of clones is easily possible by just choosing the dock or panel to be OnPrimary or OnSpecificScreen and rechoosing afterwards the AllScreensGroup or AllSecondaryScreensGroup
2021-12-11 17:39:44 +02:00
void groupIdChanged();
2017-01-12 18:54:23 -05:00
void widthChanged();
void headThicknessGapChanged();
void heightChanged();
void inEditModeChanged();
void indicatorChanged();
void inSettingsAdvancedModeChanged();
void interfacesGraphicObjChanged();
void isPreferredForShortcutsChanged();
void isTouchingBottomViewAndIsBusyChanged();
void isTouchingTopViewAndIsBusyChanged();
void layoutChanged();
2017-03-09 15:49:24 +02:00
void localGeometryChanged();
void maxLengthChanged();
void maxThicknessChanged();
void metricsChanged();
void normalThicknessChanged();
2021-01-06 21:43:15 +02:00
void maxNormalThicknessChanged();
2021-04-01 11:00:59 +03:00
void nameChanged();
void offsetChanged();
void onPrimaryChanged();
void parabolicChanged();
void positionerChanged();
void screenEdgeMarginChanged();
void screenEdgeMarginEnabledChanged();
void screenGeometryChanged();
fix #96,FEATURE:AllScreens and AllSecondaryScreens --This is a HUGE FEATURE and so important for multi-screens users. It is introduced as one single commit because it reimplements plenty of infrastructure changes and it will be easier to identify newly introduced bugs. --Users can now choose for their docks and panels to belong at various screen groups. The first two screen groups introduced are AllScreens and AllSecondayScreens. In the future it might be possible to provide CustomScreensGroup that the user will be able to define specific screens in which a dock or panel should be always present. --Current solution specifies an Original dock or panel and clones/copies itself automatically to other screens. So docks and panels in other screens are just real docks and panels that reference themselves to original docks and panels. --Clones are destroyed during layout startup and are automaticaly recreated. It is suggested to export your layouts through the official Layouts Editor in order to share them because in that case clones are not included in the new generated layout file. If in any case you do not this and you share your layout with any previous versions then your clones will just appear as separate docks and panels that belong to specific screens. --Automatic syncing was introduced in order to keep up-to-date the configuration of Original docks and panels with their referenced Clones. --Automatic syncing currently works for all docks and panels settings, for all normal applets configurations and for all subcontaiments configuration such as systrays. --Automatic syncing does not work for applets inside subcontainments such as Group Plasmoid. In such case it is suggested to configure your applets inside your Group Plasmoid in the original dock or panel and afterwards to trigger a recreation for the relevant clones --Manual recreation of clones is easily possible by just choosing the dock or panel to be OnPrimary or OnSpecificScreen and rechoosing afterwards the AllScreensGroup or AllSecondaryScreensGroup
2021-12-11 17:39:44 +02:00
2020-12-29 19:32:25 +02:00
void sinkChanged();
void typeChanged();
void visibilityChanged();
void windowsTrackerChanged();
void xChanged();
void yChanged();
2017-01-16 14:07:49 -05:00
void absoluteGeometryChanged(const QRect &geometry);
2017-01-16 14:07:49 -05:00
void indicatorPluginChanged(const QString &indicatorId);
void indicatorPluginRemoved(const QString &indicatorId);
2020-07-18 17:39:34 +03:00
void userRequestedViewType(const int &type);
//! are used to trigger the Corona relevant signals and in that
//! way we can disable any such signaling all together, e.g. through disconnectSensitiveSignals()
void availableScreenRectChangedFrom(Latte::View *origin);
void availableScreenRegionChangedFrom(Latte::View *origin);
fix #96,FEATURE:AllScreens and AllSecondaryScreens --This is a HUGE FEATURE and so important for multi-screens users. It is introduced as one single commit because it reimplements plenty of infrastructure changes and it will be easier to identify newly introduced bugs. --Users can now choose for their docks and panels to belong at various screen groups. The first two screen groups introduced are AllScreens and AllSecondayScreens. In the future it might be possible to provide CustomScreensGroup that the user will be able to define specific screens in which a dock or panel should be always present. --Current solution specifies an Original dock or panel and clones/copies itself automatically to other screens. So docks and panels in other screens are just real docks and panels that reference themselves to original docks and panels. --Clones are destroyed during layout startup and are automaticaly recreated. It is suggested to export your layouts through the official Layouts Editor in order to share them because in that case clones are not included in the new generated layout file. If in any case you do not this and you share your layout with any previous versions then your clones will just appear as separate docks and panels that belong to specific screens. --Automatic syncing was introduced in order to keep up-to-date the configuration of Original docks and panels with their referenced Clones. --Automatic syncing currently works for all docks and panels settings, for all normal applets configurations and for all subcontaiments configuration such as systrays. --Automatic syncing does not work for applets inside subcontainments such as Group Plasmoid. In such case it is suggested to configure your applets inside your Group Plasmoid in the original dock or panel and afterwards to trigger a recreation for the relevant clones --Manual recreation of clones is easily possible by just choosing the dock or panel to be OnPrimary or OnSpecificScreen and rechoosing afterwards the AllScreensGroup or AllSecondaryScreensGroup
2021-12-11 17:39:44 +02:00
protected:
QPointer<Latte::Corona> m_corona;
private slots:
void applyActivitiesToWindows();
void availableScreenRectChangedFromSlot(View *origin);
void hideWindowsForSlidingOut();
void preferredViewForShortcutsChangedSlot(Latte::View *view);
void releaseGrab();
void reloadSource();
void updateTransientWindowsTracking();
void statusChanged(Plasma::Types::ItemStatus);
2017-01-16 14:07:49 -05:00
void addTransientWindow(QWindow *window);
void removeTransientWindow(const bool &visible);
//! workaround in order for top panels to be always on top
void topViewAlwaysOnTop();
void verticalUnityViewHasFocus();
//!workround for when kwin hides view when an activity is closing
void showHiddenViewFromActivityStopping();
void restoreConfig();
void saveConfig();
2017-01-12 18:54:23 -05:00
private:
void initSignalingForLocationChangeSliding();
void setupWaylandIntegration();
void updateAppletContainsMethod();
2017-01-16 14:07:49 -05:00
void setContainsDrag(bool contains);
private:
2017-02-05 20:55:41 -05:00
Plasma::Containment *containmentById(uint id);
2017-01-27 20:03:24 +02:00
bool m_alternativesIsShown{false};
bool m_behaveAsPlasmaPanel{false};
bool m_byPassWM{true};
bool m_containsDrag{false};
bool m_containsMouse{false};
bool m_inDelete{false};
bool m_isPreferredForShortcuts{false};
bool m_onPrimary{true};
bool m_screenEdgeMarginEnabled{false};
bool m_isTouchingBottomViewAndIsBusy{false};
bool m_isTouchingTopViewAndIsBusy{false};
int m_fontPixelSize{ -1};
int m_maxThickness{256};
int m_normalThickness{256};
int m_maxNormalThickness{256};
int m_headThicknessGap{0};
int m_screenEdgeMargin{-1};
float m_maxLength{1};
float m_offset{0};
2017-01-16 14:07:49 -05:00
Types::Alignment m_alignment{Types::Center};
Types::ViewType m_type{Types::DockView};
QRect m_localGeometry;
QRect m_absoluteGeometry;
2021-04-01 11:00:59 +03:00
QString m_name;
QStringList m_activities;
//! HACK: In order to avoid crashes when the View is added and removed
//! immediately during startup
QTimer m_initLayoutTimer;
//! HACK: Timers in order to handle KWin faulty
//! behavior that hides Views when closing Activities
//! with no actual reason
QTimer m_visibleHackTimer1;
QTimer m_visibleHackTimer2;
QTimer m_releaseGrabTimer;
int m_releaseGrab_x;
int m_releaseGrab_y;
Layout::GenericLayout *m_layout{nullptr};
QQuickItem *m_colorizer{nullptr};
QQuickItem *m_metrics{nullptr};
QPointer<PlasmaQuick::ConfigView> m_appletConfigView;
QPointer<ViewPart::PrimaryConfigView> m_primaryConfigView;
2018-01-18 21:21:32 +02:00
QPointer<ViewPart::Effects> m_effects;
QPointer<ViewPart::Indicator> m_indicator;
QPointer<ViewPart::ContainmentInterface> m_interface;
QPointer<ViewPart::Parabolic> m_parabolic;
QPointer<ViewPart::Positioner> m_positioner;
2020-12-29 19:32:25 +02:00
QPointer<ViewPart::EventsSink> m_sink;
QPointer<ViewPart::VisibilityManager> m_visibility;
QPointer<ViewPart::WindowsTracker> m_windowsTracker;
QPointer<Latte::Interfaces> m_interfacesGraphicObj;
//! Connections to release and bound for the assigned layout
QList<QMetaObject::Connection> connectionsLayout;
//! track transientWindows
QList<QWindow *> m_transientWindows;
KWayland::Client::PlasmaShellSurface *m_shellSurface{nullptr};
};
2016-12-30 02:20:06 -05:00
}
#endif