Summary:
this is for the following setup:
the primary screen is at position 0,0 and gets disconnected.
the other screen will be moved at 0,0 and becomes primary
the screen is reconnected, the events arrive in the followin order:
1) a new screen gets added, at 0,0 position
(not primary yet, it may be markedredundant)
2) the screen becomes primary, both screens still at 0,0
3) the old screen gets moved out of the way
in the end result none of the two need to be redundant.
adding the old one in the redundant list, will cause reconsideroutputs
to consider it and create a view for it.
BUG: 377808
Test Plan:
added and removed sevaral times a primary screen at 0,0
also tried other positions of screens to check it doesn't make regressions
Reviewers: #plasma, sebas, subdiff, broulik
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D5323
Summary:
this is for the following setup:
the primary screen is at position 0,0 and gets disconnected.
the other screen will be moved at 0,0 and becomes primary
the screen is reconnected, the events arrive in the followin order:
1) a new screen gets added, at 0,0 position
(not primary yet, it may be markedredundant)
2) the screen becomes primary, both screens still at 0,0
3) the old screen gets moved out of the way
in the end result none of the two need to be redundant.
adding the old one in the redundant list, will cause reconsideroutputs
to consider it and create a view for it.
Test Plan: added and removed sevaral times a primary screen at 0,0
Reviewers: #plasma, broulik, sebas
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D5323
if applets react to it it can cause a crash, because the corona
may not be valid anymore, and we don't want to relayout
things anyways when tearing down
reviewed-by: kbroulik
Summary:
connect to Plasma::Corona::availableScreenRectChanged
instead of using kscreen, this way we should be more sure
that signal is emitted when it's safe to call
corona()->availableScreenRect() as the change of rect
may happen after a screen removal, so may mean
accessing a desktop view while being deleted
BUG:377298
Test Plan:
notifications still pop up in the proper place,
couldn't reproduce the crash neither before nor after tough
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D4991
Use iterators and their key() and value() methods.
This codepath is hit 200+ times on plasmashell startup for me
Before: 420,000 ns
After: 200,000 ns
Differential Revision: https://phabricator.kde.org/D4349
Summary:
isOutputRedundant badly failed when two screens had
the exact same geometry (that should be, the base
case for "cloning" screens.
now the logic is:
a screen is redundant if:
* its geometry is contained in another one
* if their resolutions are different, the "biggest" one wins
* if they have the same geometry, the one with the lowest id wins (arbitrary, but gives reproducible behavior and makes the primary
BUG:375507
Test Plan:
tested with two screens:
* overlapping, same resolution: the lowest id (0, the primary) wins, the other one doesn't get a view
* overlapping, different resolutions: the biggest one wins
* not overlapping: both get a view
Reviewers: sebas, #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D4309
Summary:
isOutputRedundant badly failed when two screens had
the exact same geometry (that should be, the base
case for "cloning" screens.
now the logic is:
a screen is redundant if:
* its geometry is contained in another one
* if their resolutions are different, the "biggest" one wins
* if they have the same geometry, the one with the lowest id wins (arbitrary, but gives reproducible behavior and makes the primary
BUG:375507
Test Plan:
tested with two screens:
* overlapping, same resolution: the lowest id (0, the primary) wins, the other one doesn't get a view
* overlapping, different resolutions: the biggest one wins
* not overlapping: both get a view
Reviewers: sebas, #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D4309
Summary:
isOutputRedundant badly failed when two screens had
the exact same geometry (that should be, the base
case for "cloning" screens.
now the logic is:
a screen is redundant if:
* its geometry is contained in another one
* if their resolutions are different, the "biggest" one wins
* if they have the same geometry, the one with the lowest id wins (arbitrary, but gives reproducible behavior and makes the primary
BUG:375507
Test Plan:
tested with two screens:
* overlapping, same resolution: the lowest id (0, the primary) wins, the other one doesn't get a view
* overlapping, different resolutions: the biggest one wins
* not overlapping: both get a view
Reviewers: sebas, #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D4309
when the screen is resized, emit
screenGeometryChanged
availableScreenRegionChanged
availableScreenRectChanged
to notify all the applets
reviewd-by: Eike Hein
Summary:
due to old multiscreen bugs, sometimes the appletsrc file
gets polluted with a lot of containments with same activity id
and lastScreen, in some cases even hundreds
(see https://bugs.kde.org/show_bug.cgi?id=371858)
in that case we can't be 100% sure what containment will be loaded
at startup, leading to an herratical behavior.
it was trying to clean up duplicates but wasn't really effective
now base upon lastScreen (so we catch other activities as well)
and manually remove the destroyed containment from
m_desktopContainments (which may sole some multiscreen
related bug, such as 371991)
BUG:371858
CCBUG:371991
Test Plan:
started a session with the corrupted appletsrc from the bugreport,
file gets cleaned out of duplicates
Reviewers: davidedmundson, #plasma
Reviewed By: davidedmundson, #plasma
Subscribers: davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3981
Summary:
due to old multiscreen bugs, sometimes the appletsrc file
gets polluted with a lot of containments with same activity id
and lastScreen, in some cases even hundreds
(see https://bugs.kde.org/show_bug.cgi?id=371858)
in that case we can't be 100% sure what containment will be loaded
at startup, leading to an herratical behavior.
it was trying to clean up duplicates but wasn't really effective
now base upon lastScreen (so we catch other activities as well)
and manually remove the destroyed containment from
m_desktopContainments (which may sole some multiscreen
related bug, such as 371991)
BUG:371858
CCBUG:371991
Test Plan:
started a session with the corrupted appletsrc from the bugreport,
file gets cleaned out of duplicates
Reviewers: davidedmundson, #plasma
Reviewed By: davidedmundson, #plasma
Subscribers: davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3981
Summary:
It's exported and we're including the include path in our cmake so we
had two paths to the same thing included.
Test Plan: Compiled
Reviewers: #plasma, markg
Reviewed By: markg
Subscribers: markg, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D4030
Test Plan:
Now get a populated Panel's menu
(this doesn't answer why Marco and Kai said it worked for them though?)
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3944
Summary:
Both when exporting and importing plasma layout to json
consider the panel visibility as well together the other
properties
BUG:374226
Test Plan: tried an exported layout with autohide panel
Reviewers: davidedmundson, #plasma
Reviewed By: davidedmundson, #plasma
Subscribers: davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3852
Summary:
this replaces the approach with the expose event in
20b439a4f4 by directly monitoring the xcb screen change
notify native event
Test Plan:
attaching and detaching the external screen on a laptop
configured to deactivate the internal screen upon connection
same behavior as D3777
Reviewers: sebas, davidedmundson, #plasma
Reviewed By: davidedmundson, #plasma
Subscribers: pmuralidharan, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3822
Summary:
this replaces the approach with the expose event in
20b439a4f4 by directly monitoring the xcb screen change
notify native event
Test Plan:
attaching and detaching the external screen on a laptop
configured to deactivate the internal screen upon connection
same behavior as D3777
Reviewers: sebas, davidedmundson, #plasma
Reviewed By: davidedmundson, #plasma
Subscribers: pmuralidharan, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3822
Summary:
in a corner case that is used a lot, the internal laptop screen
gets automatically disabled when an external screen is connected.
the only QScreen* available from the QGuiApp gets recycled for the
new screen and there is no signal this switch occurred.
To work around this, as all the view get an expose event when this happen,
monitor the rename of the desktopview's qscreen and manage this separatedly
in the shell.
BUG:373880
Test Plan:
connection and disconnecting an external screen to the laptop
both in the case of internal screen enabled or disabled
Reviewers: davidedmundson, #plasma
Reviewed By: davidedmundson, #plasma
Subscribers: davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3777
Summary:
in a corner case that is used a lot, the internal laptop screen
gets automatically disabled when an external screen is connected.
the only QScreen* available from the QGuiApp gets recycled for the
new screen and there is no signal this switch occurred.
To work around this, as all the view get an expose event when this happen,
monitor the rename of the desktopview's qscreen and manage this separatedly
in the shell.
BUG:373880
Test Plan:
connection and disconnecting an external screen to the laptop
both in the case of internal screen enabled or disabled
Reviewers: davidedmundson, #plasma
Reviewed By: davidedmundson, #plasma
Subscribers: davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3777
Summary: We need old id of new primary screen. After we update primary screen in screenpool, it will always return id = 0. It causes invalid m_desktopViewforId mapping and panel doesn't move next time when we change primary screen.
Test Plan:
Preconditions:
Computer with 1 display, running plasmashell
Test steps:
1. Connect one external screen (first screen is primary)
2. Change primary screen to second screen
3. Change primary screen back to first screen
4. Unplug second screen
Expected:
In step 3 panel moves to first screen
In step 4 plasmashell keeps running
Actual (before change):
In step 3 panel remains on second display
In step 4 plasmashell crashes
BUG: 372963
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3519
It registers global shortcuts Meta+1 through 9 and 0 and will ask the first task manager
it finds* to activate the task at the given index.
*) It searches all panels on the primary screen for an applet that provides "multitasking"
(ie. task manager, icon task, window list) and invokes said method. If there is none, it
will then search all panels. This will fit the 90% usecase and avoids an overly complex
configuration workflow.
Differential Revision: https://phabricator.kde.org/D3581
Summary:
Otherwise we have a gap during load (waiting querying kactivities))
between screen pool being created and us connecting to the screen
changed signals, which in turn are used to update screen pool.
In particular the primary screen can get out of sync between the current
state and the screen pool.
Test Plan: Based on Christopher Feck's research and initial patch
Reviewers: #plasma
Subscribers: mart, rwooninck, fvogt, cfeck, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3319
CCBUG:372099
CCBUG:371858
CBUG:371991
CCBUG:371819
CCBUG:371734
Summary:
load() can be called multiple times; either from setShell or
loadLookAndFeelDefaultLayout. We still only want addOutput once when a
screen is added
Reviewers: #plasma, apol
Reviewed By: apol
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3320
CCBUG:372099
CCBUG:371858
CBUG:371991
CCBUG:371819
CCBUG:371734
at startup, if a screen id is missing from the screenpool mapping
containment::screen() will return -1 for a moment in the startup
phase even if it has a valid lastScreen
populate mappings of eventual missing stuff at screenpool ctor
make sure destroyed containments don't get assigned a view
reviewed-by: David Edmundson
CCBUG:372099
CCBUG:371858
CCBUG:371991
CCBUG:371819
CCBUG:371734
Summary:
layout.js used to be run before any containments were added. This was
broken in a697d291 which creates desktop containments for that activity
first.
However, some scripts rely on being able to alter global configuration
before any containments are loaded.
In order to allow the same functionality we need to provide a new hook
for whatever these scripts may need to do.
BUG: 371704
Test Plan: Not done yet.
Reviewers: #plasma, mart
Reviewed By: mart
Subscribers: apol, mart, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3220
Summary:
Setting the screenpool primary screen changes the mapping of ID ->
connector. We need this to be done before the
DesktopView::setScreenToFollow is called because otherwise it will save
lastScreen with the wrong ID.
CCBUG: 370711
Test Plan:
Hot swapped primary, both things swapped.
Restarted Plasma
Things restored as I think they should be.
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3098
when a screen goes away, screenToFollow can die for a short instant,
the view will be shortly killed but we don't want to access screenToFollow()
in the meantime
we don't want
BUG:371201
Summary:
now that KWayland is a framework, it's used directly from
Dialog, no need to inject kwayland usage from here anymore
Test Plan: Dialogs still have shadows and still move under wayland
Reviewers: #plasma, graesslin
Reviewed By: #plasma, graesslin
Subscribers: graesslin, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3024
Summary:
restore the missing panel properties:
alignment
minimum length
maximum length
offset
also, allow non integer values for the measures (height, min/max, offset)
BUG:368074
BUG:367918
Test Plan:
dumped a config with a custom panel, different height/alignment/offset etc
started a new plasma session with that l&f package, restored panel correctly
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3021
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.
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3006
Summary:
after the latest activities refactor, containments weren't
deleted anymore upon activity deletion.
Test Plan:
created and deleted activities while monitoring how appletsrc file
was updated
Reviewers: ivan, #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2967
Summary:
during a type switch
if the new containment gets saved before getting a view,
it will get lastScreen=-1 so the next boot
it will create a new containment
Test Plan:
switched repeatedly between desktop and folderview
the config file always got with the correct lastScreen=0 entry
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2966
Summary:
on first startup all the desktop views already exist after the
script has been executed, so check the screen doesn't already have
a view for that screen before creating one
BUG:368891
Test Plan: tested both first and subsequent startups, one desktopview per screen created, containment config dialog coming up (and only one of them)
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2885
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.
reviewed-by: David Edmundson
at first startup, createWaitingPanels was already
executed when the js setup script terminated.
in this case, don't re-add it to m_waitingPanels
reviewed-by: David Edmundson
Summary:
Empty panel is now shipped as a LayoutTempate rendering this code
redundant.
Test Plan: Still have both default and empty panels listed
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2747
Summary:
some panel plugins don't want to be displayed in the context menu
with the NoDisplay key.
for instance, the systray
Reviewers: #plasma, bshah
Reviewed By: #plasma, bshah
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2727