| 143 | } |
| 144 | |
| 145 | bool BuildUniformWindowRect(HWND hwnd, const Options &options, Rect &rect) { |
| 146 | RECT window_rect = {}; |
| 147 | RECT client_rect = {}; |
| 148 | if (!::GetWindowRect(hwnd, &window_rect) || !::GetClientRect(hwnd, &client_rect)) { |
| 149 | return false; |
| 150 | } |
| 151 | |
| 152 | const int frame_width = (window_rect.right - window_rect.left) - (client_rect.right - client_rect.left); |
| 153 | const int frame_height = (window_rect.bottom - window_rect.top) - (client_rect.bottom - client_rect.top); |
| 154 | rect.width = options.window_width + frame_width; |
| 155 | rect.height = options.window_height + frame_height; |
| 156 | return rect.width > 0 && rect.height > 0; |
| 157 | } |
| 158 | |
| 159 | std::vector<LayoutSeed> BuildLayoutSeeds(const std::vector<HWND> &windows, const Options &options) { |
| 160 | std::vector<LayoutSeed> seeds; |