if we know the conector name of a qscreen, use it to recover the internal
integer screen id.
used by external scripts to do things to the "current" containment
for instance systemsettings invoking the wallpaper configuration
dialog for the same containment for the screen systemsettings currently resides in
the geometry property remained broken for all plasma5 lifetime.
reading it makes sense, writing it not so much (ad it depends ffrom
containment to containment)
reading works, writing stays noop (for max compatibility)
Summary: bind userBackgroundHints to the desktopscript interface
Test Plan:
from the scripting console is possible to correctly change applets background and
it gets immediately applied
Reviewers: #plasma
Subscribers: apol, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D25744
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:
support args in applet creation with an optional argument to
containment::addWidget
scripts not using it will continue to work as before
Test Plan:
arguments get understood byt the created applet
applets can still be created without arguments
Reviewers: #plasma, broulik
Reviewed By: #plasma, broulik
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D22652
Summary:
this was implemented using a nested loop, which is simply not viable
because nested looping may work on inconsistent object states and cause
crashes all over the place. furthermore sleeping probably has no real use
case as there isn't anything you could be sleeping for
prevent any future problems by making the API method do nothing and instead
print a warning about it being deprecated.
should be removed when moving over to kf6
Test Plan: prints warning when sleeping
Reviewers: davidedmundson, mart
Reviewed By: davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D22070
Summary:
the sleep is implemented with a nested event loop which may result in
segfaults when something in the new loop stack accesses objects from the
original loop stack that are presently in a bad state because they were
not meant to be accessed (and only can because of the nesting).
to aid in debugging let's leave a trace of the fact that sleep was used
when in fact, using sleep is super risky.
Test Plan: warning gets printed when sleeping
Reviewers: mart
Reviewed By: mart
Subscribers: davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D21895
I got "#define HAVE_X11 TRUE" and errors because of that where #if was
used.
This also obeys the logic that HAVE_X11 is set (in the toplevel
CMakeLists.txt) not only when X11_FOUND but also when XCB is found.
Summary:
If a slot or Q_INVOKABLE has a QVariant as parameter and gets called
from a QJSEngine's script, it receives a QJSValue wrapped as QVariant.
To get a QVariant with the actual value wrapped, calling QJSValue::toVariant
is necessary.
I'm not entirely sure whether this is intentional behaviour of QJSEngine, but
even if it's a bug we'll have to workaround it.
BUG: 397338
Test Plan: I have favorites in kickoff again.
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D14822
Summary:
Port plasma desktop scripting to qjsengine, removing every trace of QScript from plasma-workspace.
The scripting is 100% API compatible.
the bindings are partly done on the javascript part as some things are only possible there and not on the QJSEngine part:
* setting AppInterface as the globalobject's __proto__ with property getters that are evaluated every time
* setting functions that act as constructors (using newQMetaObject gives way more complex and uglier c++ code in Containment, as the scriptengine is not immediately accessible)
* a QRectF wrapper which exposes all properties and methods that were exposed in the previous implementation
Test Plan:
* some manual api test from the interactive console
* tested both from the desktop console and first start with some pretty complex layouts from lnf packages (the default one, netrunner, united, elpas)
* tested every property/methos of the qrectf wrapper
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D13112
Summary:
Plasmashell literally never checks the X screen, but we expose it in
this scripting system.
This patch Hardcodes it to the values you'd have on a normal system.
The existing screenCount is unchanged and will still work.
Test Plan: compiles
Reviewers: #plasma, mart
Reviewed By: #plasma, mart
Subscribers: apol, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D9174
Summary:
Let's also move the applet pointer to right before it's used and
remove duplicated declarations.
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D6424
Summary:
add global immutability/setImmutability in scripting
there was a locked property in containment, but
didn't make much sense as the lock/unlock state is
always global. a global function would be better.
containment.locked may also be changed to lock the corona instead
(doesn't seem reliable now) but should probably be deprecated.
Test Plan:
correctly locked nd unlocked widgets from the console.
i'm not sure wether allowing systemimmutable as is dangerous and not
easily reversible, but does have an use for first
time setup of kiosk environments
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D5009