Skip to content

Commit 4fc217b

Browse files
committed
Refine contextmenu desktop handling.
1 parent 5fd53fb commit 4fc217b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

plugins/gui/lvgl_static/src/drivers/sdl/lv_sdl_mouse.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ void lv_sdl_mouse_handler(SDL_Event * event)
164164
if(event->button.button == SDL_BUTTON_LEFT)
165165
indev_dev->left_button_down = false;
166166
if(event->button.button == SDL_BUTTON_RIGHT)
167-
indev_dev->right_button_down = false;
167+
indev_dev->right_button_down = false;
168168
break;
169169
case SDL_WINDOWEVENT_LEAVE:
170170
indev_dev->left_button_down = false;

plugins/gui/lvgl_static/src/indev/lv_indev.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -1193,6 +1193,10 @@ static void indev_proc_press(lv_indev_t * indev, lv_indev_data_t* data)
11931193
indev_obj_act = pointer_search_obj(disp, &indev->pointer.act_point);
11941194
new_obj_searched = true;
11951195
}
1196+
if (data && data->btn_id == 2) {
1197+
send_event(LV_EVENT_RIGHT, indev_act);
1198+
return;
1199+
}
11961200
/*If there is an active object it's not scrolled and not press locked also search*/
11971201
else if(indev->pointer.scroll_obj == NULL &&
11981202
lv_obj_has_flag(indev_obj_act, LV_OBJ_FLAG_PRESS_LOCK) == false) {
@@ -1309,11 +1313,7 @@ static void indev_proc_press(lv_indev_t * indev, lv_indev_data_t* data)
13091313
}
13101314

13111315
if(is_enabled) {
1312-
if (data && data->btn_id == 2) {
1313-
if(send_event(LV_EVENT_RIGHT, indev_act) == LV_RESULT_INVALID) return;
1314-
} else {
1315-
if(send_event(LV_EVENT_PRESSING, indev_act) == LV_RESULT_INVALID) return;
1316-
}
1316+
if(send_event(LV_EVENT_PRESSING, indev_act) == LV_RESULT_INVALID) return;
13171317
}
13181318

13191319

0 commit comments

Comments
 (0)