Skip to content

Commit

Permalink
patch 9.0.0597: cannot close a tab page with the middle mouse button
Browse files Browse the repository at this point in the history
Problem:    Cannot close a tab page with the middle mouse button.
Solution:   Support closing a tab page with the middle mouse button, like many
            other programs. (closes #10746)
  • Loading branch information
regomne authored and brammool committed Sep 26, 2022
1 parent 7381c0c commit 3bdef10
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/gui_gtk_x11.c
Expand Up @@ -3345,6 +3345,12 @@ on_tabline_menu(GtkWidget *widget, GdkEvent *event)
send_tabline_event(x < 50 ? -1 : 0);
}
}
else if (bevent->button == 2)
{
if (clicked_page != 0)
// Middle mouse click on tabpage label closes that tab.
send_tabline_menu_event(clicked_page, TABLINE_MENU_CLOSE);
}
}

// We didn't handle the event.
Expand Down
14 changes: 14 additions & 0 deletions src/gui_w32.c
Expand Up @@ -8094,6 +8094,20 @@ tabline_wndproc(
}
break;
}
case WM_MBUTTONUP:
{
TCHITTESTINFO htinfo;

htinfo.pt.x = GET_X_LPARAM(lParam);
htinfo.pt.y = GET_Y_LPARAM(lParam);
idx0 = TabCtrl_HitTest(hwnd, &htinfo);
if (idx0 != -1)
{
idx0 += 1;
send_tabline_menu_event(idx0, TABLINE_MENU_CLOSE);
}
break;
}
default:
break;
}
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -699,6 +699,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
597,
/**/
596,
/**/
Expand Down

0 comments on commit 3bdef10

Please sign in to comment.