scripting: Rename Workspace.activeClient to activeWindow
Rename activeClient to activeWindow to make the property name more accurate.
This commit is contained in:
parent
44937136cd
commit
b39ca36d21
4 changed files with 18 additions and 18 deletions
|
@ -52,7 +52,7 @@ FocusScope {
|
|||
signal activated()
|
||||
|
||||
function activateIndex(index) {
|
||||
KWinComponents.Workspace.activeClient = windowsInstantiator.objectAt(index).window;
|
||||
KWinComponents.Workspace.activeWindow = windowsInstantiator.objectAt(index).window;
|
||||
activated();
|
||||
}
|
||||
|
||||
|
@ -369,7 +369,7 @@ FocusScope {
|
|||
}
|
||||
if (selectedItem) {
|
||||
handled = true;
|
||||
KWinComponents.Workspace.activeClient = selectedItem.window;
|
||||
KWinComponents.Workspace.activeWindow = selectedItem.window;
|
||||
activated();
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -28,10 +28,10 @@ Item {
|
|||
readonly property bool initialHidden: window.minimized || !presentOnCurrentDesktop
|
||||
readonly property bool activeHidden: {
|
||||
if (windowHeap.showOnly === "activeClass") {
|
||||
if (!KWinComponents.Workspace.activeClient) {
|
||||
if (!KWinComponents.Workspace.activeWindow) {
|
||||
return true;
|
||||
} else {
|
||||
return KWinComponents.Workspace.activeClient.resourceName !== window.resourceName;
|
||||
return KWinComponents.Workspace.activeWindow.resourceName !== window.resourceName;
|
||||
}
|
||||
} else {
|
||||
return windowHeap.showOnly.length !== 0
|
||||
|
@ -355,7 +355,7 @@ Item {
|
|||
TapHandler {
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onTapped: {
|
||||
KWinComponents.Workspace.activeClient = thumb.window;
|
||||
KWinComponents.Workspace.activeWindow = thumb.window;
|
||||
thumb.windowHeap.activated();
|
||||
}
|
||||
onPressedChanged: {
|
||||
|
|
|
@ -33,7 +33,7 @@ WorkspaceWrapper::WorkspaceWrapper(QObject *parent)
|
|||
KWin::VirtualDesktopManager *vds = KWin::VirtualDesktopManager::self();
|
||||
connect(ws, &Workspace::windowAdded, this, &WorkspaceWrapper::clientAdded);
|
||||
connect(ws, &Workspace::windowRemoved, this, &WorkspaceWrapper::clientRemoved);
|
||||
connect(ws, &Workspace::windowActivated, this, &WorkspaceWrapper::clientActivated);
|
||||
connect(ws, &Workspace::windowActivated, this, &WorkspaceWrapper::windowActivated);
|
||||
connect(vds, &VirtualDesktopManager::desktopCreated, this, &WorkspaceWrapper::desktopsChanged);
|
||||
connect(vds, &VirtualDesktopManager::desktopRemoved, this, &WorkspaceWrapper::desktopsChanged);
|
||||
connect(vds, &VirtualDesktopManager::layoutChanged, this, &WorkspaceWrapper::desktopLayoutChanged);
|
||||
|
@ -69,7 +69,7 @@ void WorkspaceWrapper::setCurrentDesktop(VirtualDesktop *desktop)
|
|||
VirtualDesktopManager::self()->setCurrent(desktop);
|
||||
}
|
||||
|
||||
Window *WorkspaceWrapper::activeClient() const
|
||||
Window *WorkspaceWrapper::activeWindow() const
|
||||
{
|
||||
return workspace()->activeWindow();
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ QString WorkspaceWrapper::currentActivity() const
|
|||
#endif
|
||||
}
|
||||
|
||||
void WorkspaceWrapper::setCurrentActivity(QString activity)
|
||||
void WorkspaceWrapper::setCurrentActivity(const QString &activity)
|
||||
{
|
||||
#if KWIN_BUILD_ACTIVITIES
|
||||
if (Workspace::self()->activities()) {
|
||||
|
@ -219,9 +219,9 @@ SLOTWRAPPER(slotSwitchDesktopDown, Down)
|
|||
|
||||
#undef SLOTWRAPPER
|
||||
|
||||
void WorkspaceWrapper::setActiveClient(KWin::Window *client)
|
||||
void WorkspaceWrapper::setActiveWindow(KWin::Window *window)
|
||||
{
|
||||
KWin::Workspace::self()->activateWindow(client);
|
||||
KWin::Workspace::self()->activateWindow(window);
|
||||
}
|
||||
|
||||
QSize WorkspaceWrapper::workspaceSize() const
|
||||
|
|
|
@ -30,7 +30,7 @@ class WorkspaceWrapper : public QObject
|
|||
Q_OBJECT
|
||||
Q_PROPERTY(QVector<KWin::VirtualDesktop *> desktops READ desktops NOTIFY desktopsChanged)
|
||||
Q_PROPERTY(KWin::VirtualDesktop *currentDesktop READ currentDesktop WRITE setCurrentDesktop NOTIFY currentDesktopChanged)
|
||||
Q_PROPERTY(KWin::Window *activeClient READ activeClient WRITE setActiveClient NOTIFY clientActivated)
|
||||
Q_PROPERTY(KWin::Window *activeWindow READ activeWindow WRITE setActiveWindow NOTIFY windowActivated)
|
||||
// TODO: write and notify?
|
||||
Q_PROPERTY(QSize desktopGridSize READ desktopGridSize NOTIFY desktopLayoutChanged)
|
||||
Q_PROPERTY(int desktopGridWidth READ desktopGridWidth NOTIFY desktopLayoutChanged)
|
||||
|
@ -70,7 +70,7 @@ private:
|
|||
Q_SIGNALS:
|
||||
void clientAdded(KWin::Window *client);
|
||||
void clientRemoved(KWin::Window *client);
|
||||
void clientActivated(KWin::Window *client);
|
||||
void windowActivated(KWin::Window *window);
|
||||
/**
|
||||
* This signal is emitted when a virtual desktop is added or removed.
|
||||
*/
|
||||
|
@ -175,12 +175,12 @@ protected:
|
|||
explicit WorkspaceWrapper(QObject *parent = nullptr);
|
||||
|
||||
public:
|
||||
#define GETTERSETTERDEF(rettype, getter, setter) \
|
||||
rettype getter() const; \
|
||||
void setter(rettype val);
|
||||
GETTERSETTERDEF(QString, currentActivity, setCurrentActivity)
|
||||
GETTERSETTERDEF(KWin::Window *, activeClient, setActiveClient)
|
||||
#undef GETTERSETTERDEF
|
||||
Window *activeWindow() const;
|
||||
void setActiveWindow(Window *window);
|
||||
|
||||
QString currentActivity() const;
|
||||
void setCurrentActivity(const QString &activity);
|
||||
|
||||
QSize desktopGridSize() const;
|
||||
int desktopGridWidth() const;
|
||||
int desktopGridHeight() const;
|
||||
|
|
Loading…
Reference in a new issue