MCPcopy Create free account
hub / github.com/KDE/kwin / getMousePressCommand

Method getMousePressCommand

src/window.cpp:1876–1899  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1874}
1875
1876std::optional<Options::MouseCommand> Window::getMousePressCommand(Qt::MouseButton button) const
1877{
1878 if (button == Qt::NoButton) {
1879 return std::nullopt;
1880 }
1881 if (isActive()) {
1882 if (options->isClickRaise() && !isMostRecentlyRaised()) {
1883 return Options::MouseActivateRaiseAndPassClick;
1884 }
1885 } else {
1886 switch (button) {
1887 case Qt::LeftButton:
1888 return options->commandWindow1();
1889 case Qt::MiddleButton:
1890 return options->commandWindow2();
1891 case Qt::RightButton:
1892 return options->commandWindow3();
1893 default:
1894 // all other buttons pass Activate & Pass Client
1895 return Options::MouseActivateAndPassClick;
1896 }
1897 }
1898 return std::nullopt;
1899}
1900
1901std::optional<Options::MouseCommand> Window::getMouseReleaseCommand(Qt::MouseButton button) const
1902{

Calls 1

isActiveFunction · 0.85

Tested by

no test coverage detected