@@ -265,19 +265,21 @@ void handle_key(KeySym keysym, unsigned int modifiers) {
265
265
break ;
266
266
267
267
case KEY_TOGGLE_CURSOR :
268
- if (cursor_visible ) {
268
+ if (options . cursor_visible ) {
269
269
hide_cursor ();
270
270
} else {
271
271
show_cursor ();
272
272
}
273
+ options .cursor_visible = 1 - options .cursor_visible ;
273
274
break ;
274
275
275
276
case KEY_TOGGLE_HIGHLIGHT :
276
- if (highlight_visible ) {
277
+ if (options . highlight_visible ) {
277
278
hide_highlight ();
278
279
} else {
279
280
show_highlight ();
280
281
}
282
+ options .highlight_visible = 1 - options .highlight_visible ;
281
283
break ;
282
284
283
285
case KEY_TOGGLE_AUTOHIDE_CURSOR :
@@ -339,10 +341,10 @@ void main_loop() {
339
341
XFreeEventData (dpy , cookie );
340
342
#endif
341
343
if (cookie -> evtype == XI_RawMotion ) {
342
- if (options .auto_hide_cursor && !cursor_visible ) {
344
+ if (options .auto_hide_cursor && options . cursor_visible && !cursor_visible ) {
343
345
show_cursor ();
344
346
}
345
- if (options .auto_hide_highlight && !highlight_visible ) {
347
+ if (options .auto_hide_highlight && options . highlight_visible && !highlight_visible ) {
346
348
show_highlight ();
347
349
} else if (highlight_visible ) {
348
350
get_pointer_position (& x , & y );
@@ -530,6 +532,9 @@ static struct option long_options[] = {{"auto-hide-cursor", no_argument, &option
530
532
{NULL , 0 , NULL , 0 }};
531
533
532
534
int set_options (int argc , char * argv []) {
535
+ options .auto_hide_cursor = 0 ;
536
+ options .auto_hide_highlight = 0 ;
537
+ options .cursor_visible = 0 ;
533
538
options .highlight_visible = 1 ;
534
539
options .radius = 5 ;
535
540
options .outline = 0 ;
0 commit comments