mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-02 17:54:45 +00:00
mobileshell: Split out minimized geometry unset from window minimize
This commit is contained in:
parent
8d43419803
commit
7871212461
3 changed files with 36 additions and 15 deletions
|
|
@ -141,7 +141,8 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
function minimizeAll() {
|
function minimizeAll() {
|
||||||
MobileShell.WindowUtil.minimizeAll(root);
|
MobileShell.WindowUtil.unsetAllMinimizedGeometries(root);
|
||||||
|
MobileShell.WindowUtil.minimizeAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
//END functions
|
//END functions
|
||||||
|
|
|
||||||
|
|
@ -151,28 +151,43 @@ void WindowUtil::requestShowingDesktop(bool showingDesktop)
|
||||||
m_windowManagement->setShowingDesktop(showingDesktop);
|
m_windowManagement->setShowingDesktop(showingDesktop);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowUtil::minimizeAll(QQuickItem *parent)
|
void WindowUtil::minimizeAll()
|
||||||
{
|
{
|
||||||
if (!m_windowManagement) {
|
if (!m_windowManagement) {
|
||||||
qWarning() << "Ignoring request for minimizing all windows since window management hasn't been announced yet!";
|
qWarning() << "Ignoring request for minimizing all windows since window management hasn't been announced yet!";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
KWayland::Client::Surface *surface = nullptr;
|
for (auto *w : m_windowManagement->windows()) {
|
||||||
if (parent) {
|
if (!w->isMinimized()) {
|
||||||
QWindow *window = parent->window();
|
w->requestToggleMinimized();
|
||||||
if (window) {
|
|
||||||
surface = KWayland::Client::Surface::fromWindow(window);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void WindowUtil::unsetAllMinimizedGeometries(QQuickItem *parent)
|
||||||
|
{
|
||||||
|
if (!m_windowManagement) {
|
||||||
|
qWarning() << "Ignoring request for minimizing all windows since window management hasn't been announced yet!";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!parent) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QWindow *window = parent->window();
|
||||||
|
if (!window) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
KWayland::Client::Surface *surface = KWayland::Client::Surface::fromWindow(window);
|
||||||
|
if (!surface) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (auto *w : m_windowManagement->windows()) {
|
for (auto *w : m_windowManagement->windows()) {
|
||||||
if (!w->isMinimized()) {
|
w->unsetMinimizedGeometry(surface);
|
||||||
if (surface) {
|
|
||||||
w->unsetMinimizedGeometry(surface);
|
|
||||||
}
|
|
||||||
w->requestToggleMinimized();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -80,11 +80,16 @@ public:
|
||||||
Q_INVOKABLE void requestShowingDesktop(bool showingDesktop);
|
Q_INVOKABLE void requestShowingDesktop(bool showingDesktop);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Minimize all windows, while also unsetting their respective minimized geometries of the window given.
|
* Minimize all windows.
|
||||||
|
*/
|
||||||
|
Q_INVOKABLE void minimizeAll();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unset minimized geometries of all windows for an item's window.
|
||||||
*
|
*
|
||||||
* @param parent The parent item, which is of the same window that will have geometries unset.
|
* @param parent The parent item, which is of the same window that will have geometries unset.
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void minimizeAll(QQuickItem *parent);
|
Q_INVOKABLE void unsetAllMinimizedGeometries(QQuickItem *parent);
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void windowCreated(KWayland::Client::PlasmaWindow *window);
|
void windowCreated(KWayland::Client::PlasmaWindow *window);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue