diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-06-01 21:33:51 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-06-01 21:33:51 (GMT) |
commit | f0fa987133468d7d3cae7894d813b852782bf895 (patch) | |
tree | 51b78b6f2751c8aa0c82cf6265e0f6a87eadfae5 /src/gui/panels/panel.c | |
parent | e060d9a9f29c0d7708e7002c2e1fc4962020ba94 (diff) |
Setup more control when updating panels.
Diffstat (limited to 'src/gui/panels/panel.c')
-rw-r--r-- | src/gui/panels/panel.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/gui/panels/panel.c b/src/gui/panels/panel.c index dcb3d3f..424e779 100644 --- a/src/gui/panels/panel.c +++ b/src/gui/panels/panel.c @@ -144,6 +144,8 @@ static void g_panel_item_init(GPanelItem *item) item->personality = PIP_INVALID; + g_atomic_int_set(&item->switched, 0); + } @@ -675,6 +677,29 @@ void g_panel_item_undock(GPanelItem *item) /****************************************************************************** * * +* Paramètres : item = panneau ciblé par une mise à jour. * +* * +* Description : Obtient le groupe de travail dédié à une mise à jour. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +wgroup_id_t g_panel_item_get_group(const GPanelItem *item) +{ + wgroup_id_t result; /* Identifiant à retourner */ + + result = G_PANEL_ITEM_GET_CLASS(item)->gid; + + return result; + +} + + +/****************************************************************************** +* * * Paramètres : widget = composant graphique sur lequel dessiner. * * cr = contexte graphique pour le dessin. * * panel = panneau ciblé par une mise à jour. * @@ -733,6 +758,9 @@ void g_panel_item_switch_to_updating_mask(GPanelItem *item) GtkStack *stack; /* Pile de composants GTK */ GtkWidget *mask; /* Masque des travaux */ + if (g_atomic_int_add(&item->switched, 1) > 0) + return; + /* Copie de l'affichage courant */ assert(item->surface == NULL); @@ -805,6 +833,9 @@ void g_panel_item_switch_to_updated_content(GPanelItem *item) GtkStack *stack; /* Pile de composants GTK */ GtkWidget *mask; /* Masque des travaux */ + if (g_atomic_int_get(&item->switched) > 1) + goto skip; + /* Restauration d'une éventuelle position */ content = GTK_WIDGET(gtk_builder_get_object(item->builder, "content")); @@ -839,4 +870,8 @@ void g_panel_item_switch_to_updated_content(GPanelItem *item) item->surface = NULL; } + skip: + + g_atomic_int_dec_and_test(&item->switched); + } |