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 All 18 Lines | |||||
789 | WINDOW_HELPER(int, width, "width") | 796 | WINDOW_HELPER(int, width, "width") | ||
790 | WINDOW_HELPER(int, height, "height") | 797 | WINDOW_HELPER(int, height, "height") | ||
791 | WINDOW_HELPER(QPoint, pos, "pos") | 798 | WINDOW_HELPER(QPoint, pos, "pos") | ||
792 | WINDOW_HELPER(QSize, size, "size") | 799 | WINDOW_HELPER(QSize, size, "size") | ||
793 | WINDOW_HELPER(int, screen, "screen") | 800 | WINDOW_HELPER(int, screen, "screen") | ||
794 | WINDOW_HELPER(QRect, geometry, "geometry") | 801 | WINDOW_HELPER(QRect, geometry, "geometry") | ||
795 | WINDOW_HELPER(QRect, expandedGeometry, "visibleRect") | 802 | WINDOW_HELPER(QRect, expandedGeometry, "visibleRect") | ||
796 | WINDOW_HELPER(QRect, rect, "rect") | 803 | WINDOW_HELPER(QRect, rect, "rect") | ||
804 | #ifndef KWIN_NO_DEPRECATED | ||||
797 | WINDOW_HELPER(int, desktop, "desktop") | 805 | WINDOW_HELPER(int, desktop, "desktop") | ||
806 | #endif | ||||
798 | WINDOW_HELPER(bool, isDesktop, "desktopWindow") | 807 | WINDOW_HELPER(bool, isDesktop, "desktopWindow") | ||
799 | WINDOW_HELPER(bool, isDock, "dock") | 808 | WINDOW_HELPER(bool, isDock, "dock") | ||
800 | WINDOW_HELPER(bool, isToolbar, "toolbar") | 809 | WINDOW_HELPER(bool, isToolbar, "toolbar") | ||
801 | WINDOW_HELPER(bool, isMenu, "menu") | 810 | WINDOW_HELPER(bool, isMenu, "menu") | ||
802 | WINDOW_HELPER(bool, isNormalWindow, "normalWindow") | 811 | WINDOW_HELPER(bool, isNormalWindow, "normalWindow") | ||
803 | WINDOW_HELPER(bool, isDialog, "dialog") | 812 | WINDOW_HELPER(bool, isDialog, "dialog") | ||
804 | WINDOW_HELPER(bool, isSplash, "splash") | 813 | WINDOW_HELPER(bool, isSplash, "splash") | ||
805 | WINDOW_HELPER(bool, isUtility, "utility") | 814 | WINDOW_HELPER(bool, isUtility, "utility") | ||
806 | WINDOW_HELPER(bool, isDropdownMenu, "dropdownMenu") | 815 | WINDOW_HELPER(bool, isDropdownMenu, "dropdownMenu") | ||
807 | WINDOW_HELPER(bool, isPopupMenu, "popupMenu") | 816 | WINDOW_HELPER(bool, isPopupMenu, "popupMenu") | ||
808 | WINDOW_HELPER(bool, isTooltip, "tooltip") | 817 | WINDOW_HELPER(bool, isTooltip, "tooltip") | ||
809 | WINDOW_HELPER(bool, isNotification, "notification") | 818 | WINDOW_HELPER(bool, isNotification, "notification") | ||
810 | WINDOW_HELPER(bool, isOnScreenDisplay, "onScreenDisplay") | 819 | WINDOW_HELPER(bool, isOnScreenDisplay, "onScreenDisplay") | ||
811 | WINDOW_HELPER(bool, isComboBox, "comboBox") | 820 | WINDOW_HELPER(bool, isComboBox, "comboBox") | ||
812 | WINDOW_HELPER(bool, isDNDIcon, "dndIcon") | 821 | WINDOW_HELPER(bool, isDNDIcon, "dndIcon") | ||
813 | WINDOW_HELPER(bool, isManaged, "managed") | 822 | WINDOW_HELPER(bool, isManaged, "managed") | ||
814 | WINDOW_HELPER(bool, isDeleted, "deleted") | 823 | WINDOW_HELPER(bool, isDeleted, "deleted") | ||
815 | WINDOW_HELPER(bool, hasOwnShape, "shaped") | 824 | WINDOW_HELPER(bool, hasOwnShape, "shaped") | ||
816 | WINDOW_HELPER(QString, windowRole, "windowRole") | 825 | WINDOW_HELPER(QString, windowRole, "windowRole") | ||
817 | WINDOW_HELPER(QStringList, activities, "activities") | 826 | WINDOW_HELPER(QStringList, activities, "activities") | ||
818 | WINDOW_HELPER(bool, skipsCloseAnimation, "skipsCloseAnimation") | 827 | WINDOW_HELPER(bool, skipsCloseAnimation, "skipsCloseAnimation") | ||
819 | WINDOW_HELPER(KWayland::Server::SurfaceInterface *, surface, "surface") | 828 | WINDOW_HELPER(KWayland::Server::SurfaceInterface *, surface, "surface") | ||
820 | 829 | | |||
830 | QList<int> EffectWindow::desktops() const | ||||
831 | { | ||||
832 | return parent()->property("x11DesktopIds").value<QList<int> >(); | ||||
833 | } | ||||
834 | | ||||
821 | QString EffectWindow::windowClass() const | 835 | QString EffectWindow::windowClass() const | ||
822 | { | 836 | { | ||
823 | return parent()->property("resourceName").toString() + QLatin1Char(' ') + parent()->property("resourceClass").toString(); | 837 | return parent()->property("resourceName").toString() + QLatin1Char(' ') + parent()->property("resourceClass").toString(); | ||
824 | } | 838 | } | ||
825 | 839 | | |||
826 | QRect EffectWindow::contentsRect() const | 840 | QRect EffectWindow::contentsRect() const | ||
827 | { | 841 | { | ||
828 | return QRect(parent()->property("clientPos").toPoint(), parent()->property("clientSize").toSize()); | 842 | return QRect(parent()->property("clientPos").toPoint(), parent()->property("clientSize").toSize()); | ||
▲ Show 20 Lines • Show All 109 Lines • ▼ Show 20 Line(s) | |||||
938 | 952 | | |||
939 | bool EffectWindow::isOnCurrentDesktop() const | 953 | bool EffectWindow::isOnCurrentDesktop() const | ||
940 | { | 954 | { | ||
941 | return isOnDesktop(effects->currentDesktop()); | 955 | return isOnDesktop(effects->currentDesktop()); | ||
942 | } | 956 | } | ||
943 | 957 | | |||
944 | bool EffectWindow::isOnDesktop(int d) const | 958 | bool EffectWindow::isOnDesktop(int d) const | ||
945 | { | 959 | { | ||
946 | return desktop() == d || isOnAllDesktops(); | 960 | const QList<int> ds = desktops(); | ||
961 | return ds.isEmpty() || ds.contains(d); | ||||
947 | } | 962 | } | ||
948 | 963 | | |||
949 | bool EffectWindow::isOnAllDesktops() const | 964 | bool EffectWindow::isOnAllDesktops() const | ||
950 | { | 965 | { | ||
951 | return desktop() == NET::OnAllDesktops; | 966 | return desktops().isEmpty(); | ||
952 | } | 967 | } | ||
953 | 968 | | |||
954 | bool EffectWindow::hasDecoration() const | 969 | bool EffectWindow::hasDecoration() const | ||
955 | { | 970 | { | ||
956 | return contentsRect() != QRect(0, 0, width(), height()); | 971 | return contentsRect() != QRect(0, 0, width(), height()); | ||
957 | } | 972 | } | ||
958 | 973 | | |||
959 | bool EffectWindow::isVisible() const | 974 | bool EffectWindow::isVisible() const | ||
▲ Show 20 Lines • Show All 937 Lines • Show Last 20 Lines |