Activate tab before closing on middle click

Also fix compilation on macOS
This commit is contained in:
Kovid Goyal 2021-10-25 07:50:05 +05:30
parent 32ad75c5ab
commit 13b900faf7
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 1 deletions

View File

@ -1425,11 +1425,12 @@ dbus_send_notification(PyObject *self UNUSED, PyObject *args) {
return PyLong_FromUnsignedLongLong(notification_id);
}
#endif
static PyObject*
get_click_interval(PyObject *self UNUSED, PyObject *args UNUSED) {
return PyFloat_FromDouble(monotonic_t_to_s_double(OPT(click_interval)));
}
#endif
id_type
add_main_loop_timer(monotonic_t interval, bool repeats, timer_callback_fun callback, void *callback_data, timer_callback_fun free_callback) {

View File

@ -999,6 +999,7 @@ class TabManager: # {{{
self.set_active_tab_idx(i)
elif button == GLFW_MOUSE_BUTTON_MIDDLE:
tab = self.tabs[i]
self.set_active_tab(tab)
get_boss().close_tab(tab)
self.recent_mouse_events.append(TabMouseEvent(button, modifiers, action, now, i))
if len(self.recent_mouse_events) > 5: