Unify Window::killWindow() for unmanaged windows

master
Vlad Zahorodnii 2 years ago
parent 944bff100e
commit 53b0dc3a5d

@ -32,15 +32,10 @@ void KillWindow::start()
OSD::show(i18n("Select window to force close with left click or enter.\nEscape or right click to cancel."),
QStringLiteral("window-close"));
kwinApp()->startInteractiveWindowSelection(
[](KWin::Window *t) {
[](KWin::Window *window) {
OSD::hide();
if (!t) {
return;
}
if (Window *c = static_cast<Window *>(t->isClient() ? t : nullptr)) {
c->killWindow();
} else if (Unmanaged *u = qobject_cast<Unmanaged *>(t)) {
xcb_kill_client(kwinApp()->x11Connection(), u->window());
if (window) {
window->killWindow();
}
},
QByteArrayLiteral("pirate"));

@ -235,4 +235,9 @@ void Unmanaged::damageNotifyEvent()
}
}
void Unmanaged::killWindow()
{
xcb_kill_client(kwinApp()->x11Connection(), window());
}
} // namespace

@ -46,7 +46,7 @@ public:
bool isMovableAcrossScreens() const override { return false; }
bool takeFocus() override { return false; }
bool wantsInput() const override { return false; }
void killWindow() override { /* nothing to do */ }
void killWindow() override;
void destroyWindow() override { /* nothing to do */ }
void closeWindow() override { /* nothing to do */ }
bool acceptsFocus() const override { return false; }

Loading…
Cancel
Save