Index: trunk/src/layer.c =================================================================== --- trunk/src/layer.c (revision 28281) +++ trunk/src/layer.c (revision 28282) @@ -535,7 +535,7 @@ Layer->name = Name; if (!Layer->is_bound) { assert((Layer->parent_type == PCB_PARENT_DATA) && (Layer->parent.data->parent_type == PCB_PARENT_BOARD)); - pcb_event(&Layer->parent.data->parent.board->hidlib, PCB_EVENT_LAYERS_CHANGED, NULL); + pcb_layergrp_notify_chg(Layer->parent.data->parent.board); } return 0; } @@ -552,7 +552,7 @@ Layer->meta.real.color = *color; if (!Layer->is_bound) { assert((Layer->parent_type == PCB_PARENT_DATA) && (Layer->parent.data->parent_type == PCB_PARENT_BOARD)); - pcb_event(&Layer->parent.data->parent.board->hidlib, PCB_EVENT_LAYERS_CHANGED, NULL); + pcb_layergrp_notify_chg(Layer->parent.data->parent.board); } return 0; } @@ -696,7 +696,7 @@ grp_idx = 0; g->lid[grp_idx] = new_lid; g->len++; - pcb_event(&pcb->hidlib, PCB_EVENT_LAYERS_CHANGED, NULL); + pcb_layergrp_notify_chg(pcb); pcb_layervis_change_group_vis(&pcb->hidlib, new_lid, 1, 1); pcb_event(&pcb->hidlib, PCB_EVENT_LAYERVIS_CHANGED, NULL); at = new_lid; @@ -746,7 +746,7 @@ if (pcb_layer_stack[l] > old_index) pcb_layer_stack[l]--; - pcb_event(&pcb->hidlib, PCB_EVENT_LAYERS_CHANGED, NULL); + pcb_layergrp_notify_chg(pcb); } else { pcb_message(PCB_MSG_ERROR, "Logical layer move is not supported any more. This function should have not been called. Please report this error.\n"); Index: trunk/src/layer_grp.c =================================================================== --- trunk/src/layer_grp.c (revision 28281) +++ trunk/src/layer_grp.c (revision 28282) @@ -50,6 +50,11 @@ } \ } while(0) +void pcb_layergrp_notify_chg(pcb_board_t *pcb) +{ + NOTIFY(pcb); +} + void pcb_layergrp_inhibit_inc(void) { inhibit_notify++; Index: trunk/src/layer_grp.h =================================================================== --- trunk/src/layer_grp.h (revision 28281) +++ trunk/src/layer_grp.h (revision 28282) @@ -160,6 +160,10 @@ void pcb_layergrp_inhibit_inc(void); void pcb_layergrp_inhibit_dec(void); +/* send out a layers changed notification, respecting the inhibit flag */ +void pcb_layergrp_notify_chg(pcb_board_t *pcb); + + /* Send out a layer changed event if not inhibited */ void pcb_layergrp_notify(pcb_board_t *pcb);