Changeset View
Changeset View
Standalone View
Standalone View
useractions.cpp
Show All 37 Lines | |||||
38 | #include "input.h" | 38 | #include "input.h" | ||
39 | #include "workspace.h" | 39 | #include "workspace.h" | ||
40 | #include "effects.h" | 40 | #include "effects.h" | ||
41 | #include "platform.h" | 41 | #include "platform.h" | ||
42 | #include "screens.h" | 42 | #include "screens.h" | ||
43 | #include "shell_client.h" | 43 | #include "shell_client.h" | ||
44 | #include "virtualdesktops.h" | 44 | #include "virtualdesktops.h" | ||
45 | #include "scripting/scripting.h" | 45 | #include "scripting/scripting.h" | ||
46 | #include "osd.h" | ||||
47 | #include "unmanaged.h" | ||||
46 | 48 | | |||
47 | #ifdef KWIN_BUILD_ACTIVITIES | 49 | #ifdef KWIN_BUILD_ACTIVITIES | ||
48 | #include "activities.h" | 50 | #include "activities.h" | ||
49 | #include <kactivities/info.h> | 51 | #include <kactivities/info.h> | ||
50 | #endif | 52 | #endif | ||
51 | #include "appmenu.h" | 53 | #include "appmenu.h" | ||
52 | 54 | | |||
53 | #include <KProcess> | 55 | #include <KProcess> | ||
54 | 56 | | |||
55 | #include <QAction> | 57 | #include <QAction> | ||
56 | #include <QCheckBox> | 58 | #include <QCheckBox> | ||
57 | #include <QtConcurrentRun> | 59 | #include <QtConcurrentRun> | ||
58 | #include <QPointer> | 60 | #include <QPointer> | ||
59 | #include <QPushButton> | 61 | #include <QPushButton> | ||
60 | 62 | | |||
61 | #include <KGlobalAccel> | 63 | #include <KGlobalAccel> | ||
62 | #include <KLocalizedString> | 64 | #include <KLocalizedString> | ||
63 | #include <kconfig.h> | 65 | #include <kconfig.h> | ||
64 | #include <QRegExp> | 66 | #include <QRegExp> | ||
65 | #include <QMenu> | 67 | #include <QMenu> | ||
66 | #include <QWidgetAction> | 68 | #include <QWidgetAction> | ||
67 | #include <kauthorized.h> | 69 | #include <kauthorized.h> | ||
68 | 70 | | |||
69 | #include "killwindow.h" | | |||
70 | #ifdef KWIN_BUILD_TABBOX | 71 | #ifdef KWIN_BUILD_TABBOX | ||
71 | #include "tabbox.h" | 72 | #include "tabbox.h" | ||
72 | #endif | 73 | #endif | ||
73 | 74 | | |||
74 | namespace KWin | 75 | namespace KWin | ||
75 | { | 76 | { | ||
76 | 77 | | |||
77 | UserActionsMenu::UserActionsMenu(QObject *parent) | 78 | UserActionsMenu::UserActionsMenu(QObject *parent) | ||
▲ Show 20 Lines • Show All 1582 Lines • ▼ Show 20 Line(s) | 1660 | if (active_client) | |||
1660 | active_client->untab(active_client->geometry().translated(cascadeOffset(active_client))); | 1661 | active_client->untab(active_client->geometry().translated(cascadeOffset(active_client))); | ||
1661 | } | 1662 | } | ||
1662 | 1663 | | |||
1663 | /*! | 1664 | /*! | ||
1664 | Kill Window feature, similar to xkill | 1665 | Kill Window feature, similar to xkill | ||
1665 | */ | 1666 | */ | ||
1666 | void Workspace::slotKillWindow() | 1667 | void Workspace::slotKillWindow() | ||
1667 | { | 1668 | { | ||
1668 | if (m_windowKiller.isNull()) { | 1669 | OSD::show(i18n("Select window to force close with left click or enter.\nEscape or right click to cancel."), | ||
1669 | m_windowKiller.reset(new KillWindow()); | 1670 | QStringLiteral("window-close")); | ||
1671 | kwinApp()->platform()->startInteractiveWindowSelection( | ||||
1672 | [] (KWin::Toplevel *t) { | ||||
1673 | OSD::hide(); | ||||
1674 | if (!t) { | ||||
1675 | return; | ||||
1676 | } | ||||
1677 | if (AbstractClient *c = qobject_cast<AbstractClient*>(t)) { | ||||
1678 | c->killWindow(); | ||||
1679 | } else if (Unmanaged *u = qobject_cast<Unmanaged*>(t)) { | ||||
1680 | xcb_kill_client(connection(), u->window()); | ||||
1670 | } | 1681 | } | ||
1671 | m_windowKiller->start(); | 1682 | }, QByteArrayLiteral("pirate") | ||
1683 | ); | ||||
1672 | } | 1684 | } | ||
1673 | 1685 | | |||
1674 | /*! | 1686 | /*! | ||
1675 | Switches to the nearest window in given direction | 1687 | Switches to the nearest window in given direction | ||
1676 | */ | 1688 | */ | ||
1677 | void Workspace::switchWindow(Direction direction) | 1689 | void Workspace::switchWindow(Direction direction) | ||
1678 | { | 1690 | { | ||
1679 | if (!active_client) | 1691 | if (!active_client) | ||
▲ Show 20 Lines • Show All 245 Lines • Show Last 20 Lines |