Screens changed to use AbstractClient in ::setCurrent

icc-effect-5.14.5
Martin Gräßlin 2015-03-05 14:07:20 +01:00
parent 6e45901844
commit c46c92e204
4 changed files with 6 additions and 4 deletions

View File

@ -59,6 +59,7 @@ public:
* false for Normal, Dialog, Utility and Menu (and Toolbar??? - not yet) TODO * false for Normal, Dialog, Utility and Menu (and Toolbar??? - not yet) TODO
*/ */
virtual bool isSpecialWindow() const = 0; virtual bool isSpecialWindow() const = 0;
virtual bool isActive() const = 0;
// TODO: remove boolean trap // TODO: remove boolean trap
static bool belongToSameApplication(const AbstractClient* c1, const AbstractClient* c2, bool active_hack = false); static bool belongToSameApplication(const AbstractClient* c1, const AbstractClient* c2, bool active_hack = false);

View File

@ -351,7 +351,7 @@ public:
const QIcon &icon() const override; const QIcon &icon() const override;
bool isActive() const; bool isActive() const override;
void setActive(bool); void setActive(bool);
virtual int desktop() const; virtual int desktop() const;

View File

@ -18,6 +18,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************/ *********************************************************************/
#include "screens.h" #include "screens.h"
#include <abstract_client.h>
#include <client.h> #include <client.h>
#include "cursor.h" #include "cursor.h"
#include "settings.h" #include "settings.h"
@ -131,7 +132,7 @@ void Screens::setCurrent(const QPoint &pos)
setCurrent(number(pos)); setCurrent(number(pos));
} }
void Screens::setCurrent(const Client *c) void Screens::setCurrent(const AbstractClient *c)
{ {
if (!c->isActive()) { if (!c->isActive()) {
return; return;

View File

@ -32,7 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
namespace KWin namespace KWin
{ {
class Client; class AbstractClient;
class KWIN_EXPORT Screens : public QObject class KWIN_EXPORT Screens : public QObject
{ {
@ -59,7 +59,7 @@ public:
* Check whether a client moved completely out of what's considered the current screen, * Check whether a client moved completely out of what's considered the current screen,
* if yes, set a new active screen. * if yes, set a new active screen.
*/ */
void setCurrent(const Client *c); void setCurrent(const AbstractClient *c);
bool isCurrentFollowsMouse() const; bool isCurrentFollowsMouse() const;
void setCurrentFollowsMouse(bool follows); void setCurrentFollowsMouse(bool follows);
virtual QRect geometry(int screen) const = 0; virtual QRect geometry(int screen) const = 0;