scripting: Deprecate WorkspaceWrapper::screenResized

The WorkspaceWrapper::screenResized() signal relies on the QDesktopWidget
class, which is deprecated. Another issue with that signal is that it
uses integers to represent screens. We need to minimize the amount of int
based screen api and prefer more QScreen or AbstractOutput APIs because
the former get completely broken if the output layout changes.

Since we gain not a lot from porting WorkspaceWrapper::screenResized()
away from QDesktopWidget to something else and we don't use this signal
in any of our scripts, this change deprecates the screenResized signal
in favor of manual tracking of QScreen::geometryChanged signal.
This commit is contained in:
Vlad Zahorodnii 2021-05-02 14:47:48 +03:00
parent d987b94e42
commit 7397364115
2 changed files with 3 additions and 0 deletions

View file

@ -53,6 +53,7 @@ WorkspaceWrapper::WorkspaceWrapper(QObject* parent) : QObject(parent)
emit numberScreensChanged(currentCount);
}
);
// TODO Plasma 6: Remove it.
connect(QApplication::desktop(), &QDesktopWidget::resized, this, &WorkspaceWrapper::screenResized);
const QList<AbstractClient *> clients = ws->allClientList();

View file

@ -117,6 +117,8 @@ Q_SIGNALS:
/**
* This signal is emitted when the size of @p screen changes.
* Don't forget to fetch an updated client area.
*
* @deprecated Use QScreen::geometryChanged signal instead.
*/
void screenResized(int screen);
/**