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