Changeset View
Changeset View
Standalone View
Standalone View
useractions.cpp
Show All 29 Lines | |||||
30 | /////////////////////////////////////////////////////////////////////////////// | 30 | /////////////////////////////////////////////////////////////////////////////// | ||
31 | // NOTE: if you change the menu, keep | 31 | // NOTE: if you change the menu, keep | ||
32 | // plasma-desktop/applets/taskmanager/package/contents/ui/ContextMenu.qml | 32 | // plasma-desktop/applets/taskmanager/package/contents/ui/ContextMenu.qml | ||
33 | // in sync | 33 | // in sync | ||
34 | ////////////////////////////////////////////////////////////////////////////// | 34 | ////////////////////////////////////////////////////////////////////////////// | ||
35 | 35 | | |||
36 | #include "useractions.h" | 36 | #include "useractions.h" | ||
37 | #include "cursor.h" | 37 | #include "cursor.h" | ||
38 | #include "client.h" | 38 | #include "x11client.h" | ||
39 | #include "colorcorrection/manager.h" | 39 | #include "colorcorrection/manager.h" | ||
40 | #include "composite.h" | 40 | #include "composite.h" | ||
41 | #include "input.h" | 41 | #include "input.h" | ||
42 | #include "workspace.h" | 42 | #include "workspace.h" | ||
43 | #include "effects.h" | 43 | #include "effects.h" | ||
44 | #include "platform.h" | 44 | #include "platform.h" | ||
45 | #include "screens.h" | 45 | #include "screens.h" | ||
46 | #include "xdgshellclient.h" | 46 | #include "xdgshellclient.h" | ||
▲ Show 20 Lines • Show All 751 Lines • ▼ Show 20 Line(s) | 793 | #ifdef KWIN_BUILD_ACTIVITIES | |||
798 | if (m_client.isNull()) | 798 | if (m_client.isNull()) | ||
799 | return; | 799 | return; | ||
800 | if (activity.isEmpty()) { | 800 | if (activity.isEmpty()) { | ||
801 | // the 'on_all_activities' menu entry | 801 | // the 'on_all_activities' menu entry | ||
802 | m_client->setOnAllActivities(!m_client->isOnAllActivities()); | 802 | m_client->setOnAllActivities(!m_client->isOnAllActivities()); | ||
803 | return; | 803 | return; | ||
804 | } | 804 | } | ||
805 | 805 | | |||
806 | Client *c = dynamic_cast<Client*>(m_client.data()); | 806 | X11Client *c = dynamic_cast<X11Client *>(m_client.data()); | ||
807 | if (!c) { | 807 | if (!c) { | ||
808 | return; | 808 | return; | ||
809 | } | 809 | } | ||
810 | 810 | | |||
811 | Activities::self()->toggleClientOnActivity(c, activity, false); | 811 | Activities::self()->toggleClientOnActivity(c, activity, false); | ||
812 | if (m_activityMenu && m_activityMenu->isVisible() && m_activityMenu->actions().count()) { | 812 | if (m_activityMenu && m_activityMenu->isVisible() && m_activityMenu->actions().count()) { | ||
813 | const bool isOnAll = m_client->isOnAllActivities(); | 813 | const bool isOnAll = m_client->isOnAllActivities(); | ||
814 | m_activityMenu->actions().at(0)->setChecked(isOnAll); | 814 | m_activityMenu->actions().at(0)->setChecked(isOnAll); | ||
▲ Show 20 Lines • Show All 319 Lines • ▼ Show 20 Line(s) | 1133 | case Options::NoOp: | |||
1134 | break; | 1134 | break; | ||
1135 | } | 1135 | } | ||
1136 | } | 1136 | } | ||
1137 | 1137 | | |||
1138 | /** | 1138 | /** | ||
1139 | * Called by the decoration in the new API to determine what buttons the user has configured for | 1139 | * Called by the decoration in the new API to determine what buttons the user has configured for | ||
1140 | * window tab dragging and the operations menu. | 1140 | * window tab dragging and the operations menu. | ||
1141 | */ | 1141 | */ | ||
1142 | Options::WindowOperation Client::mouseButtonToWindowOperation(Qt::MouseButtons button) | 1142 | Options::WindowOperation X11Client::mouseButtonToWindowOperation(Qt::MouseButtons button) | ||
1143 | { | 1143 | { | ||
1144 | Options::MouseCommand com = Options::MouseNothing; | 1144 | Options::MouseCommand com = Options::MouseNothing; | ||
1145 | bool active = isActive(); | 1145 | bool active = isActive(); | ||
1146 | if (!wantsInput()) // we cannot be active, use it anyway | 1146 | if (!wantsInput()) // we cannot be active, use it anyway | ||
1147 | active = true; | 1147 | active = true; | ||
1148 | 1148 | | |||
1149 | if (button == Qt::LeftButton) | 1149 | if (button == Qt::LeftButton) | ||
1150 | com = active ? options->commandActiveTitlebar1() : options->commandInactiveTitlebar1(); | 1150 | com = active ? options->commandActiveTitlebar1() : options->commandInactiveTitlebar1(); | ||
1151 | else if (button == Qt::MidButton) | 1151 | else if (button == Qt::MidButton) | ||
1152 | com = active ? options->commandActiveTitlebar2() : options->commandInactiveTitlebar2(); | 1152 | com = active ? options->commandActiveTitlebar2() : options->commandInactiveTitlebar2(); | ||
1153 | else if (button == Qt::RightButton) | 1153 | else if (button == Qt::RightButton) | ||
1154 | com = active ? options->commandActiveTitlebar3() : options->commandInactiveTitlebar3(); | 1154 | com = active ? options->commandActiveTitlebar3() : options->commandInactiveTitlebar3(); | ||
1155 | 1155 | | |||
1156 | if (com == Options::MouseOperationsMenu) | 1156 | if (com == Options::MouseOperationsMenu) | ||
1157 | return Options::OperationsOp; | 1157 | return Options::OperationsOp; | ||
1158 | return Options::NoOp; | 1158 | return Options::NoOp; | ||
1159 | } | 1159 | } | ||
1160 | 1160 | | |||
1161 | /** | 1161 | /** | ||
1162 | * Performs a mouse command on this client (see options.h) | 1162 | * Performs a mouse command on this client (see options.h) | ||
1163 | */ | 1163 | */ | ||
1164 | bool Client::performMouseCommand(Options::MouseCommand command, const QPoint &globalPos) | 1164 | bool X11Client::performMouseCommand(Options::MouseCommand command, const QPoint &globalPos) | ||
1165 | { | 1165 | { | ||
1166 | bool replay = false; | 1166 | bool replay = false; | ||
1167 | switch(command) { | 1167 | switch(command) { | ||
1168 | case Options::MouseShade : | 1168 | case Options::MouseShade : | ||
1169 | toggleShade(); | 1169 | toggleShade(); | ||
1170 | cancelShadeHoverTimer(); | 1170 | cancelShadeHoverTimer(); | ||
1171 | break; | 1171 | break; | ||
1172 | case Options::MouseSetShade: | 1172 | case Options::MouseSetShade: | ||
▲ Show 20 Lines • Show All 539 Lines • ▼ Show 20 Line(s) | |||||
1712 | } | 1712 | } | ||
1713 | 1713 | | |||
1714 | void AbstractClient::setShortcutInternal() | 1714 | void AbstractClient::setShortcutInternal() | ||
1715 | { | 1715 | { | ||
1716 | updateCaption(); | 1716 | updateCaption(); | ||
1717 | workspace()->clientShortcutUpdated(this); | 1717 | workspace()->clientShortcutUpdated(this); | ||
1718 | } | 1718 | } | ||
1719 | 1719 | | |||
1720 | void Client::setShortcutInternal() | 1720 | void X11Client::setShortcutInternal() | ||
1721 | { | 1721 | { | ||
1722 | updateCaption(); | 1722 | updateCaption(); | ||
1723 | #if 0 | 1723 | #if 0 | ||
1724 | workspace()->clientShortcutUpdated(this); | 1724 | workspace()->clientShortcutUpdated(this); | ||
1725 | #else | 1725 | #else | ||
1726 | // Workaround for kwin<->kglobalaccel deadlock, when KWin has X grab and the kded | 1726 | // Workaround for kwin<->kglobalaccel deadlock, when KWin has X grab and the kded | ||
1727 | // kglobalaccel module tries to create the key grab. KWin should preferably grab | 1727 | // kglobalaccel module tries to create the key grab. KWin should preferably grab | ||
1728 | // they keys itself anyway :(. | 1728 | // they keys itself anyway :(. | ||
Show All 22 Lines |