fix screenForContainment when screen ids > count
ClosedPublic

Authored by mart on Oct 10 2016, 2:14 PM.

Details

Summary

the check that was there, screen id not being more
than screen count is not valid anymore with the
screenpool approach, a screen id can be bigger than
the screen count in cases such as middle screen of a 3 screen
system disabled, or driver change (in which unfortunately,
connector names can change)
without this, a new containment was created for each startup.

BUG:369665

Test Plan

created a puroposefully corrupted plasmashellrc file,
where one known screen has a big number as id.
without patch a new containment is added in appletsrc each time
with the patch it behaves fine.

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mart updated this revision to Diff 7263.Oct 10 2016, 2:14 PM
mart retitled this revision from to fix screenForContainment when screen ids > count.
mart updated this object.
mart edited the test plan for this revision. (Show Details)
mart added a reviewer: Plasma.
Restricted Application added a project: Plasma. · View Herald TranscriptOct 10 2016, 2:14 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript

I can see how this is a bug that needs fixing for the a screen ID > screenCount but what about the case where the screenID isn't valid anymore?

i.e
a panel was on screen 2 you shutdown (assuming ID's are also 1 and 2 respectively)
when you boot up you now only have 1 screen

Before the code would return -1
This would put it on screen 2 which doesn't exist - will that cause a problem?

mart added a comment.Oct 10 2016, 2:31 PM

I can see how this is a bug that needs fixing for the a screen ID > screenCount but what about the case where the screenID isn't valid anymore?

i.e
a panel was on screen 2 you shutdown (assuming ID's are also 1 and 2 respectively)
when you boot up you now only have 1 screen

Before the code would return -1
This would put it on screen 2 which doesn't exist - will that cause a problem?

i think it shouldn't (as, no views should be created anyways unless we do actually have a qscreen for it)
but it definitely needs more test.
i think this should either require more checking when creating panels (only panels i think, desktops may have problems)
or, change the check to see if an association between screen id/name is in screenpool and if there is a qscreen corrisponding it.
I probably like more the latter as it would have almost the same logic as before, just "correct"

mart updated this revision to Diff 7265.Oct 10 2016, 2:47 PM
  • bring back old logic
mart added a comment.Oct 10 2016, 2:49 PM

this version has the old logic again, it iterates trough all the screens but doesn't check for ids being < of the count, it just checks that thre is a qscreen for that screen id by using the association in screenpool

davidedmundson accepted this revision.Oct 10 2016, 2:50 PM
davidedmundson added a reviewer: davidedmundson.
This revision is now accepted and ready to land.Oct 10 2016, 2:50 PM
This revision was automatically updated to reflect the committed changes.