Changeset View
Changeset View
Standalone View
Standalone View
libkwineffects/kwineffects.cpp
Show First 20 Lines • Show All 754 Lines • ▼ Show 20 Line(s) | 754 | { | |||
---|---|---|---|---|---|
755 | return compositing_type; | 755 | return compositing_type; | ||
756 | } | 756 | } | ||
757 | 757 | | |||
758 | bool EffectsHandler::isOpenGLCompositing() const | 758 | bool EffectsHandler::isOpenGLCompositing() const | ||
759 | { | 759 | { | ||
760 | return compositing_type & OpenGLCompositing; | 760 | return compositing_type & OpenGLCompositing; | ||
761 | } | 761 | } | ||
762 | 762 | | |||
763 | void EffectsHandler::removeWindowFromDesktop(KWin::EffectWindow* w, int desktop) | ||||
764 | { | ||||
765 | if (w->parent() && !w->isDesktop() && !w->isDock()) { | ||||
766 | QMetaObject::invokeMethod(w->parent(), "unSetDesktop", Q_ARG(int, desktop)); | ||||
767 | } | ||||
768 | } | ||||
769 | | ||||
763 | EffectsHandler* effects = nullptr; | 770 | EffectsHandler* effects = nullptr; | ||
764 | 771 | | |||
765 | 772 | | |||
766 | //**************************************** | 773 | //**************************************** | ||
767 | // EffectWindow | 774 | // EffectWindow | ||
768 | //**************************************** | 775 | //**************************************** | ||
769 | 776 | | |||
770 | EffectWindow::EffectWindow(QObject *parent) | 777 | EffectWindow::EffectWindow(QObject *parent) | ||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | |||||
813 | WINDOW_HELPER(bool, isManaged, "managed") | 820 | WINDOW_HELPER(bool, isManaged, "managed") | ||
814 | WINDOW_HELPER(bool, isDeleted, "deleted") | 821 | WINDOW_HELPER(bool, isDeleted, "deleted") | ||
815 | WINDOW_HELPER(bool, hasOwnShape, "shaped") | 822 | WINDOW_HELPER(bool, hasOwnShape, "shaped") | ||
816 | WINDOW_HELPER(QString, windowRole, "windowRole") | 823 | WINDOW_HELPER(QString, windowRole, "windowRole") | ||
817 | WINDOW_HELPER(QStringList, activities, "activities") | 824 | WINDOW_HELPER(QStringList, activities, "activities") | ||
818 | WINDOW_HELPER(bool, skipsCloseAnimation, "skipsCloseAnimation") | 825 | WINDOW_HELPER(bool, skipsCloseAnimation, "skipsCloseAnimation") | ||
819 | WINDOW_HELPER(KWayland::Server::SurfaceInterface *, surface, "surface") | 826 | WINDOW_HELPER(KWayland::Server::SurfaceInterface *, surface, "surface") | ||
820 | 827 | | |||
828 | QList<int> EffectWindow::desktops() const | ||||
829 | { | ||||
830 | return parent()->property("x11DesktopIds").value<QList<int> >(); | ||||
831 | } | ||||
832 | | ||||
821 | QString EffectWindow::windowClass() const | 833 | QString EffectWindow::windowClass() const | ||
822 | { | 834 | { | ||
823 | return parent()->property("resourceName").toString() + QLatin1Char(' ') + parent()->property("resourceClass").toString(); | 835 | return parent()->property("resourceName").toString() + QLatin1Char(' ') + parent()->property("resourceClass").toString(); | ||
824 | } | 836 | } | ||
825 | 837 | | |||
826 | QRect EffectWindow::contentsRect() const | 838 | QRect EffectWindow::contentsRect() const | ||
827 | { | 839 | { | ||
828 | return QRect(parent()->property("clientPos").toPoint(), parent()->property("clientSize").toSize()); | 840 | return QRect(parent()->property("clientPos").toPoint(), parent()->property("clientSize").toSize()); | ||
▲ Show 20 Lines • Show All 109 Lines • ▼ Show 20 Line(s) | |||||
938 | 950 | | |||
939 | bool EffectWindow::isOnCurrentDesktop() const | 951 | bool EffectWindow::isOnCurrentDesktop() const | ||
940 | { | 952 | { | ||
941 | return isOnDesktop(effects->currentDesktop()); | 953 | return isOnDesktop(effects->currentDesktop()); | ||
942 | } | 954 | } | ||
943 | 955 | | |||
944 | bool EffectWindow::isOnDesktop(int d) const | 956 | bool EffectWindow::isOnDesktop(int d) const | ||
945 | { | 957 | { | ||
946 | return desktop() == d || isOnAllDesktops(); | 958 | const QList<int> ds = desktops(); | ||
959 | return ds.isEmpty() || ds.contains(d); | ||||
947 | } | 960 | } | ||
948 | 961 | | |||
949 | bool EffectWindow::isOnAllDesktops() const | 962 | bool EffectWindow::isOnAllDesktops() const | ||
950 | { | 963 | { | ||
951 | return desktop() == NET::OnAllDesktops; | 964 | return desktops().isEmpty(); | ||
952 | } | 965 | } | ||
953 | 966 | | |||
954 | bool EffectWindow::hasDecoration() const | 967 | bool EffectWindow::hasDecoration() const | ||
955 | { | 968 | { | ||
956 | return contentsRect() != QRect(0, 0, width(), height()); | 969 | return contentsRect() != QRect(0, 0, width(), height()); | ||
957 | } | 970 | } | ||
958 | 971 | | |||
959 | bool EffectWindow::isVisible() const | 972 | bool EffectWindow::isVisible() const | ||
▲ Show 20 Lines • Show All 937 Lines • Show Last 20 Lines |