@@ -79,7 +79,8 @@ void mb_shell::menu_item_normal_widget::render(ui::nanovg_context ctx) {
7979 }
8080
8181 auto paintY = floor (*y + (*height - icon_width) / 2 );
82- auto paintX = *x + padding + width->dest () - right_icon_padding - icon_width;
82+ auto paintX =
83+ *x + padding + width->dest () - right_icon_padding - icon_width;
8384 auto paint2 = ctx.imagePattern (paintX, paintY, icon_width, icon_width, 0 ,
8485 icon_unfold_img->id , *opacity / 255 .f );
8586 ctx.beginPath ();
@@ -367,6 +368,15 @@ void mb_shell::menu_item_normal_widget::reset_appear_animation(float delay) {
367368
368369 this ->x ->animate_to (0 );
369370}
371+
372+ BOOL IsCursorVisible () {
373+ CURSORINFO ci = {sizeof (CURSORINFO)};
374+ if (GetCursorInfo (&ci)) {
375+ return (ci.flags & CURSOR_SHOWING) != 0 ;
376+ }
377+ return FALSE ;
378+ }
379+
370380mb_shell::mouse_menu_widget_main::mouse_menu_widget_main (menu menu_data,
371381 float x, float y)
372382 : widget(), anchor_x(x), anchor_y(y) {
@@ -392,8 +402,12 @@ void mb_shell::mouse_menu_widget_main::update(ui::update_context &ctx) {
392402 }
393403 menu_wid->update (ctx);
394404
405+ auto using_touchscreen = !IsCursorVisible ();
406+
395407 if (ctx.hovered_widgets ->empty ()) {
396- glfwSetWindowAttrib (ctx.rt .window , GLFW_MOUSE_PASSTHROUGH, GLFW_TRUE);
408+ glfwSetWindowAttrib (ctx.rt .window , GLFW_MOUSE_PASSTHROUGH,
409+ using_touchscreen ? GLFW_FALSE : GLFW_TRUE);
410+
397411 if ((ctx.mouse_clicked || ctx.right_mouse_clicked ) ||
398412 GetAsyncKeyState (VK_LBUTTON) & 0x8000 ||
399413 GetAsyncKeyState (VK_RBUTTON) & 0x8000 ) {
@@ -766,7 +780,7 @@ void mb_shell::menu_item_ownerdraw_widget::update(ui::update_context &ctx) {
766780void mb_shell::menu_item_ownerdraw_widget::render (ui::nanovg_context ctx) {
767781 if (!img)
768782 img = ui::LoadBitmapImage (ctx, owner_draw.bitmap );
769-
783+
770784 auto paint = ctx.imagePattern (*x, y->dest (), owner_draw.width ,
771785 owner_draw.height , 0 , img->id , 1 );
772786
0 commit comments