if a containment's lastScreen is not -1 (and a valid screen)
*and* its activity() is not the current one, its QML
will *not* be loaded, therefore it would dangle blocking
corona::startupCompleted until the activity is selected
Change-Id: I6757d29240a012377e9ff0a22fe16541ea712ee6
* never enable all the borders just to take margins, there is fixedMargins for that
* redo ResizeOrigin: Dialog needs to sync from both sides: when the mainItem gets resized, *and* when the window gets resized (syncing mainItem)
* don't crash when there is no Layout: not all mainItems export one
* fix availableScreenGeometryForPosition()
Change-Id: I09370e33a3e8d03675b60f14c6c5754f8491d52c
updateLayoutParameters's uses the borders in order to set the max and
minimum size, and therefore syncToMainItemSize should always be called
before it is ever called.
Also added code to not do anything if we are not completely initialized.
As with containment, make sure Containment::applets()
is always sorted by id, to have the least sursprises possible
it adds a test
Change-Id: Ib1aeeff7c70bb6969b32b2fef8557889a43edf09
the order in which containments were restored used to be quite random:
ensure that's ordered by id this makes the shell startups be more reproduceable
from one to another, if a new containment arrives, ensure it's inserted
maintaining id order
containment::appelts() will need the same treatment
adds a test as well that checks the order is right
Change-Id: Ie1b278e5b83d7e3645f7293bf6d030aa7f43a221
if a containment's lastScreen is not -1 (and a valid screen)
*and* its activity() is not the current one, its QML
will *not* be loaded, therefore it would dangle blocking
corona::startupCompleted until the activity is selected
Change-Id: I6757d29240a012377e9ff0a22fe16541ea712ee6
Containments with no applets will emit uiReady now
It adds a test as well that checks if this is the case.
There is still a case where the corona doesn't emit startupCompleted()
that's when there is more than one activity, but that, as well the test
will be adressed by another patch on a different part.
Change-Id: I4d83aa612c29fb0f441d11681bc5aba241370bc3
Setting the implcit width to be the same as the current height is very
easy to end up looping.
actual height of the background is set by the base style, which is based
on the implicit sizes anyway.
BUG: 338750
Change-Id: Ic7606588cec09c6ff16515c208efe576466d31d6
still catalog actions by type
the order is still not exactly the same, but that's not possible, since the action order is decided in the context menu plugin and there are some actions only in the toolbox
CCBUG:338585
We are in a strange cycle when we have a visual parent. In order to
obtain our position, we need to know our size. Our size depends on the
borders visible. The borders visible depend on the size.
When we do not have a visual parent this is not a problem as we do not
have a position where we are supposed to be.
In order to solve this cycle, when we have a visual parent, we typically
assume we have all borders, call popupPosition, move to that position
and then use that new position to figure out the borders, get the new
size (incase any borders have changed) and move again. This double
moving is not good. With that patch, we still do the same but we avoid
moving twice.
We seem to have cases where once the dialog is visible and the visible
event is over, then the width/height updates itself, so we need to
reposition the dialog appropriately.
The functions are often called a number of times before the
component is actually completed. There is no point of this.
Also added a function updateLayoutParameters which update all 4
of these in a more efficient manner. There is a certain amount
of code duplication between those 4 functions and this one, but
that can be fixed in another patch.
- updateTheme should always be called the frameSvgItem's size has been
upated. It uses the geometry of the frameSvgItem. Also updated the
documentation.
- When a dialog has a visualParent, setting the position of the dialog
is slightly compilcated. In order to set the position we have to give
the function popupPosition the size of the dialog so that it can
determine where to place it, however the size of the dialog depends on
the position as some of the borders are drawn depending on the
position. We have a circular problem.
For now we're solving this by tempoarily giving the full size with all
the borders in the case when there is a visual parent.
Remove the timer and call syncToMainItemSize directly whenever it used
to be called. We avoid the extra event loop this way. This probably
breaks somethings, but we can figure that out and add tests for that.
The only place it is now used is when the window x/y position changes.
There is now a dedicated function to handle that.
This brings us one step closer to removing the entire sync timer
When the minimumWidth/Height of the attached Layout of the mainItem
would change. The following events would happen -
- updateMinimumWidth is called
--> results in resizeEvent being called
--> results in syncMainItemToSize
--> results in slots connected to mainItem widthChanged
---> syncMainItemToSize + syncToMainItemSize being called a few more
times. It's not entirely apparent why at thist point.
This kind of logic is quite hard to follow and more importantly because
of the timers in the middle, an extra paint event is called. This means
the user can first see the window resize and then the item getting
resized.
This patch introduces a little bit of code duplication (can be fixed in
future commits) to clearly establish what updateMinimumWidth should be
doing -
* disconnect signals to make sure mainItem's widthChange is not triggered
* update window size + item size + borders
* reposition if required
The repositioning is useful as currently if a dialog becomes wider if
will not reposition itself and will overflow. With this patch we always
make sure the entire dialog is shown.
Minor Point: On testing without the patch the dialog does reposition
itself if it is not already overflowing. I suspect this is kwin moving
the window.
A test called dialog_minWidthHeighRepositioning.qml can be used to see
how the change occurs before and after.
QQuickLoader is a focus scope so that it can automatically forward the
focus to it's item. Conditional loader should do the same and forward
the focus to its internal loader.
Setting the focus is a good thing, the problem with forceActiveFocus is
that it will not allow any child to receive the actual focus, instead
the focus is forced on to the root element of the applet which may not
be desired.
When for example trying to improve keyboard focus behavior of KickOff
without this patch I cannot get the initial focus on the list of
favorites since it gets reset after the applet is created.
REVIEW: 119872
The svg needs some adjusting like inner padding to match the other svg
icons, but I have 0 knowledge of inkscape; Marco, can you please have a
look?
CCMAIL:notmart@gmail.com
On some themes Plasma::SVG gives empty pixmaps. Loading a null QImage to
an atlas texture causes a crash in old versions of Qt.
Guard against it.
BUG: 88039
Reviewed-by: Martin Klapetek
These classes are exposed only as QML so we should only show members the
user can actually use.
The invokable is moved to the top for easier reading
REVIEW: 119745
we were creating new packagestructures on each package creation
and never deleting them, causing a pretty big leak.
now keep a single instance of the structures, with prototype packages.
members are static for binary compatibility.
i would go for max one bic change in this library that's when and if
this library will be made pubic.
Patch by Aaron Seigo
consider a loaded package valid even if !isvalid() but does have some file
that indicates it has a valid packagestructure.
for how packages are loaded now, a package is never valid at first if has a required file:
because the path gets set only after the package is loaded
this fixes wallpaper loading
At the moment it's trying to translate the item position and iterating
through all screens, but we can get the screen through the item's window.
REVIEW: 119603
Apparently in nvidia we get corruptions when a texture created for a window
is used in another one.
With this patch we tell the texture has changed when we move it from a
window to another, so it's re-created and we keep textures for all windows
separately. This way we ensure they don't mix.
REVIEW: 119465
Apparently in nvidia we get corruptions when a texture created for a window
is used in another one.
With this patch we tell the texture has changed when we move it from a
window to another, so it's re-created and we keep textures for all windows
separately. This way we ensure they don't mix.
REVIEW: 119465
reintroduces an api call from plasma1:
its the only way to solve
https://bugs.kde.org/show_bug.cgi?id=337200
basically to avoid a crash when plasma starts with missing containments in the appletsrc and a locked corona, or a screen added with locked widgets.
it's the only entry point that allows a creation of a containment when widgets are locked
REVIEW:119513
CCBUG:337200
We previously only supported compose-over-border when the centre was not
set to tile.
It's possible to use compose over border with tile.. even if it doesn't
make much sense.
Given that creating an opacityMask loads most of the image anyway, we
can make use of the FrameSVG painter path and avoid any additional code
complexity here.
REVIEW: 119406
this is the little part in plasma-framework for the applet alternatives chooser.
works together the branch mart/alternativesConfig of plasma-workspace and plsma-desktop.
for how it looks and why, see the vdg forum thread:
https://forum.kde.org/viewtopic.php?f=285&t=122067&p=315919#p315919
still possible problems:
I'm not sure about using a new desktop file entry X-Plasma-Provides, maybe Categories could be enough, but it may produce many false positives as well
REVIEW:119409
It was needed, after this we realized that the buttons looked odd,
in some cases, because the center wouldn't be under the 2px wide
sides.
This reverts commit e34d89a1f5.
Breeze theme usually has borders and center that can be tiled, which
ends up in more performant rendering, as we don't need to re-render
anything from the svg every time we resize an element.
Basically what we did was "s/hint-stretch-borders/hint-tile-center/g".
The only exceptions we found for this were: picker, dragger and monitor.
Reviewed by David Edmundson
CCMAIL: plasma-devel@kde.org
Revert the changes in contentsRect, it was clearly not the best place to
put the code that contains the code that computes the content size.
Instead move the code in FrameSvgItem, duplicates data and code but works.
Use FrameSVG as 9 tiles instead of uploading a big texture of the finished frame each time.
This also saves the cache being populated with full created frames in different sizes; which end up taking up space in the disk and shared memory cache as well as the GPU memory.
A code path falls back to the original uploading the entire texture if obscure settings are used, i.e overlay.
Benchmarks:
apitrace when resizing a frame goes from an average of 7.6ms per frame of CPU time just for the swizzling and uploading to 1.4ms
GPU time also drops from 40us to 10us
Themes will need to remove stretch-borders (when we gain nothing from stretching; i.e Breeze) to get the most out of it.
REVIEW: 119330
It's unreasonable to use private API, so make everything public API so that
every user of FrameSvg have as much features exposed as possible.
Reviewed by David Edmundson
While debugging a glitch I found out a bug in the painting code that hide
behind QRect documentation. See comment in sectionRect. This never rendered
correctly.
This reverts commit c38e6a204e.
This causes problems on the panel toolbox.
We were already trying to set a parent; however as it's a property of a QQuickItem
it only changes the visual parent; kdeclarative has a code path that if there's
a visual parent to skip the memory management; bug is probably there instead.
This originates from the request of downstreams to hide packages that are still installed.
why should be easier than not installing them i don't know, *but* semantically I think it makes sense act as if the package was not existing when the metadata says it's hidden
REVIEW:119329
Fallback to the old code if there's something not (yet?) handled by the
new implementation. This way we get to optimize for the the common use-case
without breaking former, complex, code-paths.
Reviewed by David Edmundson
This patch simplifies the grid a bit more by using Canvas instead of
Rectangles, so actually lowering the number of Items needed to create
the grid from 16 to just 1.
It works pretty neatly with no junctions problem at all.
REVIEW: 119283
Given the FrameData and the total size, we get to know where is the
contents going to be and gives us the information to extrapolate where to
put all the borders and corners.
Reviewed by David Edmundson
Move variable declarations closer to its uses
Prefer using QSize than width and height separately, so we can pass it
around directly and use isEmpty
Remove duplicated code in the central piece drawing
Reduce type casts from QSizeF to QSize, we're always using it as a QSize,
so just make the cast once.
Remove redundant constructions like checking whether it's null and returning
null or unneeded arithmetics
Create a paintBorder function that can generically paint framesvg borders.
This helps us reduce duplicated code as well as improving the readability
of the code.
Reviewed by David Edmundson
Make sure AppletPrivate::uiReady is set in applet_p.cpp when we report that
the ui is ready.
Make sure that if we loop through all the containments and they're all
ready, we emit that it's done.
So far, Corona::startupCompleted was never emitted.
REVIEW: 119220
Currently the grid itself is composed of 88 rectangles that draw all the
lines in a way that two big rect draws the whole two topmost horizontal
and leftmost vertical border lines and then each day rectangle is
drawing small bottom and right rect.
This patch reduces it to 13 rects only where one rect draws the whole
frame around the grid and then 1px wide/high rects draw the inner lines.
Results in much cleaner & simple code.
Plus there's a small refactor on the id names so it makes more sense.
This does not require any additional changes in the applets.
REVIEW: 119232
While profiling plasmashell memory usage with Vishesh we realized that most
of the usage came from loading the Background image repeatedly.
We traced it back to this change, where we were connecting to
wallpaperChanged before initializing it, so it would initialize it again,
loading the wallpaper twice. It's not that we were leaking the object,
AFAIK, but loading an image using QQuickImage already raises the memory
quite a bit.
This change alone reduces by 15% the memory usage of my plasmashell (with 2
screens, that makes it a bit worse, because there's 2 DesktopViews then).
REVIEW: 119216
TimeTracker is a small class that keeps track of an object the changes in
the properties of an object and relates them to a point in time. This way
we can see how things change and react to each other. Then, this information
is exported into a json file to analyze.
REVIEW: 119199
Qt Quick accessibility already picks up the text automatically. Instead
set the name (which is a descriptive element) to the placeholder text
which is more descriptive of the element. Otherwise Orca will read the
text twice.
restore the disconnect: sometimes appletRemovedForward gets executed after
aboutToQuit is emitted, but before closingDown returns true
this prevents configuration to be forgotten
the problem is that sometimes when QCoreApplication::aboutToQuit the containment is already deleted (the order is not really deterministic), therefore appletScript::applet() will hit an assert.
using a qpointer should solve it, its data being already 0ed in the cases the containment is already deleted at :aboutToquit time.
the disabled/invisible actions already have it as properties.
this fixes the add widgets action sometimes not being available
in the toolbox
Reviewed by: Bhushan Shah <bhush94@gmail.com>
Applet::immutability() is the maximum between internal applet immutability
and the immutability of its containment.
so not set higher immutability in the internal member of Applet
or the applet will not be able to be unlocked properly
Reviewed by: Sebastian Kügler <sebas@kde.org>
the color properties are remotely useful only when used from QML
and risk to explode in number in the future,
it's not a good thing for a public c++ api.
Also, they will become kinda deprecated as in largely replaced by
the ColorRole api. Too late to remove those properties completely,
but still last days to move them at least out of c++ api.
(and in qml they could be removed in the future in a 2.1 version
of the import while still being present in 2.0 if needed)
This moves the color properties is a theme subclass available only from QML
REVIEW:118972