You are not logged in.
I often open multiple windows, but do not use the grouping of windows, because it's inconvenient for me. To close multiple windows, I have to right click on each window and look out there "Close".
Many browsers (firefox, chrome) use the middle mouse button for closing tabs. It is very convenient and can be used to close the windows. However, xfce does not provide this features and I decided to add it.
I found in tasklist-widget.c this part of code:
static gboolean
xfce_tasklist_button_button_press_event (GtkWidget *button,
GdkEventButton *event,
XfceTasklistChild *child)
{
GtkWidget *menu, *panel_plugin;
panel_return_val_if_fail (XFCE_IS_TASKLIST (child->tasklist), FALSE);
panel_return_val_if_fail (child->type != CHILD_TYPE_GROUP, FALSE);
if (event->type != GDK_BUTTON_PRESS
|| xfce_taskbar_is_locked (child->tasklist))
return FALSE;
/* send the event to the panel plugin if control is pressed */
if (PANEL_HAS_FLAG (event->state, GDK_CONTROL_MASK))
{
/* send the event to the panel plugin */
panel_plugin = xfce_tasklist_get_panel_plugin (child->tasklist);
if (G_LIKELY (panel_plugin != NULL))
gtk_widget_event (panel_plugin, (GdkEvent *) event);
return TRUE;
}
if (event->button == 1)
{
xfce_tasklist_button_activate (child, event->time);
return TRUE;
}
else if (event->button == 3)
{
menu = wnck_action_menu_new (child->window);
g_signal_connect (G_OBJECT (menu), "selection-done",
G_CALLBACK (gtk_widget_destroy), NULL);
gtk_menu_attach_to_widget (GTK_MENU (menu), button, NULL);
gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
xfce_panel_plugin_position_menu,
xfce_tasklist_get_panel_plugin (child->tasklist),
event->button,
event->time);
return TRUE;
}
return FALSE;
}
This part handles clicking on the taskbar. This code i replaced on this:
static gboolean
xfce_tasklist_button_button_press_event (GtkWidget *button,
GdkEventButton *event,
XfceTasklistChild *child)
{
GtkWidget *menu, *panel_plugin;
panel_return_val_if_fail (XFCE_IS_TASKLIST (child->tasklist), FALSE);
panel_return_val_if_fail (child->type != CHILD_TYPE_GROUP, FALSE);
if (event->type != GDK_BUTTON_PRESS
|| xfce_taskbar_is_locked (child->tasklist))
return FALSE;
/* send the event to the panel plugin if control is pressed */
if (PANEL_HAS_FLAG (event->state, GDK_CONTROL_MASK))
{
/* send the event to the panel plugin */
panel_plugin = xfce_tasklist_get_panel_plugin (child->tasklist);
if (G_LIKELY (panel_plugin != NULL))
gtk_widget_event (panel_plugin, (GdkEvent *) event);
return TRUE;
}
if (event->button == 1)
{
xfce_tasklist_button_activate (child, event->time);
return TRUE;
}
else if (event->button == 2)
{
wnck_window_close (child->window, gtk_get_current_event_time ());
return TRUE;
}
else if (event->button == 3)
{
menu = wnck_action_menu_new (child->window);
g_signal_connect (G_OBJECT (menu), "selection-done",
G_CALLBACK (gtk_widget_destroy), NULL);
gtk_menu_attach_to_widget (GTK_MENU (menu), button, NULL);
gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
xfce_panel_plugin_position_menu,
xfce_tasklist_get_panel_plugin (child->tasklist),
event->button,
event->time);
return TRUE;
}
return FALSE;
}
re-compile tasklist-plugin and enjoy:)
I hope to see this feature in next XFCE releases.
Offline
Thank you!
Offline
RPG thanks! Please file a bug, and post the bug number here. This is a small feature that should be implemented!
Offline
Offline
Thank you so very much!
I have been thinking the exact same thing for the last couple weeks,
but never got around opening a feature request.
Offline
I'm very glad to see usefull and complete patch about it here: https://bugzilla.xfce.org/show_bug.cgi?id=8096
Hope this feature will be included in new releases.
Offline
Spamming this at the end of all the threads about this, since anyone looking for this only cares about this info (now it's been patched - thanks guys!):
Right click on Panel > Panel preferences > Items > Window Buttons > Settings > Behaviour : Middle Click Action
Offline
[ Generated in 0.011 seconds, 7 queries executed - Memory usage: 546.88 KiB (Peak: 547.73 KiB) ]