Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit c64fc469 authored by Eike Hein's avatar Eike Hein

Port "Switch Window" containment action to updated libtaskmanager API and away from KWindowSystem

Summary:
This makes it work on Wayland. And probably fixes bugs, the code,
especially the next/prev window stuff, was pretty wonky.

Also some general cleanup.

Depends on D13745.

Reviewers: mart, davidedmundson

Reviewed By: davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Maniphest Tasks: T4457

Differential Revision: https://phabricator.kde.org/D15642
parent 52d760c5
......@@ -12,10 +12,8 @@ kcoreaddons_desktop_to_json(plasma_containmentactions_switchwindow plasma-contai
target_link_libraries(plasma_containmentactions_switchwindow
Qt5::Widgets
KF5::Plasma
KF5::KIOCore
KF5::I18n
KF5::WindowSystem
taskmanager)
PW::LibTaskManager)
install(TARGETS plasma_containmentactions_switchwindow DESTINATION ${KDE_INSTALL_PLUGINDIR})
install(FILES plasma-containmentactions-switchwindow.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
This diff is collapsed.
/*
* Copyright 2009 by Chani Armitage <chani@kde.org>
* Copyright 2018 by Eike Hein <hein@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
......@@ -23,40 +24,35 @@
#include "ui_config.h"
#include <plasma/containmentactions.h>
// libtaskmanager
#include <activityinfo.h>
#include <tasksmodel.h>
class QAction;
class QTimer;
namespace LegacyTaskManager
{
class Task;
} // namespace LegacyTaskManager
namespace TaskManager {
class ActivityInfo;
class TasksModel;
class VirtualDesktopInfo;
}
class SwitchWindow : public Plasma::ContainmentActions
{
Q_OBJECT
public:
SwitchWindow(QObject* parent, const QVariantList& args);
SwitchWindow(QObject *parent, const QVariantList &args);
~SwitchWindow() override;
void restore(const KConfigGroup &config) override;
QWidget* createConfigurationInterface(QWidget* parent) override;
QWidget* createConfigurationInterface(QWidget *parent) override;
void configurationAccepted() override;
void save(KConfigGroup &config) override;
void performNextAction() override;
void performPreviousAction() override;
void doSwitch(bool up);
QList<QAction*> contextualActions() override;
QList<QAction *> contextualActions() override;
private:
void makeMenu();
private Q_SLOTS:
void clearWindowsOrder();
void switchTo(QAction *action);
private:
......@@ -66,13 +62,15 @@ class SwitchWindow : public Plasma::ContainmentActions
CurrentDesktop
};
QList <QAction *> m_actions;
TaskManager::ActivityInfo *m_activityInfo;
TaskManager::TasksModel *m_tasksModel;
QList<QAction *> m_actions;
Ui::Config m_ui;
MenuMode m_mode;
QTimer *m_clearOrderTimer;
QList<WId> m_windowsOrder;
TaskManager::VirtualDesktopInfo* m_virtualDesktopInfo;
static TaskManager::ActivityInfo *s_activityInfo;
static TaskManager::TasksModel *s_tasksModel;
static int s_instanceCount;
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment