Changeset View
Changeset View
Standalone View
Standalone View
libkwineffects/kwineffects.cpp
Show First 20 Lines • Show All 770 Lines • ▼ Show 20 Line(s) | |||||
771 | 771 | | |||
772 | class Q_DECL_HIDDEN EffectWindow::Private | 772 | class Q_DECL_HIDDEN EffectWindow::Private | ||
773 | { | 773 | { | ||
774 | public: | 774 | public: | ||
775 | Private(EffectWindow *q); | 775 | Private(EffectWindow *q); | ||
776 | 776 | | |||
777 | EffectWindow *q; | 777 | EffectWindow *q; | ||
778 | bool managed = false; | 778 | bool managed = false; | ||
779 | bool waylandClient; | ||||
780 | bool x11Client; | ||||
781 | bool popupWindow; | ||||
779 | }; | 782 | }; | ||
780 | 783 | | |||
781 | EffectWindow::Private::Private(EffectWindow *q) | 784 | EffectWindow::Private::Private(EffectWindow *q) | ||
782 | : q(q) | 785 | : q(q) | ||
783 | { | 786 | { | ||
784 | } | 787 | } | ||
785 | 788 | | |||
786 | EffectWindow::EffectWindow(QObject *parent) | 789 | EffectWindow::EffectWindow(QObject *parent) | ||
787 | : QObject(parent) | 790 | : QObject(parent) | ||
788 | , d(new Private(this)) | 791 | , d(new Private(this)) | ||
789 | { | 792 | { | ||
790 | // Deleted windows are not managed. So, when windowClosed signal is | 793 | // Deleted windows are not managed. So, when windowClosed signal is | ||
791 | // emitted, effects can't distinguish managed windows from unmanaged | 794 | // emitted, effects can't distinguish managed windows from unmanaged | ||
792 | // windows(e.g. combo box popups, popup menus, etc). Save value of the | 795 | // windows(e.g. combo box popups, popup menus, etc). Save value of the | ||
793 | // managed property during construction of EffectWindow. At that time, | 796 | // managed property during construction of EffectWindow. At that time, | ||
794 | // parent can be Client, ShellClient, or Unmanaged. So, later on, when | 797 | // parent can be Client, ShellClient, or Unmanaged. So, later on, when | ||
795 | // an instance of Deleted becomes parent of the EffectWindow, effects | 798 | // an instance of Deleted becomes parent of the EffectWindow, effects | ||
796 | // can still figure out whether it is/was a managed window. | 799 | // can still figure out whether it is/was a managed window. | ||
797 | d->managed = parent->property("managed").value<bool>(); | 800 | d->managed = parent->property("managed").value<bool>(); | ||
801 | | ||||
802 | d->waylandClient = parent->inherits("KWin::ShellClient"); | ||||
803 | d->x11Client = !d->waylandClient; | ||||
804 | d->popupWindow = parent->property("popupWindow").value<bool>(); | ||||
798 | } | 805 | } | ||
799 | 806 | | |||
800 | EffectWindow::~EffectWindow() | 807 | EffectWindow::~EffectWindow() | ||
801 | { | 808 | { | ||
802 | } | 809 | } | ||
803 | 810 | | |||
804 | #define WINDOW_HELPER( rettype, prototype, propertyname ) \ | 811 | #define WINDOW_HELPER( rettype, prototype, propertyname ) \ | ||
805 | rettype EffectWindow::prototype ( ) const \ | 812 | rettype EffectWindow::prototype ( ) const \ | ||
▲ Show 20 Lines • Show All 181 Lines • ▼ Show 20 Line(s) | 992 | return !isMinimized() | |||
987 | && isOnCurrentActivity(); | 994 | && isOnCurrentActivity(); | ||
988 | } | 995 | } | ||
989 | 996 | | |||
990 | bool EffectWindow::isManaged() const | 997 | bool EffectWindow::isManaged() const | ||
991 | { | 998 | { | ||
992 | return d->managed; | 999 | return d->managed; | ||
993 | } | 1000 | } | ||
994 | 1001 | | |||
1002 | bool EffectWindow::isWaylandClient() const | ||||
1003 | { | ||||
1004 | return d->waylandClient; | ||||
1005 | } | ||||
1006 | | ||||
1007 | bool EffectWindow::isX11Client() const | ||||
1008 | { | ||||
1009 | return d->x11Client; | ||||
1010 | } | ||||
1011 | | ||||
1012 | bool EffectWindow::isPopupWindow() const | ||||
1013 | { | ||||
1014 | return d->popupWindow; | ||||
1015 | } | ||||
995 | 1016 | | |||
996 | //**************************************** | 1017 | //**************************************** | ||
997 | // EffectWindowGroup | 1018 | // EffectWindowGroup | ||
998 | //**************************************** | 1019 | //**************************************** | ||
999 | 1020 | | |||
1000 | EffectWindowGroup::~EffectWindowGroup() | 1021 | EffectWindowGroup::~EffectWindowGroup() | ||
1001 | { | 1022 | { | ||
1002 | } | 1023 | } | ||
▲ Show 20 Lines • Show All 1070 Lines • Show Last 20 Lines |