Factor windowing system arbitration out of TasksModel.

Authored by hein on Aug 9 2016, 10:02 AM.

Description

Factor windowing system arbitration out of TasksModel.

Summary:
This introduces a new WindowTasksModel which is a QIdentityProxyModel
around an instance of either WaylandTasksModel or XWindowsTasksModel.

This arbitration was previously done directly in TasksModel, along with
refcounting to share a single window tasks sub-model between TasksModel
instances. Factoring out both of these things has two goals:

  • It allows users of libtaskmanager which are solely interested in window data (e.g. the Pager) to skip the unnecessary complexity of TasksModel, while still sharing the windowing monitoring with users of TasksModel.
  • TasksModel becomes fully free of windowing system-specific code and calls to KWindowSystem (to query the platform), making its code a little cleaner.

The downside is another layer of indirection (the QIdentityProxyModel),
but the upside is clear: The Pager wants to share window data and
window monitoring with the Task Manager, but is not interested in
startup notifications, does its own sorting (using the window stacking
order), does not need grouping and has different filtering needs.

The Pager backend will use QSortFilterProxyModel around WindowTasksModel
to mix in its own data and sort by stacking order.

Reviewers: Plasma, mart, davidedmundson

Subscribers: plasma-devel

Tags: Plasma

Differential Revision: https://phabricator.kde.org/D2379

Details