Some indentation fixes.
This commit is contained in:
parent
5173dfa1ca
commit
328b75a311
1 changed files with 37 additions and 39 deletions
|
|
@ -30,8 +30,7 @@
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(QMargins);
|
Q_DECLARE_METATYPE(QMargins);
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui::Platform {
|
||||||
namespace Platform {
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
constexpr auto kDWMWCP_ROUND = DWORD(2);
|
constexpr auto kDWMWCP_ROUND = DWORD(2);
|
||||||
|
|
@ -146,46 +145,46 @@ void FixAeroSnap(HWND handle) {
|
||||||
|
|
||||||
class WindowHelper::NativeFilter final : public QAbstractNativeEventFilter {
|
class WindowHelper::NativeFilter final : public QAbstractNativeEventFilter {
|
||||||
public:
|
public:
|
||||||
void registerWindow(HWND handle, not_null<WindowHelper*> helper);
|
void registerWindow(HWND handle, not_null<WindowHelper*> helper);
|
||||||
void unregisterWindow(HWND handle);
|
void unregisterWindow(HWND handle);
|
||||||
|
|
||||||
bool nativeEventFilter(
|
bool nativeEventFilter(
|
||||||
const QByteArray &eventType,
|
const QByteArray &eventType,
|
||||||
void *message,
|
void *message,
|
||||||
long *result) override;
|
long *result) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
base::flat_map<HWND, not_null<WindowHelper*>> _windowByHandle;
|
base::flat_map<HWND, not_null<WindowHelper*>> _windowByHandle;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void WindowHelper::NativeFilter::registerWindow(
|
void WindowHelper::NativeFilter::registerWindow(
|
||||||
HWND handle,
|
HWND handle,
|
||||||
not_null<WindowHelper*> helper) {
|
not_null<WindowHelper*> helper) {
|
||||||
_windowByHandle.emplace(handle, helper);
|
_windowByHandle.emplace(handle, helper);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowHelper::NativeFilter::unregisterWindow(HWND handle) {
|
void WindowHelper::NativeFilter::unregisterWindow(HWND handle) {
|
||||||
_windowByHandle.remove(handle);
|
_windowByHandle.remove(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WindowHelper::NativeFilter::nativeEventFilter(
|
bool WindowHelper::NativeFilter::nativeEventFilter(
|
||||||
const QByteArray &eventType,
|
const QByteArray &eventType,
|
||||||
void *message,
|
void *message,
|
||||||
long *result) {
|
long *result) {
|
||||||
auto filtered = false;
|
auto filtered = false;
|
||||||
const auto msg = static_cast<MSG*>(message);
|
const auto msg = static_cast<MSG*>(message);
|
||||||
const auto i = _windowByHandle.find(msg->hwnd);
|
const auto i = _windowByHandle.find(msg->hwnd);
|
||||||
if (i != end(_windowByHandle)) {
|
if (i != end(_windowByHandle)) {
|
||||||
base::Integration::Instance().enterFromEventLoop([&] {
|
base::Integration::Instance().enterFromEventLoop([&] {
|
||||||
filtered = i->second->handleNativeEvent(
|
filtered = i->second->handleNativeEvent(
|
||||||
msg->message,
|
msg->message,
|
||||||
msg->wParam,
|
msg->wParam,
|
||||||
msg->lParam,
|
msg->lParam,
|
||||||
reinterpret_cast<LRESULT*>(result));
|
reinterpret_cast<LRESULT*>(result));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return filtered;
|
return filtered;
|
||||||
}
|
}
|
||||||
|
|
||||||
WindowHelper::WindowHelper(not_null<RpWidget*> window)
|
WindowHelper::WindowHelper(not_null<RpWidget*> window)
|
||||||
|
|
@ -838,15 +837,15 @@ void WindowHelper::fixMaximizedWindow() {
|
||||||
}
|
}
|
||||||
|
|
||||||
not_null<WindowHelper::NativeFilter*> WindowHelper::GetNativeFilter() {
|
not_null<WindowHelper::NativeFilter*> WindowHelper::GetNativeFilter() {
|
||||||
Expects(QCoreApplication::instance() != nullptr);
|
Expects(QCoreApplication::instance() != nullptr);
|
||||||
|
|
||||||
static const auto GlobalFilter = [&] {
|
static const auto GlobalFilter = [&] {
|
||||||
const auto application = QCoreApplication::instance();
|
const auto application = QCoreApplication::instance();
|
||||||
const auto filter = Ui::CreateChild<NativeFilter>(application);
|
const auto filter = Ui::CreateChild<NativeFilter>(application);
|
||||||
application->installNativeEventFilter(filter);
|
application->installNativeEventFilter(filter);
|
||||||
return filter;
|
return filter;
|
||||||
}();
|
}();
|
||||||
return GlobalFilter;
|
return GlobalFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
HWND GetWindowHandle(not_null<QWidget*> widget) {
|
HWND GetWindowHandle(not_null<QWidget*> widget) {
|
||||||
|
|
@ -878,5 +877,4 @@ bool NativeWindowFrameSupported() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Platform
|
} // namespace Ui::Platform
|
||||||
} // namespace Ui
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue