According to [X.org
docs](http://www.x.org/releases/X11R7.7/doc/compositeproto/compositeproto.txt)
regarding NameWindowPixmap:
"This pixmap will remain allocated until freed, even if 'window' is
unmapped, reconfigured or destroyed. However, 'window' will get a new
pixmap allocated each time it is mapped or resized, so this request will
need to be reinvoked"
So, pixmap needs to be discarded not only on XCB_CONFIGURE_NOTIFY event
but on XCB_MAP_NOTIFY event also.
The svg elements cache isn't really a "configuration" and it's not
something that should be overridden by global config settings.
Loading it as a simple config skips the cascading and saves reparsing
kdeglobals.
REVIEW: 128966
when the view is in SizeRootObjectToView mode, the root
object is resized in the event handler, that is too late at startup.
resize the root object right after having announced
the new containment, so the view subclass can have
the view resized to the proper size beforehand,
removing an useless containment graphicsobject resize.
REVIEW:128915
running tasks need to have some visual indicator,
otherwise is impossible to distinguish between
tasks and launchers in icontasks
Change-Id: Ib1c319c675855a605d8a268bad2bb43ad19a6e4d
WindowThumbnail did some open GL operations, discarding old textures, in
the GUI thread. Whislt it's not going to cause a threading issue (as
updatePaintNode always ran when the main thread was blocked) we're not
meant to mix threads with openGL contexts.
It also seems to have a GL leak on nvidia, which was previously masked
by the double delete fixed in
https://git.reviewboard.kde.org/r/126131/diff/2/
It seems only one worked, and in the applied version we went with the
wrong one.
This patch makes use of QQuickItem::releaseResources to delete the GL
textures on window change and destructor; it's then removed from
stopRedirecting so that start/stop redirecting handles xcb on the GUI
thread and updatePaintNode/discardPixmap is the GL stuff on the render
thread.
See http://doc.qt.io/qt-5/qquickitem.html#graphics-resource-handling
REVIEW: 128763
BUG: 368066
The code already had logic in there but since UI ready is usually emitted later
the client (in this case plasmashell) had to manually show the panels and would
usually show them when they're not ready yet leading to visual glitches on startup.
REVIEW: 128708
setting the domain by just using kdeclarative would lead to
setting the domain on the wrong QQmlContext,
sometimes overwriting it on the global context, causing
unexpected crashes deep in qml
BUG:361513
reviewed-by: Ivan Čukić <ivan.cukic@kde.org>
Similar to KPasswordWidget in kwidgetaddons
Also fixes:
- the clear button still being clickable when not enabled
- RTL icons
- Updating the right margin correctly
REVIEW: 128660
This flips the tooltip when using right-to-left languages
CHANGELOG: The standard tooltips are now mirrored when in a right-to-left language
REVIEW: 128662
LayoutChanged causes QML to destroy all delegates and re-create them.
Since the number of days doesn't change but only the numbers, we can just call dataChanged on all roles.
Furthermore, when agenda-related data changes, only the containsEventItems role
might have changed, so only emit a change for it.
CHANGELOG: Performance when changing months in the calendar has been greatly improved
REVIEW: 128648
Commit bb70febdbe changed the slot for
adding createApplet, turning the final argument from QPoint to QRect.
If the rectangle size is nothing, it acts like the original code.
Despite this being private API (ish) there is a hacks in plasma-
workspace that call methods on the view via QMetaObject invoke. This
obviously fails. As we need compatibility for Plasma/5.7 and earlier a
compatibility slot needs to stay.
REVIEW: 128640
The QSGTextures are created with
window()->createTextureFromId(m_texture, QSize(w,h),
QuickWindow::TextureOwnsGLTexture));
this means we don't want to be deleting textures ourselves too, it will
be deleted when we delete the QSGTexture, which is a scoped pointer
inside our QSGNode.
BUG: 355644
BUG: 365946
REVIEW: 126131
applets will be deleted by the parent, as they are
acontainment's children. by not deleting them by hand
also every signal will be disconnected, not causing appletRemoved
to be emitted, so not causing removal of config
pieces at shutdown, this removes the need of the
explicit disconnect in aboutToQuit from contaiment interface
Change-Id: Iddf6ded60ae849ca03c363be6e736da496310b82
reviewed-by: David Edmundson
Currently the code gets the icon name from the QIcon and tries to do
some Plasma theming with it.
However if that fails it then loads the QIcon::fromTheme again.
This is pointless in most cases and will break any icons that have a
custom loader (all SNIs)
REVIEW: 128580
Panel popup dialogs along with other applications of Plasma::Dialog
(e.g. Kicker's submenus) currently don't correctly set WM_TRANSIENT_FOR
to the id of their parent window on X11. This causes them to interact
badly with auto-hide panels which do not set struts, e.g. Kicker's
submenus open behind the panel.
Internally, Dialog makes calls to QWindow::setFlags when its window
type is "Normal" (the default) and otherwise uses KWindowSystem's
setType. (Kicker's subclass, SubMenu, does an additional
KWindowSystem::setType call for NET::Menu). Neither CompactApplet
nor Kicker change their Dialog's 'type' property to anything else,
so their dialogs are "Normal", thus going the setFlags route with
no setType calls.
Dialog also sets its transient parent to the window the visualParent
item is inside of.
Now here is where things break down: QXcbWindow will update
WM_TRANSIENT_PARENT for in show(), but only when an inline function
called isTransient returns true. isTransient decides this based on
window type, which is determined from the flags set with
QWindow::setFlags. Calls to KWindowSystem::setType would have no
bearing on this; there seems to be no mapping back from external
state. This is why setting Dialog.type to e.g. "DialogWindow" does
nothing.
This patch takes the route of adding Qt::Dialog to the starting
flags - after all Dialog is a dialog. That means isTransient()
will consider the window to be a transient and those
setTransientParent calls Dialog does will not be ignored. In the
case of CompactApplet, no further calls to KWS::setType are done;
Kicker continues to call it with NET::Menu to get desired window
manager behavior.
In light testing everything still seems too work, with the added
benefit of fixing:
BUG:366278
That said, the weird mess of setFlags and setType and state in the
windowing system vs. Qt is horrible and sad.
REVIEW:128571
Since nobody bothered to fulfill my request for this icon (cf. Review 128332)
I just did it myself, with no warranty.
Plasma IconItem finds icons from Plasma theme only in the SVG file of the first
section of the name (ie. all icons in network must start with network- prefix
which the flightmode icons did not).
The old icon is kept as is for compatibility.
This is done by ContainmentInterface::mousePressEvent, but not in this
code path, which is hit for applet panel popups.
Folder View relies on this to update actions ahead of the menu being
opened.
BUG:366294
QtQuick.Layouts by default left aligns content and because the Layout is
anchors.fill'd the icon would show off-center in a button when no text has been set.
This fixes this.
REVIEW: 128493
BUG: 365947
The containment's status is the max of all applets.
Unfortunately, HiddenStatus, while semantically lower, has the highest value,
so as soon as there's a hidden applet (eg. pager with just one virtual desktop),
the panel will always auto-hide even when popups are open as its status will be HiddenStatus.
REVIEW: 128301
screen ids are going to not be continuous anymore
as screen id is going to correspond 1:1 to connectors,
it will be possible to have "holes", therefore valid ids
that are bigger than screenNum()
REVIEWED-BY:sebas@kde.org
Change-Id: I1c0b1fb827dba4d95f228d32209403150c089c77
- Initially set state (and type, and flags) in response to PlatformSurfaceCreated.
We know reliably this will run before the window is mapped.
- Drop the comment about removing setState() form showEvent handler, as
we need it to avoid state loss in this scenario:
<mgraesslin> the window gets mapped first time: everything is fine
<mgraesslin> window gets unmapped: kwin removes the state as per spec
<mgraesslin> qt gets change event and removes the states it doesn't care about
<mgraesslin> qt maps window again and sets states
<mgraesslin> we lost the state
<mgraesslin> which means we need to set the state again from our side before(!) Qt sets it
<mgraesslin> and before Qt maps the window
In order to have support for tooltip window type in Wayland, the
window type NET::Tooltip is also set through KWindowSystem API once
the platform surface is created.
REVIEW: 128300
Even though QQuickItem only has a width and height accessor there is a
usable public setSize method.
This gets rid of a lot of potential re-evaluation as internal geometry
is updated before widthChanged is emitted.
REVIEW: 128316
Do to so means the System Tray applet ends up being placed inside the
system tray container, which ends up in a parent loop, causing a stack
overflow every time parent() is called recursively
This happens whenever one drags a sys tray on the desktop or simply adds
a new system tray whilst running.
BUG: 361777
We also need to do a hack for Plasma/5.7 in plasma-desktop somehow in
all cases where this is used.
the llvmpipe driver doesn't have a good quality enough for the
taskbar thumbnails components, it will have many crashes in the driver.
disabale thumbnails with that driver, as kwin disables many effects as well.
BUG:363371
ensure the scriptengine gets created also for c++ applets
that have a valid scriptengine, move the script init
out of applet::init that can be reimplemented.
remove the second appletscript constructor that is
not necessary anymore
REVIEWED-BY: Kai Uwe Broulik
Summary:
The notifications applet installs the .so into the toplevel plugins dir,
and my earlier code removal broke the loading of that applet.
Reviewers: lbeltrame, mart
Reviewed By: mart
Differential Revision: https://phabricator.kde.org/D1851
Summary:
The name of the actual plugin was missing, making the warning rather useless.
Since this is only used within PluginLoader, I added a private function
isPluginVersionCompatible(KPluginLoader), taking code from
Plasma::isPluginVersionCompatible(uint). That one could probably be deprecated,
although no public replacement would be available, just "use PluginLoader".
Test Plan: plasmoidviewer -a org.kde.plasma.digitalclock
Reviewers: mart
Reviewed By: mart
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D1825
Summary:
This code was passing PREFIX/share/plasma/plasmoids/org.kde.desktopcontainment/metadata.desktop
to KPluginLoader (which expects a .so!), which led to warning noise
"Plasma::isPluginVersionCompatible: unversioned plugin detected, may result in instability"
(since that code tries to find a version symbol in the .so).
The reason why KPluginInfo::libraryPath() returns the .desktop file seems
to be a KPluginMetaData misuse, but this is compat code marked as "to be removed"
so I didn't fully debug the KPluginMetaData misuse.
Test Plan: plasmoidviewer -a org.kde.plasma.digitalclock
Reviewers: mart
Reviewed By: mart
Differential Revision: https://phabricator.kde.org/D1827
add a new containment type for use in the systray:
this way it will be able to have a screen number without
actually creating a panel from its own
REVIEW:128118
emergency change: in Qml the name "state" for a property
is reserved for the internal state machine, so any object that
exposes a "state" property on its own would automatically
break the state machine
Like KIconloader, support a Selected state, in IconItem,
as in all generic svgs/framesvg
it replaces the text color with HighlightedText and the
background color with HighlightColor
Change-Id: Id97a527405d2c3feed75a172f05547defdbf440c
REVIEW:127975
Only reset if there's an event for current date. Without that when
the applet tries to get the updated list of events and it gets the
old one (empty) due to the check at the beginning of eventsForDate().
Is important the minimized task always looks "less prominent"
then the other ones, so make it pure black but very translucent
this will make it look always "slightly darker" than the background
is important that task and only that doesn't follow the stylesheet
Change-Id: I9e46dfc1c22b2b0a0d1ece575913fb410213b4c6
license to LGPL2+ as in frameworks licensing policy
The old license in the files was actually wrong, because:
servicejob_p.h : splitted from servicejob.cpp (already 2+)
in 89b71cd9f195da51993533f7fc2329ddc08a7de4
package_p.h: splitted from package.cpp (already 2+)
in 9cb9cfe65e
packagestructure_p.h: created by me in a629fe4d8f
(by copy/paste of the header)
This allows an applet to query whether widgets are user-locked or
locked down by Kiosk restrictions.
CHANGELOG: Plasmoids can now tell whether widgets are locked by the user or sysadmin restrictions
REVIEW: 127909
following KIconLoader, use QXmlStreamReader/Writer
here too to replace the svg stylesheet to color
the svg with system colors.
it should be hopefully slightly more efficient
REVIEW:127937
lately the highlight color of plasma became a very
washed-out blue, (since it switched to use the
global system colors) that was because it actually
taken the highlight color (and highlightedText)
from the wrong source.
there is a correct color group in kcolorscheme for
that, that is Selection, take those two colors
from that (also means highlight and highlightedtext
always be the same in all plasma::theme::colorgroups
but that's not a problem)
update test to reflect that
REVIEW:127842
ConfigModel may contain ConfigCategory for both QML pages and KCM pages.
The source property will be empty for KCM pages. This fixes correctly
returning empty source for KCM pages.
Also return the same value from get().
REVIEW: 127702
Currently, the "name" key is deleted from plasmarc when you select the
default theme (breeze) in the desktop theme KCM.
This leads to unexpected behaviour: If you set e.g. oxygen as look&feel,
and then set breeze as desktop theme, Plasma actually uses Air (the
default desktop theme in the oxygen l&f) on next login instead of
breeze. In other words, it is impossible to configure breeze as desktop
theme when using a different look&feel as breeze.
This fixes the problem by removing the check whether the default theme
is selected and always writes the "name" config key to plasmarc.
REVIEW: 127698
add named colors for positive (usually green)
neutral(usually yellow) negative(usually red)
foreground objects, such as text or parts of
svg icons/themes
REVIEW:127696
Change-Id: I646306339f1684cdc062da3d3af1489af6092372
we have a color in the Plasma theme "highlight" that is basically
an accent color used around.. but one of the uses is to use it as
a background, such as highlighted text. in that case we don't know
what color would be safe for contrasting on top of it for things
like the highlighted text color (plasma style used the background
color for that, which is incorrect)
REVIEW:127637
Summary:
Avoids a crash and a bogus menu entry.
Current code does not properly handle any resetting, which results
in Applet::hasValidAssociatedApplication() still returning true
when urls have been set to an empty list and the application name
to an empty string.
Also are connections to the "destroyed" signal collected on
repeated set calls.
This patch fixes that.
This fixes "Run the Associated Application" menu entry showing up with widgets.
It also prevents the crash in associatedapplicationmanager.cpp:76, which assumes
url lists to be non-empty:
const QString mimeType = mimeDb.mimeTypeForUrl(i.value().first()).name();
Not happy yet with the signal/slot connection management,
improvement proposals welcome.
Reviewers: mart
Reviewed By: mart
Subscribers: plasma-devel
Projects: #plasma
Differential Revision: https://phabricator.kde.org/D1372
KIconLoader::global()->theme() might return null. Thus we need to
guard for this case (happens e.g. on build.kde.org).
This results in iconThemeMetadataPath not being set, which is fine
as that condition is handled later on.
CCMAIL: notmart@gmail.com
Reviewed-By: Bhushan Shah
This removes some old cruft that is not really used and serves
basically only as a bool property for checking if it's null and
wheter it equals the last activated date.
This can be done without it by simply resetting the current selected
date (another property) to "today".
REVIEW: 127455
BUG: 360683
Plasma::Theme emits the applicationPaletteChanged signal after it has fetched the
colors from KColorScheme and scheduled the caches to be nuked. There's no need to do
the same exact thing from every single Svg out there.
This speeds up Plasma picking up color scheme changes significantly and is now
on a par with other opened applications.
REVIEW: 127426
This sets the states before showing the window and is a proper fix
for the linked bug.
Needs e4cea305ed2ba3c9f580bf9d16c59a1048af0e8a from qtbase - Qt 5.6.1
CCBUG: 332024
REVIEW: 127422
both the comic and weather applet have to pick out the
_plasma_graphicsObject to access the AppletInterface
object just to set the busy property on it.
this reintroduces the busy proeprty in Applet too,
both setting it to Applet or AppletInterface
will keep them in sync
REVIEW:127411
Makes it possible for plasmoids to test themselves in the different shells
by providing API to extract the object that will test the plasmoid
instance.
REVIEW: 127345
so much for removing sytray-related hacks.. :/
when the widgets are locked, must be possible to add/remove
widgets in the sytemtray anyways, as their creation/destruction
can depend from dbus activation (or the first time you launch
plasma with the new systray and it must be populated)
Change-Id: I8095ebf831ae57e1306a4d623b253c2a10ef219f
REVIEW:127373
When we show a Qt window it resets all wm_states, including the
SKIP_TASKBAR state that Qt doesn't support see
QXcbWindow::setNetWmStates
In order to set the flag we need to do it after Qt has mapped the
window.
This was previously done using ExposeEvent which will happen after show,
but by it being a separate event the task manager will get notified in
the meantime.
By merging into the same event we can make sure the flag is set before
the task manager processes it.
BUG: 332024
REVIEW: 127374
We have a lot of reusable singletons that are just hidden when not needed, such
as the OSD. IconItem, however, will always fade from the previous state, even if
the previous action happened minutes ago.
This fixes for example changing the volume and then later changing the brightness
where you could see the OSD animating from the volume icon.
REVIEW: 122859
Changing the color group of an Svg emits repaintNeeded which will then
cause it to schedule a pixmap update anyway. Includes a unittest.
REVIEW: 127313
make it possible to set icon and title from
the Applet subclass, making appletInterface (so plasmoid obj)
notice about the change and relay the notify signal
source should always return the same value as it was assigned.
Also removed duplicated code (empty sourceString is now handled
as if the source couldn't be converted to any type).
REVIEW: 127282
IconItem handled both QOixmaps and QImages as a source.
QVariant(somePixmap).canConvert<QImage>() returns true so one of the
two code paths isn't executed. Given converting between the two is
practically free, we don't need two code paths.
REVIEW: 127270
PluginLoader::loadApplet works both by passing a simple plugin
name and a full path of a plasmoid package.
However, when loading the optional C++ plugin, we have to look
in the standard plasmoid plugin path, so only consider the
tail of the path name, as is guaranteed that part is equal to
the plugin name.
BUG:359902
Change-Id: Ic7300b7c12d7693bcb5590e29de780109a8ff81c
unbreak api of Applet::SetConfigurationRequired + add bindings to
appletInterface as properties.
new properties configurationRequired and configurationRequiredReason
Change-Id: I18ff01df94c1a0c5fac79ff801bfa76714c9f986
REVIEW:127218
Applet contains the menu actions, therefore reloading the menu should
happen in Applet not AppletInterface. With AppletInterface being a dumb
wrapper.
This exposes functionality to anyone who overrides Applet, but also will
also allows system tray to emit this signal without having to use
private API.
Change-Id: I95e65de315744a78a82ebba2a954e4f3ae1bd7b2
REVIEW: 127217
Add some tests for IconItem.
Also found one issue in animation when quickly changing source, first frame
will be rendered with wrong icon.
REVIEW: 127103
Unset mainItem and set it back only after changing of tooltip contents
is completed. This improves behavior of morphingpopups effect (popups
animates from/to incorrect values).
REVIEW: 127118
svgElementsCache may be created on render thread and deleted
on main thread, which will make KSharedConfig crash because
it uses per-thread storage.
BUG: 359539
REVIEW: 127112
This prevents the tooltip from showing up if hideTooltip was called
before it was shown.
BUG: 358894
Differential Revision: https://phabricator.kde.org/D959
tooltips are now animated by a KWin effect, don't try
to animate own X11 positions, that's quite dangerous
Change-Id: I08ef2bc23ec1ef7cb7c432ba1bf6d9c5b0a0ab01
Commit 5184ac introduced a small regression that caused IconItem
to no longer load non-theme icons with name set, for instance icons
coming from sni-qt, causing sni-qt apps to not show in systray.
BUG: 359388
FIXED-IN: 5.20
REVIEW: 127091
this list was done because some applets broke with
the new shared engine stuff.
since it's many workspace releases ago, unconditionally
use the single engine now.
REVIEW:126918
If you use Plasma's ToolButtonStyle with different controls than the PlasmaComponents.ToolButton it prints a warning about an ID that does not exist.
Use "control" instead which is guaranteed to be the item.
This removes the custom label-based triangles and replaces them with proper ToolButtons
using proper icons. It also adds a "Today" button to return to the current day.
The tooltips on the buttons reflect the actual action ("Previous Month", "Previous Year",
"Previous Decade", depending on the zoom level).
Furthermore, the day names and week numbers now use the regular font size but they're still
visually disconnected. The day names row is hidden in the zoom levels now.
REVIEW: 126960
BUG: 336124
BUG: 348362
BUG: 358536
removal should happen in handler of
Containment::AppletDeleted, but make extra sure to remove it
in case removal happens too late and an access happens
in the meantime
make extra sure dead objects aren't in m_appletInterfaces
BUG:358551
* remove custom icons, fallback to breeze (too big hassle maintaining)
* fix taskbar items in air and oxygen (oxygen returning to its original design)
* fix blurbehind mask for oxygen popups
* remove some dead files
Please remember to ALWAYS* bump this version number when you do any changes to the SVG files.
Otherwise we won't clear the Plasma theme cache and users end up with a broken theme.
When showing QIcons in IconItem, it would ignore stylesheet colors.
This tries to load QIcons created with QIcon::fromTheme as svg, by using
the icon name returned from QIcon::name.
REVIEW: 126792
CCBUG: 353358
When debugging the linked bug, it looks like when item's geometry change
eg. from 0x0 to 100x100, geometryChanged may be called twice, first with 100x0
and then finally with 100x100.
This was not issue before, because we used timer to call compactRepresentationCheck.
This changes compactRepresentationCheck so that it early returns also when just
one part of item's size is zero.
Fixes regression from 344dbeb938
REVIEW: 126778
BUG: 358039
Animators do not reliably work with a duration of 0 as can be seen in the linked bug report.
Upstream bug report: QTBUG-39766
BUG: 357532
REVIEW: 126652