Example #1
0
void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor)
{
    if (cursor && cursor->mir.conf)
    {
        mir_wait_for(mir_surface_configure_cursor(window->mir.surface, cursor->mir.conf));
        if (cursor->mir.custom_cursor)
        {
            /* FIXME Bug https://bugs.launchpad.net/mir/+bug/1477285
                     Requires a triple buffer swap to get the cursor buffer on top! (since mir is tripled buffered)
            */
            mir_buffer_stream_swap_buffers_sync(cursor->mir.custom_cursor);
            mir_buffer_stream_swap_buffers_sync(cursor->mir.custom_cursor);
            mir_buffer_stream_swap_buffers_sync(cursor->mir.custom_cursor);
        }
    }
    else
    {
        mir_wait_for(mir_surface_configure_cursor(window->mir.surface, _glfw.mir.default_conf));
    }
}
    void SetUp() override
    {
        mtf::ConnectedClientWithASurface::SetUp();

        // Need fullscreen for the cursor events
        auto const spec = mir_connection_create_spec_for_changes(connection);
        mir_surface_spec_set_fullscreen_on_output(spec, 1);
        mir_surface_apply_spec(surface, spec);
        mir_surface_spec_release(spec);

        mir_surface_set_event_handler(surface, &cookie_capturing_callback, this);
        mir_buffer_stream_swap_buffers_sync(mir_surface_get_buffer_stream(surface));
    }
Example #3
0
void _glfwPlatformSetCursor(_GLFWwindow* window, _GLFWcursor* cursor)
{
    if (cursor && cursor->mir.conf)
    {
        window->mir.currentCursor = cursor;

        mir_wait_for(mir_surface_configure_cursor(window->mir.surface, cursor->mir.conf));
        if (cursor->mir.customCursor)
        {
            mir_buffer_stream_swap_buffers_sync(cursor->mir.customCursor);
        }
    }
    else
    {
        mir_wait_for(mir_surface_configure_cursor(window->mir.surface, _glfw.mir.defaultConf));
    }
}