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 Workspace
Commits
82996c4f
Commit
82996c4f
authored
Jan 11, 2021
by
Xaver Hugl
Browse files
Make sure panels are created on the correct screen
BUG: 408060
parent
d8e0071f
Changes
1
Hide whitespace changes
Inline
Side-by-side
shell/shellcorona.cpp
View file @
82996c4f
...
...
@@ -1902,11 +1902,16 @@ Plasma::Containment *ShellCorona::addPanel(const QString &plugin)
return
nullptr
;
}
// find out what screen this panel should go on
QScreen
*
wantedScreen
=
QGuiApplication
::
screenAt
(
QCursor
::
pos
());
QList
<
Plasma
::
Types
::
Location
>
availableLocations
;
availableLocations
<<
Plasma
::
Types
::
LeftEdge
<<
Plasma
::
Types
::
TopEdge
<<
Plasma
::
Types
::
RightEdge
<<
Plasma
::
Types
::
BottomEdge
;
for
(
auto
it
=
m_panelViews
.
constBegin
();
it
!=
m_panelViews
.
constEnd
();
++
it
)
{
availableLocations
.
removeAll
((
*
it
)
->
location
());
if
((
*
it
)
->
screenToFollow
()
==
wantedScreen
)
{
availableLocations
.
removeAll
((
*
it
)
->
location
());
}
}
Plasma
::
Types
::
Location
loc
;
...
...
@@ -1929,22 +1934,11 @@ Plasma::Containment *ShellCorona::addPanel(const QString &plugin)
Q_ASSERT
(
panel
);
m_waitingPanels
<<
panel
;
//not creating the panel view yet in order to have the same code path
//between the first and subsequent plasma starts. we want to have the panel appearing only when its layout is completed, to not have
//many visible relayouts. otherwise we had even panel resizes at startup that
//made al lthe full representations be loaded.
m_waitingPanelsTimer
.
start
();
const
QPoint
cursorPos
(
QCursor
::
pos
());
const
auto
screens
=
QGuiApplication
::
screens
();
for
(
QScreen
*
screen
:
screens
)
{
//m_panelViews.contains(panel) == false iff addPanel is executed in a startup script
auto
panelView
=
m_panelViews
.
value
(
panel
);
if
(
panelView
&&
screen
->
geometry
().
contains
(
cursorPos
))
{
panelView
->
setScreenToFollow
(
screen
);
break
;
}
}
// immediately create the panel here so that we have access to the panel view
createWaitingPanels
();
m_panelViews
.
value
(
panel
)
->
setScreenToFollow
(
wantedScreen
);
return
panel
;
}
...
...
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