• Jan Djärv's avatar
    Stop cursor blink after blink-cursor-blinks (10), stop timers when not blinking. · 18c26d81
    Jan Djärv authored
    * etc/NEWS: Document blink-cursor-blinks and blink timers stopped.
    
    * lisp/frame.el (blink-cursor-blinks): New defcustom.
    (blink-cursor-blinks-done): New defvar.
    (blink-cursor-start): Set blink-cursor-blinks-done to 1.
    (blink-cursor-timer-function): Check if number of blinks has been
    done on X and NS.
    (blink-cursor-suspend, blink-cursor-check): New defuns.
    
    * src/frame.c (Fhandle_focus_in, Fhandle_focus_out): New functions.
    (Fhandle_switch_frame): Call Fhandle_focus_in.
    (syms_of_frame): defsubr handle-focus-in/out.
    
    * src/keyboard.c (Qfocus_in, Qfocus_out): New static objects.
    (make_lispy_focus_in, make_lispy_focus_out): Declare and define.
    (kbd_buffer_get_event): For FOCUS_IN, make a focus_in event if no
    switch frame event is made.  Check ! NILP (event->arg) if X11 (moved
    from xterm.c). Make focus_out event for FOCUS_OUT_EVENT if NS or X11
    and there is a focused frame.
    (head_table): Add focus-in and focus-out.
    (keys_of_keyboard): Add focus-in and focus-out to Vspecial_event_map,
    bind to handle-focus-in/out.
    
    * src/nsterm.m (windowDidResignKey): If this is the focused frame, generate
    FOCUS_OUT_EVENT.
    
    * src/termhooks.h (enum event_kind): Add FOCUS_OUT_EVENT.
    
    * src/xterm.c (x_focus_changed): Always generate FOCUS_IN_EVENT.
    Set event->arg to Qt if switch-event shall be generated.
    Generate FOCUS_OUT_EVENT for FocusOut if this is the focused frame.
    18c26d81
ChangeLog 116 KB