While at it, also remove some unused related includes that are likely remnant from before
this was all done centrally in TaskTools
Differential Revision: https://phabricator.kde.org/D28906
Summary:
launchersOrder and the actual url data can be different:
in case of preferred:/ urls launcherorder will have that for
(for serialization) and the actual appdata url will be decoded as for
instance Applications:firefox.desktop.
this url is the one that needs to be compared to know the actual
launcher order
BUG:418483
Test Plan: firefox stays in first position when pinned as preferred://browser
Reviewers: #plasma, ngraham
Reviewed By: ngraham
Subscribers: ngraham, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D28632
Summary:
launchersOrder and the actual url data can be different:
in case of preferred:/ urls launcherorder will have that for
(for serialization) and the actual appdata url will be decoded as for
instance Applications:firefox.desktop.
this url is the one that needs to be compared to know the actual
launcher order
BUG:418483
Test Plan: firefox stays in first position when pinned as preferred://browser
Reviewers: #plasma, ngraham
Reviewed By: ngraham
Subscribers: ngraham, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D28632
Rather than relying on KWin to have reconfigured, which isn't the case when merely changing the number of rows.
BUG: 408783
FIXED-IN: 5.18.4
Differential Revision: https://phabricator.kde.org/D28216
Fixes issues that flew under the radar in D27959, namely:
- Missing KWindowInfo flags
- Returning service name instead of object path
Reviewed-By: kbroulik
Summary:
The tasks model now exposes a window's application menu object path and service name.
No update signals set up for XOrg; not sure what to listen for.
Test Plan:
See that the model has more roles and see that they're wired to the application
menu obiect path and service name on Wayland and XOrg.
Reviewers: #plasma, broulik
Reviewed By: #plasma, broulik
Subscribers: broulik, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D27959
Summary:
VirtualDesktopInfo::Private is ref counted and shared between N
VirtualDesktopInfo's.
We were passing the first VirtualDesktopInfo as a parent to
VirtualDesktopInfo::Private which didn't manage the lifespan or do
anything useful.
The wayland backend incorrectly used this 'q' object and spanned
mulitple internal objects and connections to the first object that
created the shared private instance, leaving us with dangly objects
inside.
BUG: 415200
(and possibly several other bugs of wayland task manager not updating
correctly)
Test Plan:
Compiles
Plasma still loads
Reviewers: #plasma, zzag
Reviewed By: #plasma, zzag
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D27266
The code tried hard to ignore garbage URLs, as Qt is quite lenient, e.g. QUrl("Garbage Url") is still valid.
There is no way to change the strictness of a QUrl after creation,
so the code would enforce it by doing QUrl strictUrl(inputUrl.toString(), QUrl::StrictMode).
However, toString() defaults to PrettyDecoded which avoids percent-encoding and keeps spaces
in tact which is not a valid thing to have in a strict URL.
Effectively, we want to ensure a URL is either a valid path to a local file,
or one of the special applications (for menu ids), or preferred for preferred applications, like web browser,
BUG: 385727
FIXED-IN: 5.18.0
Differential Revision: https://phabricator.kde.org/D26941
AppData contains a QIcon with pixmap data gathered from KWindowSystem::icon which we can just use.
Only if, for some reason, the icon is really null, try getting it from KWindowSystem on demand.
Differential Revision: https://phabricator.kde.org/D26086
The previous QIcon::name() check wasn't sufficient as it only works with theme icon names (e.g. kate)
but not icons created from an absolute path, e.g. /some/special/icon/location/kate.png.
The latter is usually the case for containerized apps which have a proper application desktop file
installed but their icon in some path within the application image or some container daemon location.
Since we already store the information for whether we had to fall back to using the actual window pixmap,
check for this before trying to serialize icon pixmap data.
Differential Revision: https://phabricator.kde.org/D25762
This contains the actual name of the desktop file which might be different from the one the application got built with.
Differential Revision: https://phabricator.kde.org/D22506
Summary:
`TaskGroupingProxyModel::requestToggleMaximized` now uses this to
minimize and restore groups of windows while preserving the
stacking order, a frequently user-requested wish.
BUG:368867
Window activation is additionally tracked to implement a new front-
end feature to activate the most recently active window (or fall
through to stacking order otherwise) subsequently.
CCBUG:370258
A Wayland implementation requires the addition of a
`PlasmaWindowManagement::stackingOrder()`, which should be a QList
of PlasmaWindow* in stacking order, along with a change signal. We
discussed this at the Plasma+KWin sprint and I'll code up patches
to KWin and KWayland soon and then implement the new API in here.
Reviewers: #plasma
Subscribers: davidedmundson, pino, anthonyfieroni, ngraham, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D22053
Summary:
UniqueConnection I dropped as we disconnect the old source model above
regardless, so it seemed superfluous.
Test Plan:
Compiles
Opened N dolphins
They were still grouped
Reviewers: #plasma, apol
Reviewed By: apol
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D24268
Summary:
Also drop checking if the suffix exists, the code is only reached
because this condition has been checked before
Seen while browsing code, no app known to me which would set a non-absolute
desktop file.
Reviewers: hein, broulik, #plasma, davidedmundson
Reviewed By: #plasma, davidedmundson
Subscribers: davidedmundson, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D23417
Summary:
Only fetches the properties name and command.
Avoids bringing a libksysguard dependency into libtaskmanager.
I also checked that we don't have a space at the end of the command.
That appears to be a relic from an older time.
Test Plan:
Unit tests exist on KProcessList.
Task manager applications appear fine, I don't know any good edge cases
that go through this code to test.
Reviewers: #plasma
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D23185
Summary:
KwindowInfo already has the PID, which we use in another case where PID is used.
More importantly I have a patch coming to KWindowSystem that returns the correct PID
for processes inside a PID namespace, but I don't alter the NETProperties.
Reviewers: #plasma, apol, hein
Reviewed By: #plasma, apol, hein
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D22753
Summary:
Don't do queries on unknown values.
Don't create a KDesktopFile until we know we're going to need it
Test Plan: Ran plasma with debugs, didn't see any regressions.
Reviewers: #plasma, hein
Reviewed By: #plasma, hein
Subscribers: hein, ngraham, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D22162
Summary:
GIMP 2.10 is still being a bad desktop citizen and requires a workaround
of this sort as well.
A nicer fix to do at a later time would be a regex-based rewriting rule
that won't need version updates.
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D21954
Summary:
GIMP 2.10 is still being a bad desktop citizen and requires a workaround
of this sort as well.
A nicer fix to do at a later time would be a regex-based rewriting rule
that won't need version updates.
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D21954
Summary:
The WaylandPrivate::virtualDesktopManagement object is loaded
asyncronously.
It's null until we finish fetching the registry.
A code path could call the desktopNames in that time.
Test Plan:
Had a crash
Couldn't reproduce reliably
Reviewers: #plasma, hein
Reviewed By: #plasma, hein
Subscribers: hein, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D19029
Summary:
PlasmaVirtualDesktop at a protocol level is double buffered.
There's a done() command emitted after property changes. After this the
name might have changed.
Test Plan:
Changed a desktop name (with relevant kwin patch)
Name changed in the pager tooltip
Reviewers: #plasma, hein
Reviewed By: #plasma, hein
Subscribers: zzag, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D18512
Summary:
While I think mixing IPC systems in this class is not the way to go
long-term, we have a strong desire to ship a complete user experience
for virtual desktops on Wayland in 5.15. As D17691 has been delayed
and did not make the Frameworks 5 release we can depend on for 5.15,
this is Plan B.
Reviewers: #plasma, davidedmundson, mart
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D18290
Summary:
Includes, among other things:
* A refactoring towards supporting more than one desktop per window,
for an eventual virtual desktops / activities merge
* A scheme for process-internal window ids on Wayland as DND payload
so DND in and to the Pager works in the shell
* Implemented various previously missing behavior in WaylandTasksModel
such as implicit moves of windows to the current desktop on various
actions
* Expanded VirtualDesktopInfo API so the Pager can better abstract
over windowing systems
* Implicit internal sharing of VirtualDesktopInfo since there are many
more instances now
* Various cleanups
Still missing:
* Fixing the VirtualDesktops data role in the grouping proxy
* The protocol doesn't have desktop creation/destruction yet, so some
of the related logic is still missing
* Some FIXME TODOs in the code when I was unhappy with the current
KWayland API
This code is largely untested and subject to change.
Depends on D12820 and relates to T4457.
Reviewers: mart, mvourlakos, davidedmundson
Reviewed By: davidedmundson
Subscribers: alexde, anthonyfieroni, zzag, ngraham, abetts, plasma-devel
Tags: #plasma
Maniphest Tasks: T4457
Differential Revision: https://phabricator.kde.org/D13745
Trace:
Direct leak of 24 byte(s) in 3 object(s) allocated from:
#0 0x544cc0 in operator new(unsigned long) (/home/kfunk/devel/install/kf5/bin/plasmashell+0x544cc0)
#1 0x7fe4f0e82df9 in TaskManager::XWindowTasksModel::Private::windowInfo(unsigned long long) /home/kfunk/devel/src/kf5/plasma-workspace/libtaskmanager/xwindowtasksmodel.cpp:419:25
#2 0x7fe4f0e87e69 in TaskManager::XWindowTasksModel::data(QModelIndex const&, int) const /home/kfunk/devel/src/kf5/plasma-workspace/libtaskmanager/xwindowtasksmodel.cpp:646:38
...
Summary:
Due to not passing `parent` to QAIM::index(), we were moving top-level
indices in the map instead. This meant the sort map would become out of
sync with the row move, and to the user it would look like both the
group children and unrelated top-level entries moved.
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D15550
Summary:
Due to not passing `parent` to QAIM::index(), we were moving top-level
indices in the map instead. This meant the sort map would become out of
sync with the row move, and to the user it would look like both the
group children and unrelated top-level entries moved.
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D15550
Summary:
Due to not passing `parent` to QAIM::index(), we were moving top-level
indices in the map instead. This meant the sort map would become out of
sync with the row move, and to the user it would look like both the
group children and unrelated top-level entries moved.
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D15550
Summary:
Turns out c8358c203f only worked accidentally. We can't do this
via filterModel->mapFromSource, because in a lambda connected to
its source model's rowsInserted signal, the proxy hasn't seen that
row yet.
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D15462
Summary:
LibreOffice reuses the same main window for both its start center and
sub-apps like Writer launched from it, changing the window metadata on
the fly. This ensures we hide e.g. a launcher for Writer when picking
it in the LO start center.
Reviewers: broulik
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D15458
Summary:
Some apps initially show their window with bogus/useless window
metadata and then update to useful metadata during early startup.
For example, LibreOffice sets WM_CLASS to soffice/Soffice and
then updates to libreoffice-writer/libreoffice. This leads to
a poor user experience on particular the Icons-only Task Manager,
but also the regular Task Manager depending on settings.
Depending on its configuration (and Icons-only Task Manager is
a particular set of configuration options, as far as the model
is concerned), TasksModel will try to sort a new window task
adjacent to its launcher task. The appearance of a new window
task also causes matching (in terms of identification) launcher
or startup tasks to be filtered out. To the user, this forms a
lifecycle of the launcher being replaced by the window in-place
(and a startup state inbetween, optionally but by default).
Prior to this patch, this sorting decision was only done once,
when a new window enters the source model stack. This meant the
LibreOffice window would initially be sorted into the "wrong"
spot (the bogus metadata doesn't allow us to relate it to its
launcher) and then, following the metadata change, stick to the
wrong position.
Simply changing the code to sort things again on any metadata
change would not have been good enough: Metadata changes can
occur at any time, and things should not just move around on
the user - this sort mode is called "Manual" for a reason. Also,
the visual result would still be poor: The window would initially
appear at the wrong position, then move to the right one a bit
later.
This patch takes the following approach:
* It adds a new config key to taskmanagerrulesrc for listing
ids of matching tasks to completely hide, and of course the
code needed to implement this.
* It adds LibreOffice' bogus initial metadata to this key, so
the tasks is initially hidden.
* The sort code skips over hidden window tasks in the sort
insert queue instead of moving them. The queue is marked as
stale then, and cleared on unrelated windowing system changes.
* It resorts when tasks are unhidden (i.e. once the metadata
update has occured and the task no longer matches the above
config key).
The visual result is that the startup notification on the
launcher spins a little bit longer than before, even though the
window has already appeared (although LO lags in filling in its
contents anyway), and then morphs into the window task
representation once the client has completed the window metadata
change. This happens in such a short order as to be more or less
imperceptible.
If startup notifications are turned off it's broadly the same,
minus the spinning.
BUG:396871
Reviewers: davidedmundson, broulik, ngraham
Subscribers: plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D15410