Index: src_plugins/lib_gtk_common/wt_layersel.c =================================================================== --- src_plugins/lib_gtk_common/wt_layersel.c (revision 8693) +++ src_plugins/lib_gtk_common/wt_layersel.c (revision 8694) @@ -218,6 +218,20 @@ return TRUE; } +static void layer_popup(int button, pcb_layer_id_t lid, pcb_layer_group_t *g) +{ + if (button != 3) + return; + if (lid < 0) { + if (g != NULL) { + pcb_actd_EditGroup_gid = pcb_layergrp_id(PCB, g); + pcb_hid_actionl("Popup", "group", NULL); + } + } + else + pcb_hid_actionl("Popup", "layer", NULL); +} + static gboolean layer_vis_press_cb(GtkWidget *widget, GdkEvent *event, pcb_gtk_ls_lyr_t *lsl) { pcb_gtk_layersel_t *ls = lsl->lsg->ls; @@ -248,8 +262,7 @@ } ls->com->invalidate_all(); - if ((event->button.button == 3) && (lsl->lid >= 0)) - pcb_hid_actionl("Popup", "layer", NULL); + layer_popup(event->button.button, lsl->lid, lsl->lsg->grp); break; } ls->running = 0; @@ -271,8 +284,7 @@ ls->com->invalidate_all(); pcb_gtk_layersel_vis_update(ls); /* need to do a full redraw because of side effects of special layer selections (e.g. Rats') */ } - if ((event->button.button == 3) && (lsl->lid >= 0)) - pcb_hid_actionl("Popup", "layer", NULL); + layer_popup(event->button.button, lsl->lid, lsl->lsg->grp); break; } ls->running = 0;