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
Summary:
Both when exporting and importing plasma layout to json
consider the panel visibility as well together the other
properties
BUG:374226
Test Plan: tried an exported layout with autohide panel
Reviewers: davidedmundson, #plasma
Reviewed By: davidedmundson, #plasma
Subscribers: davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3852
Summary:
restore the missing panel properties:
alignment
minimum length
maximum length
offset
also, allow non integer values for the measures (height, min/max, offset)
BUG:368074
BUG:367918
Test Plan:
dumped a config with a custom panel, different height/alignment/offset etc
started a new plasma session with that l&f package, restored panel correctly
Reviewers: #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D3021
when a panel is created it doesn't have a view immediately,
so we have to work around by writing its config instead.
we have to force lastScreen of the newly created containment,
or it won't have a screen yet at that point, breaking JS code
that relies on it
NOTE: if we'll allow setting a panel screen from JS,
it will have to use the following lines as well
Summary:
the panel tamplates are listed with kpackage listing
but were still loaded with kservicetypetrader
this made possible to have templates listed but not possible
to be loaded. This ports the template loading to the same logic
of the template listing, making thisgs consistent here
Reviewers: davidedmundson, #plasma
Reviewed By: davidedmundson, #plasma
Subscribers: davidedmundson, andreaska, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2723
Summary:
The previous approach of having an array of object that
hold information about the current config group and the config keys
and values was not really scalable nor intuitive.
Now, the config is an object that has the group names as keys,
and each group has its own configuration (key, value) pairs.
The config groups are identified as a unix-like path
Reviewers: #plasma, mart
Reviewed By: mart
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2516
Summary:
- Serializing the desktop layout for current activity
- Support for different config groups
- Introducing the mechanism for the future API versioning
- Loading the desktop from the serialized data
- Added debugging output just for comparison with regular layout.js
- Splitting V1 scripting functions into a separate class and file
- Loading the panels
- Disabled the debugging output
Reviewers: #plasma, mart
Reviewed By: mart
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2480
by using the graphicsobject directly, make it
possible to pass a full geometry at the applet creation by script
adapt the config dump in javascript to use it
Summary:
allow for lnf package to override templates, so that
for instance, "default panel" can be overriden, so in a
distribution adding a "default panel" would add what is the
"default panel" of that distribution.
switching lnf package would get back a normal panel
Reviewers: garg, ivan, #plasma
Reviewed By: ivan, #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2298
Summary:
check first i the lnf package if
we have a default containment for the current shell
then fallback to the one specified by the shell package
Reviewers: ivan, #plasma
Reviewed By: ivan, #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2286
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
Summary:
We have a method to add an activity in plasma script, but
not to remove it. This patch fixes this situation.
Reviewers: garg, davidedmundson, mart
Reviewed By: davidedmundson, mart
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2251
Summary:
There is a small time-window when Plasma's internal data
regarding activities is not synchronized with the internal
data of the KActivities library.
This leads to Plasma reporting a different list of activities
than the list of activities it has containments for.
This patch changes the activity list that the ScriptEngine reports
to be the one that Plasma knows about.
See: https://bugs.kde.org/show_bug.cgi?id=365606
Reviewers: #plasma, davidedmundson, sebas, mart
Reviewed By: mart
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2187
Summary:
After the previous patch which removed the unused
Activity class related events, it started becoming clear that
said class is only really used to store the name of the
containment plugin that should be loaded for an activity.
Instead of keeping a map of these objects (QObjects) with
all their baggage, the shells now only keep the map of
activity IDs and corresponding plugin names.
Reviewers: mart, bshah, davidedmundson, #plasma
Reviewed By: davidedmundson, #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D2176
that was a bad idea.
the idea was "is there an activity that doesn't
have a containment"? use that
but if an activity oesn't have a containment something else
went already wrong