Disable window rule configuration for Wayland
Summary: The window rule detection is too bound to X11 for it to work for Wayland windows. In fact it results in the config module just crashing. Thus it's better to just disable the items in the menu. As it's only for X11 windows we can also enforce platform xcb for the rules dialog. Test Plan: Menu disabled on Wayland window, menu enabled on Xwayland window Reviewers: #kwin, #plasma Subscribers: plasma-devel, kwin Tags: #plasma Differential Revision: https://phabricator.kde.org/D10594
This commit is contained in:
parent
338c7362c9
commit
7bf4a94286
3 changed files with 15 additions and 0 deletions
|
@ -248,6 +248,7 @@ static int edit(Window wid, bool whole_app)
|
|||
extern "C"
|
||||
KWIN_EXPORT int kdemain(int argc, char* argv[])
|
||||
{
|
||||
qputenv("QT_QPA_PLATFORM", "xcb");
|
||||
QApplication app(argc, argv);
|
||||
app.setApplicationDisplayName(i18n("KWin"));
|
||||
app.setApplicationName("kwin_rules_dialog");
|
||||
|
|
|
@ -40,6 +40,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "effects.h"
|
||||
#include "platform.h"
|
||||
#include "screens.h"
|
||||
#include "shell_client.h"
|
||||
#include "virtualdesktops.h"
|
||||
#include "scripting/scripting.h"
|
||||
|
||||
|
@ -318,10 +319,12 @@ void UserActionsMenu::init()
|
|||
QAction *action = advancedMenu->addAction(i18n("Special &Window Settings..."));
|
||||
action->setIcon(QIcon::fromTheme(QStringLiteral("preferences-system-windows-actions")));
|
||||
action->setData(Options::WindowRulesOp);
|
||||
m_rulesOperation = action;
|
||||
|
||||
action = advancedMenu->addAction(i18n("S&pecial Application Settings..."));
|
||||
action->setIcon(QIcon::fromTheme(QStringLiteral("preferences-system-windows-actions")));
|
||||
action->setData(Options::ApplicationRulesOp);
|
||||
m_applicationRulesOperation = action;
|
||||
if (!kwinApp()->config()->isImmutable() &&
|
||||
!KAuthorized::authorizeControlModules(configModules(true)).isEmpty()) {
|
||||
advancedMenu->addSeparator();
|
||||
|
@ -465,6 +468,15 @@ void UserActionsMenu::menuAboutToShow()
|
|||
action->setText(i18n("&Extensions"));
|
||||
}
|
||||
|
||||
// disable rules for Wayland windows - dialog is X11 only
|
||||
if (qobject_cast<ShellClient*>(m_client.data())) {
|
||||
m_rulesOperation->setEnabled(false);
|
||||
m_applicationRulesOperation->setEnabled(false);
|
||||
} else {
|
||||
m_rulesOperation->setEnabled(true);
|
||||
m_applicationRulesOperation->setEnabled(true);
|
||||
}
|
||||
|
||||
showHideActivityMenu();
|
||||
}
|
||||
|
||||
|
|
|
@ -260,6 +260,8 @@ private:
|
|||
* The Client for which the menu is shown.
|
||||
**/
|
||||
QWeakPointer<AbstractClient> m_client;
|
||||
QAction *m_rulesOperation = nullptr;
|
||||
QAction *m_applicationRulesOperation = nullptr;
|
||||
};
|
||||
|
||||
class ShortcutDialog
|
||||
|
|
Loading…
Reference in a new issue