mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 08:38:20 +00:00
[client] wayland: do not leak cursor wl_buffer and wl_surface
This commit is contained in:
parent
a380803d37
commit
30c3b399f2
@ -82,17 +82,25 @@ bool waylandCursorInit(void)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct wl_buffer * cursorBuffer = createCursorBuffer();
|
wlWm.cursorBuffer = createCursorBuffer();
|
||||||
if (cursorBuffer)
|
if (wlWm.cursorBuffer)
|
||||||
{
|
{
|
||||||
wlWm.cursor = wl_compositor_create_surface(wlWm.compositor);
|
wlWm.cursor = wl_compositor_create_surface(wlWm.compositor);
|
||||||
wl_surface_attach(wlWm.cursor, cursorBuffer, 0, 0);
|
wl_surface_attach(wlWm.cursor, wlWm.cursorBuffer, 0, 0);
|
||||||
wl_surface_commit(wlWm.cursor);
|
wl_surface_commit(wlWm.cursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void waylandCursorFree(void)
|
||||||
|
{
|
||||||
|
if (wlWm.cursor)
|
||||||
|
wl_surface_destroy(wlWm.cursor);
|
||||||
|
if (wlWm.cursorBuffer)
|
||||||
|
wl_buffer_destroy(wlWm.cursorBuffer);
|
||||||
|
}
|
||||||
|
|
||||||
void waylandShowPointer(bool show)
|
void waylandShowPointer(bool show)
|
||||||
{
|
{
|
||||||
wlWm.showPointer = show;
|
wlWm.showPointer = show;
|
||||||
|
@ -121,6 +121,7 @@ static void waylandFree(void)
|
|||||||
waylandInputFree();
|
waylandInputFree();
|
||||||
waylandOutputFree();
|
waylandOutputFree();
|
||||||
waylandRegistryFree();
|
waylandRegistryFree();
|
||||||
|
waylandCursorFree();
|
||||||
wl_display_disconnect(wlWm.display);
|
wl_display_disconnect(wlWm.display);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,6 +110,7 @@ struct WaylandDSState
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct wl_surface * cursor;
|
struct wl_surface * cursor;
|
||||||
|
struct wl_buffer * cursorBuffer;
|
||||||
|
|
||||||
struct wl_data_device_manager * dataDeviceManager;
|
struct wl_data_device_manager * dataDeviceManager;
|
||||||
|
|
||||||
@ -188,6 +189,7 @@ void waylandCBRelease(void);
|
|||||||
|
|
||||||
// cursor module
|
// cursor module
|
||||||
bool waylandCursorInit(void);
|
bool waylandCursorInit(void);
|
||||||
|
void waylandCursorFree(void);
|
||||||
void waylandShowPointer(bool show);
|
void waylandShowPointer(bool show);
|
||||||
|
|
||||||
// gl module
|
// gl module
|
||||||
|
Loading…
Reference in New Issue
Block a user