Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove glfw todo
  • Loading branch information
dkwingsmt committed Nov 10, 2023
commit 79b55432c4f6be60354516cb96f5311b25d2d7bf
7 changes: 3 additions & 4 deletions examples/glfw/FlutterEmbedderGLFW.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,15 @@ static void GLFWKeyCallback(GLFWwindow* window,
}

void GLFWwindowSizeCallback(GLFWwindow* window, int width, int height) {
// TODO(dkwingsmt): The GLFW embedder doesn't support multi-view for now. Use
// the real view ID when it does.
int64_t view_id = kImplicitViewId;
FlutterWindowMetricsEvent event = {};
memset(&event, 0, sizeof(FlutterWindowMetricsEvent));
event.struct_size = sizeof(event);
event.width = width * g_pixelRatio;
event.height = height * g_pixelRatio;
event.pixel_ratio = g_pixelRatio;
event.view_id = view_id;
// This example only supports a single window, therefore we assume the event
// occurred in the only view, the implicit view.
event.view_id = kImplicitViewId;
FlutterEngineSendWindowMetricsEvent(
reinterpret_cast<FlutterEngine>(glfwGetWindowUserPointer(window)),
&event);
Expand Down
7 changes: 3 additions & 4 deletions examples/glfw_drm/FlutterEmbedderGLFW.cc
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,15 @@ static void GLFWKeyCallback(GLFWwindow* window,
}

void GLFWwindowSizeCallback(GLFWwindow* window, int width, int height) {
// TODO(dkwingsmt): The GLFW embedder doesn't support multi-view for now. Use
// the real view ID when it does.
int64_t view_id = kImplicitViewId;
FlutterWindowMetricsEvent event = {};
memset(&event, 0, sizeof(FlutterWindowMetricsEvent));
event.struct_size = sizeof(event);
event.width = width * g_pixelRatio;
event.height = height * g_pixelRatio;
event.pixel_ratio = g_pixelRatio;
event.view_id = view_id;
// This example only supports a single window, therefore we assume the event
// occurred in the only view, the implicit view.
event.view_id = kImplicitViewId;
FlutterEngineSendWindowMetricsEvent(
reinterpret_cast<FlutterEngine>(glfwGetWindowUserPointer(window)),
&event);
Expand Down