Allow the Panel to get active keyboard focus via a kwyboard shortcut which will cycle between all panels.
When a panel has focus, the active focus can be navigated around either with tab/backtab or arrow keys.
Simple popup applets which only display an icon will work automatically,
Complex applets like the System tray or the taskbar will have focus that can navigate on all their sub-elements, to activate a particular systray applet or activate a particular window
Co-authored with Benjamin Port<benjamin.port@enioka.com>
CCBUG: 352476
The fake drag-and-drop events caused by the panel reuse the real event's
mimeData, and were handled asynchronously. By the time the fake event
has been dispatched from the event loop, the mimeData may already have
been freed. Send the fake events synchronously again.
A guard is added to avoid the original potential bug of infinite recursion.
BUG: 398440
We do this sometimes, but not consistenly.
The benefit is twofold.
First it improves the diff when adding new values since no existing line needs to be touched.
Second it prevents clang-format from collapsing the definition into a single line, which is undesired for large enums.
Summary:
--when the containment background hints are updated then the
panel shadows should be also. In case the background hints
point to NoBackground the panel shadows should be removed
and in case they point to DefaultBackground they should be
drawn again
--PanelShadows::removeWindow has no place in updateEnabledBorders
because the window still lives. When removeWindow was executed
before it was faulty unregistered from PanelShadows and in order for
setEnabledBorders to work again we should need
to execute from start the PanelShadows::addWindow function
FIXED-IN:5.17.3
Test Plan:
--I have created an applet which a PlasmaComponents.Switch button
and toggles panel transparency on user demand easily
Reviewers: #plasma, davidedmundson, mart
Reviewed By: #plasma, davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D25121
Summary:
--when the containment background hints are updated then the
panel shadows should be also. In case the background hints
point to NoBackground the panel shadows should be removed
and in case they point to DefaultBackground they should be
drawn again
--PanelShadows::removeWindow has no place in updateEnabledBorders
because the window still lives. When removeWindow was executed
before it was faulty unregistered from PanelShadows and in order for
setEnabledBorders to work again we should need
to execute from start the PanelShadows::addWindow function
Test Plan:
--I have created an applet which a PlasmaComponents.Switch button
and toggles panel transparency on user demand easily
Reviewers: #plasma, davidedmundson, mart
Reviewed By: #plasma, davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D25121
Summary:
when plasma is starting up, there are no panel views yet
this means that if a thickness (or other values)
are written to the config file and then the resolution changes before
the panel view gets created, we'll have a view that will default
to 30 pixels regardless what the layout js file specified.
This makes the scripting only write to a [Default] group for resolution
dependent properties when panels are not actually present
when they are already there, interact directly with the view which is
the safest option.
the view will use whatever is in the defaults group as default if the
resolution dependent is there, and when a new value is set for a
resolution dependent one, also update the default, which will
be used when screen resolution changes, as new default value
Test Plan:
* With virtualbox, change resolution continuously when plasma is starting up
with an empty setup, panel is the expected size now, as opposed to 30
* Stop Plasma. Change Screen resoluton with plasma *not* running, to a resoluton
still "unknown" to plasmashellrc, then start plasma again. Now the thickness saved
in [Default] is picked, instead of the arbitrary 30
Reviewers: #plasma, broulik
Reviewed By: #plasma, broulik
Subscribers: apol, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D22893
Summary:
With Plasma dialogs & tooltips the mask is only set on the widget itself
if compositing is off. Instead is the mask explicitly passed for the
KWindowEffects.
The recent changes to fix the blurbehind & contrast mask with panels
instead turned to always set the mask on the widget. For some reason
yet to be understood this can sometimes result in an offset by a pixel
between the mask used for painting and the mask used for the window effects.
Aligning the mask setting code with the one for dialogs & tooltips makes
the symptom go away for now, and also delivers consistency.
BBUG: 406380
FIXED-IN: 5.16.1
Test Plan:
Using different themes, including Adapta & Arc Dark, a gap can no longer
been seen. Only with compositing turned off, which is old behaviour due to
the real bug yet to understand completly.
Resizing panels or changing screen resolution also works without breaking
rendering or panel contents interaction.
Reviewers: #plasma, hein
Reviewed By: #plasma, hein
Subscribers: hein, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D21803
Summary:
The actual mask is now queried from the panel, there is no more need
for this.
Reviewers: #plasma, mart
Reviewed By: #plasma, mart
Subscribers: davidedmundson, mvourlakos, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D21013
Summary:
To test if the panel is under the cursor we used:
if (geometry().contains(QCursor::pos(screenToFollow()))) {
Unsurprisingly in wayland we don't know the cursor position once it's
left our window. Behaviour seems to be undefined.
We were already using enter and leave events to start the autohide
timer, so we may as well rely on that for tracking state too.
BUG: 377838
Test Plan:
Tested mouse in, mouse out
Tested mouse in and waiting and panel stayed open
Tested opening wifi applet and closing it
That will trigger the restoreAutoHide method as an applet status changed
The panel stayed open because the mouse was on it.
Reviewers: #plasma, mart
Reviewed By: #plasma, mart
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D10101
Summary:
This is meant as a more generic fix for the autohide panels, actually
looking to see what transient windows we have open.
The problem with the current fixes (D6555) being posted is that we
potentially get attentionStatus in a corrupt status as we cache the
value but it might change externally whilst that window is open.
Also saves duplicating code in a bunch of places.
Test Plan:
Set autohide
Opened a context menu in task manager didn't autohide, till I closed it
Closing menu whilst keeping mouse in the panel doesn't auto hide it
until we move out after.
Hovering over TM tooltip keeps autohide from closing (another fix)
BUG: 352459
BUG: 347855
BUG: 351823
Reviewers: #plasma, broulik
Reviewed By: #plasma, broulik
Subscribers: broulik, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D6577
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
Summary:
This patch adds a variable called "backgroundHints"
which can be used with (NoBackground) through qml
in order to enable/disable the KWin effects for
a specific panel and the panel shadows in case the
effects are disabled.
Currently these effects are (Blur and Background Contrast)
Reviewers: #plasma, #davidedmundson
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3282
FEATURE: 368384
Summary:
PanelView::restore sets various properties including length, thickness,
which would result in panel resize and repositioning. PanelView::restore
also explicitly calls PanelView::positionPanel and ::resizePanel.
This results in positionPanel and resizePanel operation being done
multiple times at startup/adding panel and hence flicker when panel
first shows up. This patch makes resizePanel and positionPanel no-op if
we are restoring panel.
Test Plan: Added panel, restored panel, moved around panel
Reviewers: #plasma, mart
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3008
Summary:
The visibility mode needs to be passed to KWayland by mapping to the
PanelBehavior. This is required to pass the correct hint to KWin to
adjust the layering, etc.
BUG: 368499
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2789
Summary:
KWin starting with 5.7 supports struts on panels between screen edges.
Thus we can start setting struts on such panels, it won't exclude a
complete screen. But we don't know how other window managers handle it
and it's in general a rather "dangerous" change.
Thus to not affect other window managers, we check whether KWin is
running and only allow struts on thus panels if KWin is running.
Unfortunately we need to test this every time we go into the code path
as the WM might have changed.
In case the user replaces the window manager at runtime this still can
result in a bad situation.
BUG: 94470
FIXED-IN: 5.8.0
Test Plan:
Tested whether it works in general in X11. Further testing
needed by X11, multi-screen users.
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2164
Summary:
We used to append them, but that didn't work well and was crashing plasmashell
on fresh start.
A default desktop would be created alongside with the one provided by the
layout instead of replacing it.
If a layout wants to provide an additional screen for a desktop in the secondary
screen, it should specify the screen.
Test Plan:
Now the plasmashell tests pass. In fact I noticed it was broken due to an e-mail
Jonathan sent me that the test on neon was timing out. The test in neon will
freeze when the test crashes. Probably something to look into.
It can be reproduced by running:
```
xvfb-run -a --server-args="-screen 0 1024x768x24" dbus-launch --exit-with-session <exec>
```
Where `exec` is the process we need to run.
Now the test passes.
It's a crash that I had reproduced locally in the past. I can't now.
Reviewers: #plasma, mart
Reviewed By: mart
Subscribers: sitter, jriddell, plasma-devel, #neon
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2117
I noticed that panels had borders on all sides and it turns out PanelShadows was never
actually told which sides should have shadows.
To reduce code duplication I expose the enabled borders as property to the Panel.qml
which itself does the same calculation from QML again and does it many times.
Differential Revision: https://phabricator.kde.org/D1756
Don't save and restore panel length
length gets overriden from the QML side so there is no point loading and
restoring it.
This also simpifies code somewhat removing places where we clearly did
the same bit of code twice.
The basic design of Plasma is that scripts and and the shell (in theory)
manipulate a tree of basic applet geometry and configs.
Plasmashell then reacts to those changes and displays them visually with
a distinct separation between the layout and UI.
Panel's scriptengine seemed to do away with all, and try and manipulate
the graphic object directly..which might not exist and that leads to
complex code.
This changes it to read/write from the same config object as
PanelView will use. More akin to how the script engine for applet and
contiainment works.
If there's a view for this panel, we update immediately, otherwise it'll
just get loaded when it's needed. PanelView::reload() has the error
checking/bounds management so no point duplicating that.
BUG: 355918
REVIEW: 125921
Use KWin to lower/raiser panel in windows can cover mode with edge
activation like autohide does.
This means if you have a maxmised menu you can still open the panel by
moving the mouse to the bottom of the screen
BUG: 343448
This change introduces the first part of Wayland integration. If
running on platform Wayland we try to bind the org_kde_plasma_shell
interface through the help of KWayland client library. If this interface
is available we can use it to create a PlasmaShellSurface for the
PanelView's window and mark that as a panel.
A compositor with support for the org_kde_plasma_shell interface can
use this information to make the window operate as a panel.
REVIEW: 124054
Workaround a lack of API from Qt where it will decide to move the panels
around without us being able to control it.
This patch overrides the QWindow::screenDestroyed slot to be able to decide
where to move the Panel or whether it needs to be removed. This is
considered a workaround and should be removed once the new API is in and
released.
See also: https://codereview.qt-project.org/#/c/88351/
BUG: 335710
This way, we don't need to have everything being repainted when geometries
change while constructing the panel.
Also don't connect to screen changed until everything is initialized and
the panel is displayed.