Skip to content

Commit 6df2f42

Browse files
committed
Improve log for window resizing
1 parent 3c24602 commit 6df2f42

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pathfinder/gpu/window.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,17 @@ void Window::framebuffer_resize_callback(GLFWwindow* glfw_window, int width, int
5151
auto window = reinterpret_cast<Window*>(glfwGetWindowUserPointer(glfw_window));
5252

5353
if (window) {
54+
// Get the size of window decorations.
55+
int left, top, right, bottom;
56+
glfwGetWindowFrameSize(glfw_window, &left, &top, &right, &bottom);
57+
58+
// TODO: consider window decorations.
5459
window->just_resized_ = true;
5560
window->logical_size_ = (Vec2F(width, height) / window->get_dpi_scaling_factor()).to_i32();
5661
window->minimized_ = window->logical_size_.area() == 0;
5762

58-
Logger::info("Window physical resized to " + Vec2I(width, height).to_string());
59-
Logger::info("Window logical resized to " + window->logical_size_.to_string());
63+
Logger::info("Window resized to physical" + Vec2I(width, height).to_string() + ", logical" +
64+
window->logical_size_.to_string());
6065
} else {
6166
Logger::error("glfwGetWindowUserPointer is NULL!");
6267
}

0 commit comments

Comments
 (0)