@@ -59,11 +59,11 @@ void EnableFullDpiSupportIfAvailable(HWND hwnd) {
5959 FreeLibrary (user32_module);
6060}
6161
62- } // namespace
62+ } // namespace
6363
6464// Manages the Win32Window's window class registration.
6565class WindowClassRegistrar {
66- public:
66+ public:
6767 ~WindowClassRegistrar () = default ;
6868
6969 // Returns the singleton registrar instance.
@@ -82,7 +82,7 @@ class WindowClassRegistrar {
8282 // instances of the window.
8383 void UnregisterWindowClass ();
8484
85- private:
85+ private:
8686 WindowClassRegistrar () = default ;
8787
8888 static WindowClassRegistrar *instance_;
@@ -177,43 +177,43 @@ LRESULT
177177Win32Window::MessageHandler (HWND hwnd, UINT const message, WPARAM const wparam,
178178 LPARAM const lparam) noexcept {
179179 switch (message) {
180- case WM_DESTROY:
181- window_handle_ = nullptr ;
182- Destroy ();
183- if (quit_on_close_) {
184- PostQuitMessage (0 );
185- }
186- return 0 ;
187-
188- case WM_DPICHANGED: {
189- auto newRectSize = reinterpret_cast <RECT *>(lparam);
190- LONG newWidth = newRectSize->right - newRectSize->left ;
191- LONG newHeight = newRectSize->bottom - newRectSize->top ;
192-
193- SetWindowPos (hwnd, nullptr , newRectSize->left , newRectSize->top , newWidth,
194- newHeight, SWP_NOZORDER | SWP_NOACTIVATE);
195-
196- return 0 ;
180+ case WM_DESTROY:
181+ window_handle_ = nullptr ;
182+ Destroy ();
183+ if (quit_on_close_) {
184+ PostQuitMessage (0 );
197185 }
198- case WM_SIZE: {
199- RECT rect = GetClientArea ();
200- if (child_content_ != nullptr ) {
201- // Size and position the child window.
202- MoveWindow (child_content_, rect.left , rect.top , rect.right - rect.left ,
203- rect.bottom - rect.top , TRUE );
204- }
205- return 0 ;
186+ return 0 ;
187+
188+ case WM_DPICHANGED: {
189+ auto newRectSize = reinterpret_cast <RECT *>(lparam);
190+ LONG newWidth = newRectSize->right - newRectSize->left ;
191+ LONG newHeight = newRectSize->bottom - newRectSize->top ;
192+
193+ SetWindowPos (hwnd, nullptr , newRectSize->left , newRectSize->top , newWidth,
194+ newHeight, SWP_NOZORDER | SWP_NOACTIVATE);
195+
196+ return 0 ;
197+ }
198+ case WM_SIZE: {
199+ RECT rect = GetClientArea ();
200+ if (child_content_ != nullptr ) {
201+ // Size and position the child window.
202+ MoveWindow (child_content_, rect.left , rect.top , rect.right - rect.left ,
203+ rect.bottom - rect.top , TRUE );
206204 }
205+ return 0 ;
206+ }
207207
208- case WM_ACTIVATE:
209- if (child_content_ != nullptr ) {
210- SetFocus (child_content_);
211- }
212- return 0 ;
208+ case WM_ACTIVATE:
209+ if (child_content_ != nullptr ) {
210+ SetFocus (child_content_);
211+ }
212+ return 0 ;
213213
214- case WM_DWMCOLORIZATIONCOLORCHANGED:
215- UpdateTheme (hwnd);
216- return 0 ;
214+ case WM_DWMCOLORIZATIONCOLORCHANGED:
215+ UpdateTheme (hwnd);
216+ return 0 ;
217217 }
218218
219219 return DefWindowProc (window_handle_, message, wparam, lparam);
0 commit comments