MCPcopy Create free account
hub / github.com/WallBreaker2/op / BuildUniformWindowRect

Function BuildUniformWindowRect

libop/window/WindowLayout.cpp:145–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145bool 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
159std::vector<LayoutSeed> BuildLayoutSeeds(const std::vector<HWND> &windows, const Options &options) {
160 std::vector<LayoutSeed> seeds;

Callers 1

BuildLayoutSeedsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected