Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma Mobile
Commits
78712124
Commit
78712124
authored
Apr 11, 2022
by
Devin Lin
🎨
Browse files
mobileshell: Split out minimized geometry unset from window minimize
parent
8d434198
Pipeline
#162833
passed with stages
in 1 minute and 20 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
components/mobileshell/qml/taskswitcher/TaskSwitcher.qml
View file @
78712124
...
...
@@ -141,7 +141,8 @@ Item {
}
function
minimizeAll
()
{
MobileShell
.
WindowUtil
.
minimizeAll
(
root
);
MobileShell
.
WindowUtil
.
unsetAllMinimizedGeometries
(
root
);
MobileShell
.
WindowUtil
.
minimizeAll
();
}
//END functions
...
...
components/mobileshell/windowutil.cpp
View file @
78712124
...
...
@@ -151,31 +151,46 @@ void WindowUtil::requestShowingDesktop(bool showingDesktop)
m_windowManagement
->
setShowingDesktop
(
showingDesktop
);
}
void
WindowUtil
::
minimizeAll
(
QQuickItem
*
parent
)
void
WindowUtil
::
minimizeAll
()
{
if
(
!
m_windowManagement
)
{
qWarning
()
<<
"Ignoring request for minimizing all windows since window management hasn't been announced yet!"
;
return
;
}
KWayland
::
Client
::
Surface
*
surface
=
nullptr
;
if
(
parent
)
{
QWindow
*
window
=
parent
->
window
();
if
(
window
)
{
surface
=
KWayland
::
Client
::
Surface
::
fromWindow
(
window
);
}
}
for
(
auto
*
w
:
m_windowManagement
->
windows
())
{
if
(
!
w
->
isMinimized
())
{
if
(
surface
)
{
w
->
unsetMinimizedGeometry
(
surface
);
}
w
->
requestToggleMinimized
();
}
}
}
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
())
{
w
->
unsetMinimizedGeometry
(
surface
);
}
}
void
WindowUtil
::
updateShowingDesktop
(
bool
showing
)
{
if
(
showing
!=
m_showingDesktop
)
{
...
...
components/mobileshell/windowutil.h
View file @
78712124
...
...
@@ -80,11 +80,16 @@ public:
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.
*/
Q_INVOKABLE
void
minimizeAll
(
QQuickItem
*
parent
);
Q_INVOKABLE
void
unsetAllMinimizedGeometries
(
QQuickItem
*
parent
);
Q_SIGNALS:
void
windowCreated
(
KWayland
::
Client
::
PlasmaWindow
*
window
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment