Drop support for KAppmenu
We released three versions with it being disabled and it doesn't look like it will come back any time soon. Also the build was broken at least since the repo splitting due to incorrect path to dbus xml. In addition the connection to decorations got dropped already with the change to kdecoration2. Which means it anyway needs large adjustements to get the code working again. Overall it doesn't look like it makes lots of sense to keep the code around for someone working on it in future. If that happens this change can be reverted.
This commit is contained in:
parent
5088314e9f
commit
b405fda213
7 changed files with 0 additions and 213 deletions
|
@ -202,7 +202,6 @@ include(CMakeDependentOption)
|
|||
option(KWIN_BUILD_DECORATIONS "Enable building of KWin decorations." ON)
|
||||
option(KWIN_BUILD_KCMS "Enable building of KWin configuration modules." ON)
|
||||
option(KWIN_BUILD_TABBOX "Enable building of KWin Tabbox functionality" ON)
|
||||
option(KWIN_BUILD_KAPPMENU "Enable building of KWin with application menu support" OFF)
|
||||
option(KWIN_BUILD_XRENDER_COMPOSITING "Enable building of KWin with XRender Compositing support" ON)
|
||||
cmake_dependent_option(KWIN_BUILD_ACTIVITIES "Enable building of KWin with kactivities support" ON "KF5Activities_FOUND" OFF)
|
||||
option(KWIN_PLASMA_ACTIVE "Enable building KWin for Plasma Active." OFF)
|
||||
|
@ -229,8 +228,6 @@ if(KWIN_PLASMA_ACTIVE)
|
|||
set(KWIN_NAME "kwinactive")
|
||||
endif()
|
||||
|
||||
cmake_dependent_option(KWIN_BUILD_KAPPMENU "Build without appmenu support" ON "KWIN_BUILD_DECORATIONS" FALSE)
|
||||
|
||||
set(KWIN_BUILD_OPENGL FALSE)
|
||||
set(KWIN_BUILD_OPENGLES FALSE)
|
||||
if(${Qt5Gui_OPENGL_IMPLEMENTATION} STREQUAL "GL")
|
||||
|
@ -398,15 +395,6 @@ if(KWIN_BUILD_TABBOX)
|
|||
)
|
||||
endif()
|
||||
|
||||
if(KWIN_BUILD_KAPPMENU)
|
||||
set(
|
||||
kwin_KDEINIT_SRCS ${kwin_KDEINIT_SRCS}
|
||||
appmenu.cpp
|
||||
)
|
||||
qt5_add_dbus_interface(kwin_KDEINIT_SRCS
|
||||
${CMAKE_SOURCE_DIR}/plasma-workspace/appmenu/org.kde.kappmenu.xml appmenu_interface)
|
||||
endif()
|
||||
|
||||
if(KWIN_BUILD_ACTIVITIES)
|
||||
set(
|
||||
kwin_KDEINIT_SRCS ${kwin_KDEINIT_SRCS}
|
||||
|
|
83
appmenu.cpp
83
appmenu.cpp
|
@ -1,83 +0,0 @@
|
|||
/********************************************************************
|
||||
KWin - the KDE window manager
|
||||
This file is part of the KDE project.
|
||||
|
||||
Copyright (c) 2011 Lionel Chauvin <megabigbug@yahoo.fr>
|
||||
Copyright (c) 2011,2012 Cédric Bellegarde <gnumdk@gmail.com>
|
||||
Copyright (C) 2013 Martin Gräßlin <mgraesslin@kde.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*********************************************************************/
|
||||
#include "appmenu.h"
|
||||
#include "client.h"
|
||||
#include "workspace.h"
|
||||
#include <appmenu_interface.h>
|
||||
|
||||
namespace KWin {
|
||||
|
||||
KWIN_SINGLETON_FACTORY(ApplicationMenu)
|
||||
|
||||
ApplicationMenu::ApplicationMenu(QObject *parent)
|
||||
: QObject(parent)
|
||||
, m_appmenuInterface(new OrgKdeKappmenuInterface(QStringLiteral("org.kde.kappmenu"), QStringLiteral("/KAppMenu"), QDBusConnection::sessionBus(), this))
|
||||
{
|
||||
connect(m_appmenuInterface, &OrgKdeKappmenuInterface::showRequest, this, &ApplicationMenu::slotShowRequest);
|
||||
connect(m_appmenuInterface, &OrgKdeKappmenuInterface::menuAvailable, this, &ApplicationMenu::slotMenuAvailable);
|
||||
connect(m_appmenuInterface, &OrgKdeKappmenuInterface::menuHidden, this, &ApplicationMenu::slotMenuHidden);
|
||||
connect(m_appmenuInterface, &OrgKdeKappmenuInterface::clearMenus, this, &ApplicationMenu::slotClearMenus);
|
||||
}
|
||||
|
||||
ApplicationMenu::~ApplicationMenu()
|
||||
{
|
||||
s_self = NULL;
|
||||
}
|
||||
|
||||
bool ApplicationMenu::hasMenu(xcb_window_t window)
|
||||
{
|
||||
return m_windowsMenu.removeOne(window);
|
||||
}
|
||||
|
||||
void ApplicationMenu::slotShowRequest(qulonglong wid)
|
||||
{
|
||||
if (Client *c = Workspace::self()->findClient(Predicate::WindowMatch, wid))
|
||||
c->emitShowRequest();
|
||||
}
|
||||
|
||||
void ApplicationMenu::slotMenuAvailable(qulonglong wid)
|
||||
{
|
||||
if (Client *c = Workspace::self()->findClient(Predicate::WindowMatch, wid))
|
||||
c->setAppMenuAvailable();
|
||||
else
|
||||
m_windowsMenu.append(wid);
|
||||
}
|
||||
|
||||
void ApplicationMenu::slotMenuHidden(qulonglong wid)
|
||||
{
|
||||
if (Client *c = Workspace::self()->findClient(Predicate::WindowMatch, wid))
|
||||
c->emitMenuHidden();
|
||||
}
|
||||
|
||||
void ApplicationMenu::slotClearMenus()
|
||||
{
|
||||
foreach (Client *c, Workspace::self()->clientList()) {
|
||||
c->setAppMenuUnavailable();
|
||||
}
|
||||
}
|
||||
|
||||
void ApplicationMenu::showApplicationMenu(const QPoint &p, const xcb_window_t id)
|
||||
{
|
||||
m_appmenuInterface->showMenu(p.x(), p.y(), id);
|
||||
}
|
||||
|
||||
} // namespace
|
62
appmenu.h
62
appmenu.h
|
@ -1,62 +0,0 @@
|
|||
/********************************************************************
|
||||
KWin - the KDE window manager
|
||||
This file is part of the KDE project.
|
||||
|
||||
Copyright (c) 2011 Lionel Chauvin <megabigbug@yahoo.fr>
|
||||
Copyright (c) 2011,2012 Cédric Bellegarde <gnumdk@gmail.com>
|
||||
Copyright (C) 2013 Martin Gräßlin <mgraesslin@kde.org>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*********************************************************************/
|
||||
#ifndef KWIN_APPLICATIONMENU_H
|
||||
#define KWIN_APPLICATIONMENU_H
|
||||
// KWin
|
||||
#include <kwinglobals.h>
|
||||
// Qt
|
||||
#include <QObject>
|
||||
// xcb
|
||||
#include <xcb/xcb.h>
|
||||
|
||||
class QPoint;
|
||||
class OrgKdeKappmenuInterface;
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
class ApplicationMenu : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
virtual ~ApplicationMenu();
|
||||
|
||||
bool hasMenu(xcb_window_t window);
|
||||
void showApplicationMenu(const QPoint &pos, const xcb_window_t window);
|
||||
|
||||
private Q_SLOTS:
|
||||
void slotShowRequest(qulonglong wid);
|
||||
void slotMenuAvailable(qulonglong wid);
|
||||
void slotMenuHidden(qulonglong wid);
|
||||
void slotClearMenus();
|
||||
|
||||
private:
|
||||
QList<xcb_window_t> m_windowsMenu;
|
||||
OrgKdeKappmenuInterface *m_appmenuInterface;
|
||||
|
||||
KWIN_SINGLETON(ApplicationMenu)
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // KWIN_APPLICATIONMENU_H
|
25
client.cpp
25
client.cpp
|
@ -24,9 +24,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifdef KWIN_BUILD_ACTIVITIES
|
||||
#include "activities.h"
|
||||
#endif
|
||||
#ifdef KWIN_BUILD_KAPPMENU
|
||||
#include "appmenu.h"
|
||||
#endif
|
||||
#include "atoms.h"
|
||||
#include "client_machine.h"
|
||||
#include "composite.h"
|
||||
|
@ -139,9 +136,6 @@ Client::Client()
|
|||
, activitiesDefined(false)
|
||||
, needsSessionInteract(false)
|
||||
, needsXWindowMove(false)
|
||||
#ifdef KWIN_BUILD_KAPPMENU
|
||||
, m_menuAvailable(false)
|
||||
#endif
|
||||
, m_decoInputExtent()
|
||||
, m_focusOutTimer(nullptr)
|
||||
, m_palette(QApplication::palette())
|
||||
|
@ -2287,25 +2281,6 @@ bool Client::isClient() const
|
|||
return true;
|
||||
}
|
||||
|
||||
#ifdef KWIN_BUILD_KAPPMENU
|
||||
void Client::setAppMenuAvailable()
|
||||
{
|
||||
m_menuAvailable = true;
|
||||
emit appMenuAvailable();
|
||||
}
|
||||
|
||||
void Client::setAppMenuUnavailable()
|
||||
{
|
||||
m_menuAvailable = false;
|
||||
emit appMenuUnavailable();
|
||||
}
|
||||
|
||||
void Client::showApplicationMenu(const QPoint &p)
|
||||
{
|
||||
ApplicationMenu::self()->showApplicationMenu(p, window());
|
||||
}
|
||||
#endif
|
||||
|
||||
NET::WindowType Client::windowType(bool direct, int supportedTypes) const
|
||||
{
|
||||
// TODO: does it make sense to cache the returned window type for SUPPORTED_MANAGED_WINDOW_TYPES_MASK?
|
||||
|
|
19
client.h
19
client.h
|
@ -665,22 +665,6 @@ public:
|
|||
// a helper for the workspace window packing. tests for screen validity and updates since in maximization case as with normal moving
|
||||
void packTo(int left, int top);
|
||||
|
||||
#ifdef KWIN_BUILD_KAPPMENU
|
||||
// Used by workspace
|
||||
void emitShowRequest() {
|
||||
emit showRequest();
|
||||
}
|
||||
void emitMenuHidden() {
|
||||
emit menuHidden();
|
||||
}
|
||||
void setAppMenuAvailable();
|
||||
void setAppMenuUnavailable();
|
||||
void showApplicationMenu(const QPoint&);
|
||||
bool menuAvailable() {
|
||||
return m_menuAvailable;
|
||||
}
|
||||
#endif
|
||||
|
||||
template <typename T>
|
||||
void print(T &stream) const;
|
||||
|
||||
|
@ -1036,9 +1020,6 @@ private:
|
|||
bool needsSessionInteract;
|
||||
bool needsXWindowMove;
|
||||
|
||||
#ifdef KWIN_BUILD_KAPPMENU
|
||||
bool m_menuAvailable;
|
||||
#endif
|
||||
Xcb::Window m_decoInputExtent;
|
||||
QPoint input_offset;
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#cmakedefine KWIN_BUILD_DECORATIONS 1
|
||||
#cmakedefine KWIN_BUILD_TABBOX 1
|
||||
#cmakedefine KWIN_BUILD_KAPPMENU 1
|
||||
#cmakedefine KWIN_BUILD_ACTIVITIES 1
|
||||
#define KWIN_NAME "${KWIN_NAME}"
|
||||
#define KWIN_INTERNAL_NAME_X11 "${KWIN_INTERNAL_NAME_X11}"
|
||||
|
|
|
@ -27,9 +27,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#ifdef KWIN_BUILD_ACTIVITIES
|
||||
#include "activities.h"
|
||||
#endif
|
||||
#ifdef KWIN_BUILD_KAPPMENU
|
||||
#include "appmenu.h"
|
||||
#endif
|
||||
#include "atoms.h"
|
||||
#include "client.h"
|
||||
#include "composite.h"
|
||||
|
@ -132,10 +129,6 @@ Workspace::Workspace(bool restore)
|
|||
// If KWin was already running it saved its configuration after loosing the selection -> Reread
|
||||
QFuture<void> reparseConfigFuture = QtConcurrent::run(options, &Options::reparseConfiguration);
|
||||
|
||||
#ifdef KWIN_BUILD_KAPPMENU
|
||||
ApplicationMenu::create(this);
|
||||
#endif
|
||||
|
||||
_self = this;
|
||||
|
||||
// first initialize the extensions
|
||||
|
@ -515,10 +508,6 @@ void Workspace::addClient(Client* c)
|
|||
if (TabBox::TabBox::self()->isDisplayed())
|
||||
TabBox::TabBox::self()->reset(true);
|
||||
#endif
|
||||
#ifdef KWIN_BUILD_KAPPMENU
|
||||
if (ApplicationMenu::self()->hasMenu(c->window()))
|
||||
c->setAppMenuAvailable();
|
||||
#endif
|
||||
}
|
||||
|
||||
void Workspace::addUnmanaged(Unmanaged* c)
|
||||
|
|
Loading…
Reference in a new issue