Workspace::movingClient changed to AbstractClient
In events.cpp it's casted to Client as it's X11 specific. In InputRedirections it's kind of broken, but window movement is anyway broken.
This commit is contained in:
parent
d2cdd3de1d
commit
4b41c33268
11 changed files with 21 additions and 17 deletions
|
@ -27,6 +27,7 @@ namespace KWin
|
||||||
{
|
{
|
||||||
|
|
||||||
class TabGroup;
|
class TabGroup;
|
||||||
|
class WindowRules;
|
||||||
|
|
||||||
namespace TabBox
|
namespace TabBox
|
||||||
{
|
{
|
||||||
|
@ -68,6 +69,7 @@ public:
|
||||||
virtual void setShortcut(const QString &cut) = 0;
|
virtual void setShortcut(const QString &cut) = 0;
|
||||||
virtual bool performMouseCommand(Options::MouseCommand, const QPoint &globalPos) = 0;
|
virtual bool performMouseCommand(Options::MouseCommand, const QPoint &globalPos) = 0;
|
||||||
virtual void setOnAllDesktops(bool set) = 0;
|
virtual void setOnAllDesktops(bool set) = 0;
|
||||||
|
virtual void setDesktop(int) = 0;
|
||||||
virtual void minimize(bool avoid_animation = false) = 0;
|
virtual void minimize(bool avoid_animation = false) = 0;
|
||||||
virtual void setFullScreen(bool set, bool user = true) = 0;
|
virtual void setFullScreen(bool set, bool user = true) = 0;
|
||||||
virtual bool keepAbove() const = 0;
|
virtual bool keepAbove() const = 0;
|
||||||
|
@ -95,6 +97,7 @@ public:
|
||||||
virtual bool userCanSetFullScreen() const = 0;
|
virtual bool userCanSetFullScreen() const = 0;
|
||||||
virtual bool userCanSetNoBorder() const = 0;
|
virtual bool userCanSetNoBorder() const = 0;
|
||||||
virtual void setOnAllActivities(bool set) = 0;
|
virtual void setOnAllActivities(bool set) = 0;
|
||||||
|
virtual const WindowRules* rules() 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);
|
||||||
|
|
4
client.h
4
client.h
|
@ -308,7 +308,7 @@ public:
|
||||||
Group* group();
|
Group* group();
|
||||||
void checkGroup(Group* gr = NULL, bool force = false);
|
void checkGroup(Group* gr = NULL, bool force = false);
|
||||||
void changeClientLeaderGroup(Group* gr);
|
void changeClientLeaderGroup(Group* gr);
|
||||||
const WindowRules* rules() const;
|
const WindowRules* rules() const override;
|
||||||
void removeRule(Rules* r);
|
void removeRule(Rules* r);
|
||||||
void setupWindowRules(bool ignore_temporary);
|
void setupWindowRules(bool ignore_temporary);
|
||||||
void applyWindowRules();
|
void applyWindowRules();
|
||||||
|
@ -355,7 +355,7 @@ public:
|
||||||
void setActive(bool);
|
void setActive(bool);
|
||||||
|
|
||||||
virtual int desktop() const;
|
virtual int desktop() const;
|
||||||
void setDesktop(int);
|
void setDesktop(int) override;
|
||||||
void setOnAllDesktops(bool set) override;
|
void setOnAllDesktops(bool set) override;
|
||||||
|
|
||||||
void sendToScreen(int screen) override;
|
void sendToScreen(int screen) override;
|
||||||
|
|
|
@ -221,7 +221,7 @@ EffectsHandlerImpl::EffectsHandlerImpl(Compositor *compositor, Scene *scene)
|
||||||
connect(ws, &Workspace::showingDesktopChanged,
|
connect(ws, &Workspace::showingDesktopChanged,
|
||||||
this, &EffectsHandlerImpl::showingDesktopChanged);
|
this, &EffectsHandlerImpl::showingDesktopChanged);
|
||||||
connect(ws, &Workspace::currentDesktopChanged, this,
|
connect(ws, &Workspace::currentDesktopChanged, this,
|
||||||
[this](int old, Client *c) {
|
[this](int old, AbstractClient *c) {
|
||||||
const int newDesktop = VirtualDesktopManager::self()->current();
|
const int newDesktop = VirtualDesktopManager::self()->current();
|
||||||
if (old != 0 && newDesktop != old) {
|
if (old != 0 && newDesktop != old) {
|
||||||
emit desktopChanged(old, newDesktop, c ? c->effectWindow() : 0);
|
emit desktopChanged(old, newDesktop, c ? c->effectWindow() : 0);
|
||||||
|
|
|
@ -312,8 +312,8 @@ bool Workspace::workspaceEvent(xcb_generic_event_t *e)
|
||||||
xcb_key_press_event_t *event = reinterpret_cast<xcb_key_press_event_t*>(e);
|
xcb_key_press_event_t *event = reinterpret_cast<xcb_key_press_event_t*>(e);
|
||||||
KKeyServer::xcbKeyPressEventToQt(event, &keyQt);
|
KKeyServer::xcbKeyPressEventToQt(event, &keyQt);
|
||||||
// qDebug() << "Workspace::keyPress( " << keyQt << " )";
|
// qDebug() << "Workspace::keyPress( " << keyQt << " )";
|
||||||
if (movingClient) {
|
if (Client *c = dynamic_cast<Client*>(movingClient)) {
|
||||||
movingClient->keyPressEvent(keyQt, event->time);
|
c->keyPressEvent(keyQt, event->time);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#ifdef KWIN_BUILD_TABBOX
|
#ifdef KWIN_BUILD_TABBOX
|
||||||
|
@ -366,9 +366,9 @@ bool Workspace::workspaceEvent(xcb_generic_event_t *e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (movingClient) {
|
if (Client *c = dynamic_cast<Client*>(movingClient)) {
|
||||||
if (eventType == XCB_BUTTON_PRESS || eventType == XCB_BUTTON_RELEASE || eventType == XCB_MOTION_NOTIFY) {
|
if (eventType == XCB_BUTTON_PRESS || eventType == XCB_BUTTON_RELEASE || eventType == XCB_MOTION_NOTIFY) {
|
||||||
if (movingClient->moveResizeGrabWindow() == reinterpret_cast<xcb_button_press_event_t*>(e)->event && movingClient->windowEvent(e)) {
|
if (c->moveResizeGrabWindow() == reinterpret_cast<xcb_button_press_event_t*>(e)->event && c->windowEvent(e)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -793,7 +793,7 @@ QRect Workspace::adjustClientSize(Client* c, QRect moveResizeGeom, int mode)
|
||||||
/*!
|
/*!
|
||||||
Marks the client as being moved around by the user.
|
Marks the client as being moved around by the user.
|
||||||
*/
|
*/
|
||||||
void Workspace::setClientIsMoving(Client *c)
|
void Workspace::setClientIsMoving(AbstractClient *c)
|
||||||
{
|
{
|
||||||
Q_ASSERT(!c || !movingClient); // Catch attempts to move a second
|
Q_ASSERT(!c || !movingClient); // Catch attempts to move a second
|
||||||
// window while still moving the first one.
|
// window while still moving the first one.
|
||||||
|
|
|
@ -534,7 +534,7 @@ void InputRedirection::processKeyboardKey(uint32_t key, InputRedirection::Keyboa
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (workspace()) {
|
if (workspace()) {
|
||||||
if (Client *c = workspace()->getMovingClient()) {
|
if (Client *c = dynamic_cast<Client*>(workspace()->getMovingClient())) {
|
||||||
// TODO: this does not yet fully support moving of the Client
|
// TODO: this does not yet fully support moving of the Client
|
||||||
// cursor events change the cursor and on Wayland pointer warping is not possible
|
// cursor events change the cursor and on Wayland pointer warping is not possible
|
||||||
c->keyPressEvent(m_xkb->toQtKey(m_xkb->toKeysym(key)));
|
c->keyPressEvent(m_xkb->toQtKey(m_xkb->toKeysym(key)));
|
||||||
|
|
|
@ -285,7 +285,7 @@ void Edge::switchDesktop(const QPoint &cursorPos)
|
||||||
pos.setY(OFFSET);
|
pos.setY(OFFSET);
|
||||||
}
|
}
|
||||||
#ifndef KWIN_UNIT_TEST
|
#ifndef KWIN_UNIT_TEST
|
||||||
if (Client *c = Workspace::self()->getMovingClient()) {
|
if (AbstractClient *c = Workspace::self()->getMovingClient()) {
|
||||||
if (c->rules()->checkDesktop(desktop) != int(desktop)) {
|
if (c->rules()->checkDesktop(desktop) != int(desktop)) {
|
||||||
// user attempts to move a client to another desktop where it is ruleforced to not be
|
// user attempts to move a client to another desktop where it is ruleforced to not be
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -39,7 +39,7 @@ WorkspaceWrapper::WorkspaceWrapper(QObject* parent) : QObject(parent)
|
||||||
KWin::Workspace *ws = KWin::Workspace::self();
|
KWin::Workspace *ws = KWin::Workspace::self();
|
||||||
KWin::VirtualDesktopManager *vds = KWin::VirtualDesktopManager::self();
|
KWin::VirtualDesktopManager *vds = KWin::VirtualDesktopManager::self();
|
||||||
connect(ws, SIGNAL(desktopPresenceChanged(KWin::Client*,int)), SIGNAL(desktopPresenceChanged(KWin::Client*,int)));
|
connect(ws, SIGNAL(desktopPresenceChanged(KWin::Client*,int)), SIGNAL(desktopPresenceChanged(KWin::Client*,int)));
|
||||||
connect(ws, SIGNAL(currentDesktopChanged(int,KWin::Client*)), SIGNAL(currentDesktopChanged(int,KWin::Client*)));
|
connect(ws, &Workspace::currentDesktopChanged, this, &WorkspaceWrapper::currentDesktopChanged);
|
||||||
connect(ws, SIGNAL(clientAdded(KWin::Client*)), SIGNAL(clientAdded(KWin::Client*)));
|
connect(ws, SIGNAL(clientAdded(KWin::Client*)), SIGNAL(clientAdded(KWin::Client*)));
|
||||||
connect(ws, SIGNAL(clientAdded(KWin::Client*)), SLOT(setupClientConnections(KWin::Client*)));
|
connect(ws, SIGNAL(clientAdded(KWin::Client*)), SLOT(setupClientConnections(KWin::Client*)));
|
||||||
connect(ws, SIGNAL(clientRemoved(KWin::Client*)), SIGNAL(clientRemoved(KWin::Client*)));
|
connect(ws, SIGNAL(clientRemoved(KWin::Client*)), SIGNAL(clientRemoved(KWin::Client*)));
|
||||||
|
|
|
@ -31,6 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
namespace KWin
|
namespace KWin
|
||||||
{
|
{
|
||||||
// forward declarations
|
// forward declarations
|
||||||
|
class AbstractClient;
|
||||||
class Client;
|
class Client;
|
||||||
|
|
||||||
class WorkspaceWrapper : public QObject
|
class WorkspaceWrapper : public QObject
|
||||||
|
@ -88,7 +89,7 @@ private:
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void desktopPresenceChanged(KWin::Client *client, int desktop);
|
void desktopPresenceChanged(KWin::Client *client, int desktop);
|
||||||
void currentDesktopChanged(int desktop, KWin::Client *client);
|
void currentDesktopChanged(int desktop, KWin::AbstractClient *client);
|
||||||
void clientAdded(KWin::Client *client);
|
void clientAdded(KWin::Client *client);
|
||||||
void clientRemoved(KWin::Client *client);
|
void clientRemoved(KWin::Client *client);
|
||||||
void clientManaging(KWin::Client *client);
|
void clientManaging(KWin::Client *client);
|
||||||
|
|
|
@ -189,7 +189,7 @@ Workspace::Workspace(bool restore)
|
||||||
} else {
|
} else {
|
||||||
m_compositor = Compositor::create(this);
|
m_compositor = Compositor::create(this);
|
||||||
}
|
}
|
||||||
connect(this, SIGNAL(currentDesktopChanged(int,KWin::Client*)), m_compositor, SLOT(addRepaintFull()));
|
connect(this, &Workspace::currentDesktopChanged, m_compositor, &Compositor::addRepaintFull);
|
||||||
|
|
||||||
auto decorationBridge = Decoration::DecorationBridge::create(this);
|
auto decorationBridge = Decoration::DecorationBridge::create(this);
|
||||||
decorationBridge->init();
|
decorationBridge->init();
|
||||||
|
|
|
@ -170,7 +170,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Indicates that the client c is being moved around by the user.
|
* Indicates that the client c is being moved around by the user.
|
||||||
*/
|
*/
|
||||||
void setClientIsMoving(Client* c);
|
void setClientIsMoving(AbstractClient* c);
|
||||||
|
|
||||||
QPoint adjustClientPosition(Client* c, QPoint pos, bool unrestricted, double snapAdjust = 1.0);
|
QPoint adjustClientPosition(Client* c, QPoint pos, bool unrestricted, double snapAdjust = 1.0);
|
||||||
QRect adjustClientSize(Client* c, QRect moveResizeGeom, int mode);
|
QRect adjustClientSize(Client* c, QRect moveResizeGeom, int mode);
|
||||||
|
@ -327,7 +327,7 @@ public:
|
||||||
void updateFocusMousePosition(const QPoint& pos);
|
void updateFocusMousePosition(const QPoint& pos);
|
||||||
QPoint focusMousePosition() const;
|
QPoint focusMousePosition() const;
|
||||||
|
|
||||||
Client* getMovingClient() {
|
AbstractClient* getMovingClient() {
|
||||||
return movingClient;
|
return movingClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -442,7 +442,7 @@ Q_SIGNALS:
|
||||||
|
|
||||||
//Signals required for the scripting interface
|
//Signals required for the scripting interface
|
||||||
void desktopPresenceChanged(KWin::Client*, int);
|
void desktopPresenceChanged(KWin::Client*, int);
|
||||||
void currentDesktopChanged(int, KWin::Client*);
|
void currentDesktopChanged(int, KWin::AbstractClient*);
|
||||||
void clientAdded(KWin::Client*);
|
void clientAdded(KWin::Client*);
|
||||||
void clientRemoved(KWin::Client*);
|
void clientRemoved(KWin::Client*);
|
||||||
void clientActivated(KWin::Client*);
|
void clientActivated(KWin::Client*);
|
||||||
|
@ -516,7 +516,7 @@ private:
|
||||||
Client* active_client;
|
Client* active_client;
|
||||||
Client* last_active_client;
|
Client* last_active_client;
|
||||||
AbstractClient* most_recently_raised; // Used ONLY by raiseOrLowerClient()
|
AbstractClient* most_recently_raised; // Used ONLY by raiseOrLowerClient()
|
||||||
Client* movingClient;
|
AbstractClient* movingClient;
|
||||||
|
|
||||||
// Delay(ed) window focus timer and client
|
// Delay(ed) window focus timer and client
|
||||||
QTimer* delayFocusTimer;
|
QTimer* delayFocusTimer;
|
||||||
|
|
Loading…
Reference in a new issue