Skip to content

fix(indev): fix hovering disabled obj resets indev - #6855

Merged
kisvegabor merged 1 commit into
lvgl:masterfrom
niklasf:fix/hover-disabled
Sep 26, 2024
Merged

kisvegabor merged 1 commit into
lvgl:masterfrom
niklasf:fix/hover-disabled

Conversation

@niklasf

@niklasf niklasf commented Sep 14, 2024

Copy link
Copy Markdown
Contributor

d11171d introduced a check to reset input devices when an element is disabled. However, this also triggers when changing the state of an element that is already disabled. Fix that.

To reproduce, try scrolling in my current favorite example:

static void demo()
{
    lv_obj_t * screen = lv_obj_create(NULL);
    lv_obj_set_size(screen, 512, 600);
    lv_obj_set_flex_flow(screen, LV_FLEX_FLOW_COLUMN);

    for(int i = 0; i < 150; i++) {
        lv_obj_t * btn = lv_btn_create(screen);
        lv_obj_set_size(btn, lv_pct(100), LV_SIZE_CONTENT);

        if(i > 75) {
            lv_obj_add_state(btn, LV_STATE_DISABLED);
        }
    }

    lv_screen_load(screen);
}

Note how scroll momentum is frequently interrupted when scrolling the lower half with the disabled buttons.

@niklasf niklasf changed the title fix(index): fix hovering disabled obj resets indev fix(indev): fix hovering disabled obj resets indev Sep 14, 2024
@kisvegabor

Copy link
Copy Markdown
Member

Great catch! Thank you!

@kisvegabor
kisvegabor merged commit 535b8aa into lvgl:master Sep 26, 2024
kisvegabor pushed a commit to kisvegabor/lvgl_fork that referenced this pull request Sep 26, 2024
kisvegabor pushed a commit to kisvegabor/lvgl_fork that referenced this pull request Oct 1, 2024
@niklasf
niklasf deleted the fix/hover-disabled branch October 4, 2024 15:35
rodb70 pushed a commit to rodb70/lvgl that referenced this pull request Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants