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
f7d913af
Commit
f7d913af
authored
Apr 18, 2022
by
Vlad Zahorodnii
Browse files
Remove AbstractClient plumbing casts in TabBox
parent
506863f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/tabbox/tabbox.cpp
View file @
f7d913af
...
...
@@ -283,8 +283,8 @@ TabBoxClientList TabBoxHandlerImpl::stackingOrder() const
const
QList
<
AbstractClient
*>
stacking
=
Workspace
::
self
()
->
stackingOrder
();
TabBoxClientList
ret
;
for
(
AbstractClient
*
toplevel
:
stacking
)
{
if
(
auto
client
=
static_cast
<
AbstractClient
*>
(
toplevel
->
isClient
()
?
toplevel
:
nullptr
))
{
ret
.
append
(
qWeakPointerCast
<
TabBoxClient
,
TabBoxClientImpl
>
(
client
->
tabBoxClient
()));
if
(
toplevel
->
isClient
(
))
{
ret
.
append
(
qWeakPointerCast
<
TabBoxClient
,
TabBoxClientImpl
>
(
toplevel
->
tabBoxClient
()));
}
}
return
ret
;
...
...
@@ -330,9 +330,8 @@ QWeakPointer<TabBoxClient> TabBoxHandlerImpl::desktopClient() const
{
const
auto
stackingOrder
=
Workspace
::
self
()
->
stackingOrder
();
for
(
AbstractClient
*
toplevel
:
stackingOrder
)
{
auto
client
=
static_cast
<
AbstractClient
*>
(
toplevel
->
isClient
()
?
toplevel
:
nullptr
);
if
(
client
&&
client
->
isDesktop
()
&&
client
->
isOnCurrentDesktop
()
&&
client
->
output
()
==
workspace
()
->
activeOutput
())
{
return
qWeakPointerCast
<
TabBoxClient
,
TabBoxClientImpl
>
(
client
->
tabBoxClient
());
if
(
toplevel
->
isClient
()
&&
toplevel
->
isDesktop
()
&&
toplevel
->
isOnCurrentDesktop
()
&&
toplevel
->
output
()
==
workspace
()
->
activeOutput
())
{
return
qWeakPointerCast
<
TabBoxClient
,
TabBoxClientImpl
>
(
toplevel
->
tabBoxClient
());
}
}
return
QWeakPointer
<
TabBoxClient
>
();
...
...
@@ -1245,11 +1244,10 @@ void TabBox::CDEWalkThroughWindows(bool forward)
// Q_ASSERT(Workspace::self()->block_stacking_updates == 0);
for
(
int
i
=
Workspace
::
self
()
->
stackingOrder
().
size
()
-
1
;
i
>=
0
;
--
i
)
{
auto
t
=
Workspace
::
self
()
->
stackingOrder
().
at
(
i
);
auto
it
=
static_cast
<
AbstractClient
*>
(
t
->
isClient
()
?
t
:
nullptr
);
if
(
it
&&
it
->
isOnCurrentActivity
()
&&
it
->
isOnCurrentDesktop
()
&&
!
it
->
isSpecialWindow
()
&&
!
it
->
isShade
()
&&
it
->
isShown
()
&&
it
->
wantsTabFocus
()
&&
!
it
->
keepAbove
()
&&
!
it
->
keepBelow
())
{
c
=
it
;
if
(
t
->
isClient
()
&&
t
->
isOnCurrentActivity
()
&&
t
->
isOnCurrentDesktop
()
&&
!
t
->
isSpecialWindow
()
&&
!
t
->
isShade
()
&&
t
->
isShown
()
&&
t
->
wantsTabFocus
()
&&
!
t
->
keepAbove
()
&&
!
t
->
keepBelow
())
{
c
=
t
;
break
;
}
}
...
...
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