Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
KWin
Commits
71a5b00d
Commit
71a5b00d
authored
Oct 29, 2021
by
Vlad Zahorodnii
Browse files
Use QScopedPointer to store decoration object
This simplifies memory management. (cherry picked from commit
637d914f
)
parent
ea84b1ca
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/abstract_client.cpp
View file @
71a5b00d
...
...
@@ -2362,14 +2362,13 @@ void AbstractClient::createDecoration(const QRect &oldGeometry)
void
AbstractClient
::
destroyDecoration
()
{
delete
m_decoration
.
decoration
;
setDecoration
(
nullptr
);
m_decoration
.
inputRegion
=
QRegion
();
}
void
AbstractClient
::
setDecoration
(
KDecoration2
::
Decoration
*
decoration
)
{
m_decoration
.
decoration
=
decoration
;
m_decoration
.
decoration
.
reset
(
decoration
)
;
Q_EMIT
decorationChanged
();
}
...
...
src/abstract_client.h
View file @
71a5b00d
...
...
@@ -742,10 +742,10 @@ public:
// decoration related
KDecoration2
::
Decoration
*
decoration
()
{
return
m_decoration
.
decoration
;
return
m_decoration
.
decoration
.
data
()
;
}
const
KDecoration2
::
Decoration
*
decoration
()
const
{
return
m_decoration
.
decoration
;
return
m_decoration
.
decoration
.
data
()
;
}
bool
isDecorated
()
const
{
return
m_decoration
.
decoration
!=
nullptr
;
...
...
@@ -1323,7 +1323,7 @@ private:
}
m_interactiveMoveResize
;
struct
{
KDecoration2
::
Decoration
*
decoration
=
nullptr
;
QScopedPointer
<
KDecoration2
::
Decoration
>
decoration
;
QPointer
<
Decoration
::
DecoratedClientImpl
>
client
;
QElapsedTimer
doubleClickTimer
;
QRegion
inputRegion
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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