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
KWin
Commits
e5561b19
Commit
e5561b19
authored
Apr 18, 2022
by
Vlad Zahorodnii
Browse files
Remove AbstractClient plumbing casts in WindowItem
parent
76a3a31f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/windowitem.cpp
View file @
e5561b19
...
...
@@ -21,11 +21,9 @@ WindowItem::WindowItem(AbstractClient *window, Item *parent)
:
Item
(
parent
)
,
m_window
(
window
)
{
auto
client
=
static_cast
<
AbstractClient
*>
(
window
->
isClient
()
?
window
:
nullptr
);
if
(
client
)
{
connect
(
client
,
&
AbstractClient
::
decorationChanged
,
this
,
&
WindowItem
::
updateDecorationItem
);
updateDecorationItem
();
}
connect
(
window
,
&
AbstractClient
::
decorationChanged
,
this
,
&
WindowItem
::
updateDecorationItem
);
updateDecorationItem
();
connect
(
window
,
&
AbstractClient
::
shadowChanged
,
this
,
&
WindowItem
::
updateShadowItem
);
updateShadowItem
();
...
...
@@ -108,12 +106,11 @@ void WindowItem::updateShadowItem()
void
WindowItem
::
updateDecorationItem
()
{
auto
client
=
static_cast
<
AbstractClient
*>
(
m_window
->
isClient
()
?
m_window
:
nullptr
);
if
(
!
client
||
client
->
isZombie
())
{
if
(
m_window
->
isDeleted
()
||
m_window
->
isZombie
())
{
return
;
}
if
(
client
->
decoration
())
{
m_decorationItem
.
reset
(
new
DecorationItem
(
client
->
decoration
(),
client
,
this
));
if
(
m_window
->
decoration
())
{
m_decorationItem
.
reset
(
new
DecorationItem
(
m_window
->
decoration
(),
m_window
,
this
));
if
(
m_shadowItem
)
{
m_decorationItem
->
stackAfter
(
m_shadowItem
.
data
());
}
else
if
(
m_surfaceItem
)
{
...
...
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