Menu

Mouse behavior UI improvement

mfvianna
2018-01-11
2018-01-11
  • mfvianna

    mfvianna - 2018-01-11

    I've created a small "menu.c" patch (on top of vetsion 0.11.2) that slightly changes the mouse pointer behavior (when enabled):

    1. Initially the mouse pointer is not visible (and rEFInd behaves as if no mouse was enabled);
    2. In case of any mouse event (mouse movement, for example) the mouse pointer becomes instantly visible and can be used normally to make the OS selection;
    3. In case of any keyboard event, except modifyer keys, the mouse pointer hides again and the current selection gets visible (even if was not under the mouse pointer);

    This is mostly about improving mouse pointer visibility and usability, but also helps solving the fact that if the mouse is not moved after rEFInd starts, no OS is highlighted and yet the default one is booted after the timeout, even if it is not below the mouse pointer. With this patch, if the pointer is visible, the OS below it is booted, but this doesn't interefere in the default option since initially the pointer is not visible.

    Hope this gets in the main version as I believe this is a UI improvement.

    **
    *OBS: See an improved version of patch in the next post (I didn't change this one to avoid confusion in case someone has already seen it)
    *
    **
    The patch "menu.c":

    437a438,444
    >     if (PointerEnabled) {
    >         pdUpdateState(); // Consume any pending mouse event to prevent the pointer to show up when starting
    >         DrawSelection = TRUE;
    >         PointerActive = FALSE;
    >         State.PaintSelection = TRUE;
    >     }
    > 
    448c455,460
    <         pdDraw();
    ---
    >         if (PointerActive) {
    >             pdDraw();
    >         } else {
    >             StyleFunc(Screen, &State, MENU_FUNCTION_PAINT_SELECTION, NULL);
    >         }
    
     

    Last edit: mfvianna 2018-01-11
  • mfvianna

    mfvianna - 2018-01-11

    An improved version of the patch (corrects an - almost imperceptible - blink during the count down that was introduced by the previous patch if a timeout is configured). This patch is to be applied on top of the original 0.11.2 "menu.c":

    437a438,444
    >     if (PointerEnabled) {
    >         pdUpdateState(); // Consume any pending mouse event to prevent the pointer to show up when starting
    >         DrawSelection = TRUE;
    >         PointerActive = FALSE;
    >         State.PaintAll = TRUE;
    >     }
    > 
    448c455,457
    <         pdDraw();
    ---
    >         if (PointerActive) {
    >             pdDraw();
    >         }
    605a615
    >             StyleFunc(Screen, &State, MENU_FUNCTION_PAINT_SELECTION, NULL);
    
     

    Last edit: mfvianna 2018-01-11

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.