You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
include the library (<X11/extensions/Xfixes.h>) in the mlx_mouse.c
add the functions XFixesHideCursor(xvar->display, win->window); and XFixesShowCursor(xvar->display, win->window); in the corresponding minilibx functions.
compile your project with the flag -lXfixes
Be advised the cursor will disappear even outside the program until it is closed.
the mlx_mouse.c should look like this :
#include "mlx_int.h"
#include <X11/extensions/Xfixes.h>
int mlx_mouse_move(t_xvar *xvar, t_win_list *win, int x, int y)
{
XWarpPointer(xvar->display, None, win->window, 0, 0, 0, 0, x, y);
return (0);
}
int mlx_mouse_hide(t_xvar *xvar, t_win_list *win)
{
XFixesHideCursor(xvar->display, win->window);
}
int mlx_mouse_show(t_xvar *xvar, t_win_list *win)
{
XFixesShowCursor(xvar->display, win->window);
}
....
It seems that mlx_mouse_hide allocates memory but has no function to free it.
The text was updated successfully, but these errors were encountered: