| 128 | } |
| 129 | |
| 130 | bool MatchesTargetClientRect(HWND hwnd, const Rect &rect, const Metrics &initial_metrics) { |
| 131 | Metrics current_metrics = {}; |
| 132 | if (!GetWindowMetrics(hwnd, current_metrics)) { |
| 133 | return false; |
| 134 | } |
| 135 | |
| 136 | Insets insets = {}; |
| 137 | GetInsets(initial_metrics, insets); |
| 138 | |
| 139 | const int expected_x = rect.x + insets.left; |
| 140 | const int expected_y = rect.y + insets.top; |
| 141 | return abs(current_metrics.client_rect.x - expected_x) <= kResizeTolerance && |
| 142 | abs(current_metrics.client_rect.y - expected_y) <= kResizeTolerance; |
| 143 | } |
| 144 | |
| 145 | bool BuildUniformWindowRect(HWND hwnd, const Options &options, Rect &rect) { |
| 146 | RECT window_rect = {}; |
no test coverage detected