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:
resize(size()) does not no-op in QWindow, and actually processes the
resizing. This performs a check that the action is valid.
Test Plan: Resized my panel, all seemed to still work.
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3001
Summary:
Also change positionPanelTimer to not call positionPanel() manually as
restore already does this.
Test Plan: Bshah
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3000
Summary:
When moving panel between two screens there is time when panel is on
edge of screen and screenToFollow is null, at this point if any of the
resize or position operation gets triggered, it will attempt to get
screenToFollow's size or geometry and will result in crash as for
sometime screenToFollow is null.
This is quite a timing related bug, if you manage to move panel in time
there would be no crash otherwise there are 3-4 different crashes are
possible.
To solve this we avoid setting null values for screenToFollow, this
should not happen ideally, but setting breakpoint on setScreenToFollow
shows that null value is set from QML and should be investigated.
BUG: 369228
Test Plan:
moved panel around like crazy, can't reproduce crash on
QScreen::size or QScreen::geometry, without patch it would crash 100%
Reviewers: mart, #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2970
Summary:
If we don't pass the current screen to QCursor::pos, it will return
position relative to primary screen, which obviously won't be in panel
geometry.
Instead pass it currentScreen, this way we don't filter out the mouse
events for panel.
BUG: 368790
FIXED-IN: 5.8.1
Test Plan:
added debug statements and verified that I get correct screen position
and as well, panel is now interactive on secondary screen.
Reviewers: mart, graesslin, #plasma, sebas
Reviewed By: graesslin, #plasma, sebas
Subscribers: sebas, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2960
Summary:
We have a big case because the size depend on whether the panel is vertical or horizontal
but it doesn't really bring much.
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2813
Summary:
Whenever we restore, the position of the panel can be random, we need to ensure
that it's placed in the screen boundaries.
I could easily reproduce by having the a vertical set up where the primary
persistent screen is below. Disconnecting the screen above would call restore
but leave the screen in the same position (with very big Y) but with the new
width.
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2812
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:
::restore uses ::config which changes depending on the containment used.
calling positionPanel before restoring, means we're loading
garbage values. This was hidden as location was set just after which
did call restore().
Saves one incorrect resize.
Test Plan:
qDebug + starting plasmashell
Reviewers:
Marco Martin
Subscribers:
the panel size and position is saved per-screen resolution
so at different resolutions (or different screens) the panel always goes
back where it was with the size it had.
this should give a more deterministic behavior to the panel
when resizing the screen (like virualbox) or docking to
an external docking styation
BUG:368741
reviewed-by: David Edmundson <david@davidedmundson.co.uk>
Summary:
Sometimes the left/right panel edge shadows don't get drawn.
A resize doesn't always call positionPanel so it never gets updated on all
size changes.
Putting it in the event handlers rather than in the setting, means it
will never be missed again.
Test Plan:
Set panel to fill width
Resizing now shows correct corner
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2668
Summary:
Connecting to QObject::destroyed with Qt::QueuedConnection *should*
crash, when you use the object that's been deleted. it doesn't make any
logical sense.
The only reason it doesn't is because of another hack in Plasma-
framework where containment.cpp where containment emits
QObject::destroyed (yes really) before the actual destruction.
Unfortunately we can't fix the hack in frameworks till we fix this hack
round the original hack here.
This patch ports it to a different signal, which is emitted before
object teardown without hacks.
Test Plan: checked debug appeared when deleting a panel
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2570
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:
Reduces code duplication and we always opperate on cached value, that
is the platform is only checked once in application life cycle.
Reviewers: #plasma, hein
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2342
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
when the containment (or an applet in it)
gains the state Plasma::AcceptingInputStatus
force the focus to the panel window, restoring
the behavior of Plasma4
BUG: 364276
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
QX11Info::connection() looks up the connection in the QPA.
The Wayland QPA happens to have a property with the same name,
so it happily reinterpret_casts a wl_connection_t* to xcb_connection_t*
and disaster ensues.
Differential Revision: https://phabricator.kde.org/D1718
The newly introduced HiddenStatus which is used by eg. the desktop pager to completely
hide itself when there is only one virtual desktop, has a higher value than
RequiresAttentionStatus for ABI compatibility reasons, so auto-hide was never actually
enabled if you had this applet (part of the default setup) with just one virtual desktop.
BUG: 362105
FIXED-IN: 5.6.5
Differential Revision: https://phabricator.kde.org/D1683
Summary:
starting the stuts timer in resize/move events means we don't have to
litter it across any code that might move/resize the panel, also we get
event compression for free (so could probably remove the timer in
future).
Much neater and fixes a bug.
BUG: 362887
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1584
My second (internal) screen is disabled and has 0x0 size.
This fixes setting the struts for panel and correctly calculating
the available desktop area.
CCBUG: 348043
Differential Revision: https://phabricator.kde.org/D1238
Summary:
cache screenGeometry in local var
replace size().width() with width()
Reviewers: #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1171
the panel geometry is intersected with the QScreen geometry,
that doesn't work with rects of empty sizes.
This fixes the panel sometimes being positioned at 0,0 at startup
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.
Views shouldn't decide to delete themselves.
ShellCorona is responsible for managing them, it should be the one
managing them in all cases.
bring panelContainmentDestroyed and desktopContainmentDestroyed in line
REVIEW: 127225
Summary:
If the window's platform surface was destroyed, there is also
no shadow to be removed.
Both X and Wayland code will try to create the platform surface
again, and it will lead to crash in other code that doesn't expect
platform surface to be created when the containment is being deleted.
This fixes crash in PanelConfigView::event when removing panels.
Reviewers: graesslin, #plasma
Reviewed By: graesslin, #plasma
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D951
Summary:
Since Qt 5.5 there is a dedicated event when a PlatformSurface gets
created. This allows us to know when we need to setup the Wayland
integration.
Reviewers: mart
Subscribers: plasma-devel
Differential Revision: https://phabricator.kde.org/D819
this manages the new systray: if a config for a containment is asked,
treat it like an applet if it's not the actual panel containment
behavior is not changed for anything else
Emitting objects in another object is weird.
ShellCorona::availableScreenRect knows what properties of panelview we
use, so tracking of property changes should be in ShellCorona.
Also simplify ShellCoronaCode, if the rect changes the region has also
implicitly changed. We can handle that in one connect.
REVIEW: 126576
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
engine()->rootContext() will give a different result to
rootContext() when using a shared engine.
One being in the right context, the other being the context of the
shared engine. Using the latter means two panels end up sharing the same
object which leads to some interesting results and QML crashes in
QV4::QObjectWrapper::wrap when one gets deleted.
I've tested against 356545, but I think it's the cause of a lot of the
mystery QML bugs we couldn't figure out.
BUG: 356545
BUG: 355885
BUG: 356916
REVIEW: 126491
Last patch has a reggression due to QtQuick issue (only on Xcb):
QEvent::Leave is triggered after QEvent::MouseButtonPress Qt::LeftButton
BUG: 354651
REVIEW: 126331
Turns out that this method is sometimes called at the time where the
virtualGeometry() is invalid -- which sounds pretty much like a Qt bug,
but it isn't exactly the first bug in screen handling in Qt5. Rather
than producing values which are surely invalid, try to cover up the
mess.
REVIEW: 126216
Currently we're hitting a bug where the panel won't be displayed in the
correct position because of how the screen it's in is computed. See:
https://codereview.qt-project.org/#/c/139533/
This patch makes sure there's no off-by-1 issues by placing the screen
initially at the center.