[virt-tools-list] [PATCH virt-viewer 1/2] Emit one show-hint notification when enabling a display
Fabiano Fidêncio
fabiano at fidencio.org
Wed Apr 8 22:09:48 UTC 2015
On Wed, Apr 8, 2015 at 11:41 PM, Jonathon Jongsma <jjongsma at redhat.com> wrote:
> Freeze notifications before setting the show hints to prevent multiple
> notification signals from being emitted.
> ---
> src/virt-viewer-display.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/virt-viewer-display.c b/src/virt-viewer-display.c
> index 66429f1..2b30567 100644
> --- a/src/virt-viewer-display.c
> +++ b/src/virt-viewer-display.c
> @@ -686,9 +686,12 @@ void virt_viewer_display_set_enabled(VirtViewerDisplay *self, gboolean enabled)
> {
> g_return_if_fail(VIRT_VIEWER_IS_DISPLAY(self));
>
> - virt_viewer_display_set_show_hint(self, VIRT_VIEWER_DISPLAY_SHOW_HINT_SET, TRUE);
> + g_object_freeze_notify(G_OBJECT(self));
>
> + virt_viewer_display_set_show_hint(self, VIRT_VIEWER_DISPLAY_SHOW_HINT_SET, TRUE);
> virt_viewer_display_set_show_hint(self, VIRT_VIEWER_DISPLAY_SHOW_HINT_DISABLED, !enabled);
> +
> + g_object_thaw_notify(G_OBJECT(self));
> }
>
> gboolean virt_viewer_display_get_enabled(VirtViewerDisplay *self)
> --
> 2.1.0
>
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
ACK!
Thanks a lot for these 2 clean ups.
--
Fabiano Fidêncio
More information about the virt-tools-list
mailing list