Closed mneumann closed 10 months ago
Can you link to a repo that can repro this issue by any chance?
@crertel it really is just the basic app created by mix scenic.new
.
I figured out a solution, which I will post as PR to scenic_driver_local
in a few minutes.
Xfce4
under X11. Everything works (cursor focus + window repaint).What fixed the problem is the following (in c_src/device/glfw.c
):
void refresh_window(GLFWwindow* window)
{
int window_width, window_height;
glfwGetWindowSize(window, &window_width, &window_height);
reshape_window(window, window_width, window_height);
}
void focus_window(GLFWwindow* window, int focused)
{
if (focused == GLFW_TRUE) {
glfwSetCursor(window, g_glfw_data.p_cursor);
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
}
}
// in device_init
// If I don't explicitly set a standard cursor, the `glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);` call will change the cursor to an "x".
g_glfw_data.p_cursor = glfwCreateStandardCursor(GLFW_ARROW_CURSOR);
// in setup_window
glfwSetWindowRefreshCallback(window, refresh_window);
glfwSetWindowFocusCallback(window, focus_window);
Checklist
Versions and Environment
Elixir:
Erlang:
Scenic:
OS:
Steps to reproduce
I am creating a
mix scenic.new foobar
app. Thenmix run.scenic
. The GLFW window appears. The window is 800x600. Initially, the mouse cursor appears over the window. If I move the window out of the window and back into the window, the mouse cursor is no longer visible. If I now move the window, the mouse cursor appears again.I am using Wayland and hikari composer.
Expected Behavior
As with any other application, if I move the mouse into the window again, the mouse cursor is visible.
Actual Behavior
The mouse cursor is invisible unless I move the window again.
Additional Comments
I will try X11 and another Wayland composer just to be sure this is not an issue with Scenic itself.