Changeset View
Changeset View
Standalone View
Standalone View
libkwineffects/kwineffects.cpp
Show First 20 Lines • Show All 756 Lines • ▼ Show 20 Line(s) | 756 | { | |||
---|---|---|---|---|---|
757 | return compositing_type; | 757 | return compositing_type; | ||
758 | } | 758 | } | ||
759 | 759 | | |||
760 | bool EffectsHandler::isOpenGLCompositing() const | 760 | bool EffectsHandler::isOpenGLCompositing() const | ||
761 | { | 761 | { | ||
762 | return compositing_type & OpenGLCompositing; | 762 | return compositing_type & OpenGLCompositing; | ||
763 | } | 763 | } | ||
764 | 764 | | |||
765 | void EffectsHandler::removeWindowFromDesktop(KWin::EffectWindow* w, int desktop) | ||||
766 | { | ||||
767 | if (w->parent() && !w->isDesktop() && !w->isDock()) { | ||||
768 | QMetaObject::invokeMethod(w->parent(), "unSetDesktop", Q_ARG(int, desktop)); | ||||
769 | } | ||||
770 | } | ||||
771 | | ||||
765 | EffectsHandler* effects = nullptr; | 772 | EffectsHandler* effects = nullptr; | ||
766 | 773 | | |||
767 | 774 | | |||
768 | //**************************************** | 775 | //**************************************** | ||
769 | // EffectWindow | 776 | // EffectWindow | ||
770 | //**************************************** | 777 | //**************************************** | ||
771 | 778 | | |||
772 | class Q_DECL_HIDDEN EffectWindow::Private | 779 | class Q_DECL_HIDDEN EffectWindow::Private | ||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | |||||
821 | WINDOW_HELPER(int, width, "width") | 828 | WINDOW_HELPER(int, width, "width") | ||
822 | WINDOW_HELPER(int, height, "height") | 829 | WINDOW_HELPER(int, height, "height") | ||
823 | WINDOW_HELPER(QPoint, pos, "pos") | 830 | WINDOW_HELPER(QPoint, pos, "pos") | ||
824 | WINDOW_HELPER(QSize, size, "size") | 831 | WINDOW_HELPER(QSize, size, "size") | ||
825 | WINDOW_HELPER(int, screen, "screen") | 832 | WINDOW_HELPER(int, screen, "screen") | ||
826 | WINDOW_HELPER(QRect, geometry, "geometry") | 833 | WINDOW_HELPER(QRect, geometry, "geometry") | ||
827 | WINDOW_HELPER(QRect, expandedGeometry, "visibleRect") | 834 | WINDOW_HELPER(QRect, expandedGeometry, "visibleRect") | ||
828 | WINDOW_HELPER(QRect, rect, "rect") | 835 | WINDOW_HELPER(QRect, rect, "rect") | ||
836 | #ifndef KWIN_NO_DEPRECATED | ||||
829 | WINDOW_HELPER(int, desktop, "desktop") | 837 | WINDOW_HELPER(int, desktop, "desktop") | ||
838 | #endif | ||||
830 | WINDOW_HELPER(bool, isDesktop, "desktopWindow") | 839 | WINDOW_HELPER(bool, isDesktop, "desktopWindow") | ||
831 | WINDOW_HELPER(bool, isDock, "dock") | 840 | WINDOW_HELPER(bool, isDock, "dock") | ||
832 | WINDOW_HELPER(bool, isToolbar, "toolbar") | 841 | WINDOW_HELPER(bool, isToolbar, "toolbar") | ||
833 | WINDOW_HELPER(bool, isMenu, "menu") | 842 | WINDOW_HELPER(bool, isMenu, "menu") | ||
834 | WINDOW_HELPER(bool, isNormalWindow, "normalWindow") | 843 | WINDOW_HELPER(bool, isNormalWindow, "normalWindow") | ||
835 | WINDOW_HELPER(bool, isDialog, "dialog") | 844 | WINDOW_HELPER(bool, isDialog, "dialog") | ||
836 | WINDOW_HELPER(bool, isSplash, "splash") | 845 | WINDOW_HELPER(bool, isSplash, "splash") | ||
837 | WINDOW_HELPER(bool, isUtility, "utility") | 846 | WINDOW_HELPER(bool, isUtility, "utility") | ||
838 | WINDOW_HELPER(bool, isDropdownMenu, "dropdownMenu") | 847 | WINDOW_HELPER(bool, isDropdownMenu, "dropdownMenu") | ||
839 | WINDOW_HELPER(bool, isPopupMenu, "popupMenu") | 848 | WINDOW_HELPER(bool, isPopupMenu, "popupMenu") | ||
840 | WINDOW_HELPER(bool, isTooltip, "tooltip") | 849 | WINDOW_HELPER(bool, isTooltip, "tooltip") | ||
841 | WINDOW_HELPER(bool, isNotification, "notification") | 850 | WINDOW_HELPER(bool, isNotification, "notification") | ||
842 | WINDOW_HELPER(bool, isOnScreenDisplay, "onScreenDisplay") | 851 | WINDOW_HELPER(bool, isOnScreenDisplay, "onScreenDisplay") | ||
843 | WINDOW_HELPER(bool, isComboBox, "comboBox") | 852 | WINDOW_HELPER(bool, isComboBox, "comboBox") | ||
844 | WINDOW_HELPER(bool, isDNDIcon, "dndIcon") | 853 | WINDOW_HELPER(bool, isDNDIcon, "dndIcon") | ||
845 | WINDOW_HELPER(bool, isDeleted, "deleted") | 854 | WINDOW_HELPER(bool, isDeleted, "deleted") | ||
846 | WINDOW_HELPER(bool, hasOwnShape, "shaped") | 855 | WINDOW_HELPER(bool, hasOwnShape, "shaped") | ||
847 | WINDOW_HELPER(QString, windowRole, "windowRole") | 856 | WINDOW_HELPER(QString, windowRole, "windowRole") | ||
848 | WINDOW_HELPER(QStringList, activities, "activities") | 857 | WINDOW_HELPER(QStringList, activities, "activities") | ||
849 | WINDOW_HELPER(bool, skipsCloseAnimation, "skipsCloseAnimation") | 858 | WINDOW_HELPER(bool, skipsCloseAnimation, "skipsCloseAnimation") | ||
850 | WINDOW_HELPER(KWayland::Server::SurfaceInterface *, surface, "surface") | 859 | WINDOW_HELPER(KWayland::Server::SurfaceInterface *, surface, "surface") | ||
851 | 860 | | |||
861 | QList<int> EffectWindow::desktops() const | ||||
862 | { | ||||
863 | return parent()->property("x11DesktopIds").value<QList<int> >(); | ||||
864 | } | ||||
865 | | ||||
852 | QString EffectWindow::windowClass() const | 866 | QString EffectWindow::windowClass() const | ||
853 | { | 867 | { | ||
854 | return parent()->property("resourceName").toString() + QLatin1Char(' ') + parent()->property("resourceClass").toString(); | 868 | return parent()->property("resourceName").toString() + QLatin1Char(' ') + parent()->property("resourceClass").toString(); | ||
855 | } | 869 | } | ||
856 | 870 | | |||
857 | QRect EffectWindow::contentsRect() const | 871 | QRect EffectWindow::contentsRect() const | ||
858 | { | 872 | { | ||
859 | return QRect(parent()->property("clientPos").toPoint(), parent()->property("clientSize").toSize()); | 873 | return QRect(parent()->property("clientPos").toPoint(), parent()->property("clientSize").toSize()); | ||
▲ Show 20 Lines • Show All 109 Lines • ▼ Show 20 Line(s) | |||||
969 | 983 | | |||
970 | bool EffectWindow::isOnCurrentDesktop() const | 984 | bool EffectWindow::isOnCurrentDesktop() const | ||
971 | { | 985 | { | ||
972 | return isOnDesktop(effects->currentDesktop()); | 986 | return isOnDesktop(effects->currentDesktop()); | ||
973 | } | 987 | } | ||
974 | 988 | | |||
975 | bool EffectWindow::isOnDesktop(int d) const | 989 | bool EffectWindow::isOnDesktop(int d) const | ||
976 | { | 990 | { | ||
977 | return desktop() == d || isOnAllDesktops(); | 991 | const QList<int> ds = desktops(); | ||
992 | return ds.isEmpty() || ds.contains(d); | ||||
978 | } | 993 | } | ||
979 | 994 | | |||
980 | bool EffectWindow::isOnAllDesktops() const | 995 | bool EffectWindow::isOnAllDesktops() const | ||
981 | { | 996 | { | ||
982 | return desktop() == NET::OnAllDesktops; | 997 | return desktops().isEmpty(); | ||
983 | } | 998 | } | ||
984 | 999 | | |||
985 | bool EffectWindow::hasDecoration() const | 1000 | bool EffectWindow::hasDecoration() const | ||
986 | { | 1001 | { | ||
987 | return contentsRect() != QRect(0, 0, width(), height()); | 1002 | return contentsRect() != QRect(0, 0, width(), height()); | ||
988 | } | 1003 | } | ||
989 | 1004 | | |||
990 | bool EffectWindow::isVisible() const | 1005 | bool EffectWindow::isVisible() const | ||
▲ Show 20 Lines • Show All 1103 Lines • Show Last 20 Lines |