diff --git a/linux_4ed.cpp b/linux_4ed.cpp index cdbd2e6e..39443cb8 100644 --- a/linux_4ed.cpp +++ b/linux_4ed.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -103,6 +104,8 @@ struct Linux_Vars{ Atom atom_CLIPBOARD; Atom atom_UTF8_STRING; + Application_Mouse_Cursor cursor; + void *app_code; void *custom; @@ -1553,6 +1556,14 @@ main(int argc, char **argv) exit(1); } + Cursor xcursors[APP_MOUSE_CURSOR_COUNT] = { + None, + XCreateFontCursor(linuxvars.XDisplay, XC_arrow), + XCreateFontCursor(linuxvars.XDisplay, XC_xterm), + XCreateFontCursor(linuxvars.XDisplay, XC_sb_h_double_arrow), + XCreateFontCursor(linuxvars.XDisplay, XC_sb_v_double_arrow) + }; + XSetICFocus(linuxvars.input_context); linuxvars.atom_CLIPBOARD = XInternAtom(linuxvars.XDisplay, "CLIPBOARD", False); @@ -1843,6 +1854,12 @@ main(int argc, char **argv) usleep(frame_useconds - time_diff); } + if(result.mouse_cursor_type != linuxvars.cursor){ + Cursor c = xcursors[result.mouse_cursor_type]; + XDefineCursor(linuxvars.XDisplay, linuxvars.XWindow, c); + linuxvars.cursor = result.mouse_cursor_type; + } + linuxvars.redraw = 0; linuxvars.key_data = {}; linuxvars.mouse_data.left_button_pressed = 0;