diff --git a/effects/presentwindows/presentwindows.h b/effects/presentwindows/presentwindows.h --- a/effects/presentwindows/presentwindows.h +++ b/effects/presentwindows/presentwindows.h @@ -332,6 +332,11 @@ DesktopMouseAction m_middleButtonDesktop; DesktopMouseAction m_rightButtonDesktop; + void activateWindow(); + void windowToCurrentDestkop(); + void windowToAllDesktops(); + void minimizeWindow(); + CloseWindowView* m_closeView; EffectWindow* m_closeWindow; Qt::Corner m_closeButtonCorner; diff --git a/effects/presentwindows/presentwindows.cpp b/effects/presentwindows/presentwindows.cpp --- a/effects/presentwindows/presentwindows.cpp +++ b/effects/presentwindows/presentwindows.cpp @@ -683,36 +683,54 @@ return true; } +void PresentWindowsEffect::activateWindow() { + if (m_highlightedWindow) { + effects->activateWindow(m_highlightedWindow); + } + setActive(false); +} + +void PresentWindowsEffect::windowToCurrentDestkop() { + if (m_highlightedWindow) { + effects->windowToDesktop(m_highlightedWindow, effects->currentDesktop()); + } +} + +void PresentWindowsEffect::windowToAllDesktops() { + if (m_highlightedWindow) { + if (m_highlightedWindow->isOnAllDesktops()) + effects->windowToDesktop(m_highlightedWindow, effects->currentDesktop()); + else + effects->windowToDesktop(m_highlightedWindow, NET::OnAllDesktops); + } +} + +void PresentWindowsEffect::minimizeWindow() { + if (m_highlightedWindow) { + if (m_highlightedWindow->isMinimized()) + m_highlightedWindow->unminimize(); + else + m_highlightedWindow->minimize(); + } +} + void PresentWindowsEffect::mouseActionWindow(WindowMouseAction& action) { switch(action) { case WindowActivateAction: - if (m_highlightedWindow) - effects->activateWindow(m_highlightedWindow); - setActive(false); + activateWindow(); break; case WindowExitAction: setActive(false); break; case WindowToCurrentDesktopAction: - if (m_highlightedWindow) - effects->windowToDesktop(m_highlightedWindow, effects->currentDesktop()); + windowToCurrentDestkop(); break; case WindowToAllDesktopsAction: - if (m_highlightedWindow) { - if (m_highlightedWindow->isOnAllDesktops()) - effects->windowToDesktop(m_highlightedWindow, effects->currentDesktop()); - else - effects->windowToDesktop(m_highlightedWindow, NET::OnAllDesktops); - } + windowToAllDesktops(); break; case WindowMinimizeAction: - if (m_highlightedWindow) { - if (m_highlightedWindow->isMinimized()) - m_highlightedWindow->unminimize(); - else - m_highlightedWindow->minimize(); - } + minimizeWindow(); break; default: break; @@ -723,9 +741,7 @@ { switch(action) { case DesktopActivateAction: - if (m_highlightedWindow) - effects->activateWindow(m_highlightedWindow); - setActive(false); + activateWindow(); break; case DesktopExitAction: setActive(false); @@ -757,6 +773,18 @@ return; } + switch(e->key() + e->modifiers()) { + case Qt::CTRL + Qt::Key_T: + windowToCurrentDestkop(); + return; + case Qt::CTRL + Qt::Key_A: + windowToAllDesktops(); + return; + case Qt::CTRL + Qt::Key_M: + minimizeWindow(); + return; + } + switch(e->key()) { // Wrap only if not auto-repeating case Qt::Key_Left: @@ -795,9 +823,7 @@ return; case Qt::Key_Return: case Qt::Key_Enter: - if (m_highlightedWindow) - effects->activateWindow(m_highlightedWindow); - setActive(false); + activateWindow(); return; case Qt::Key_Tab: return; // Nothing at the moment