[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Linphone-developers] patch: Fix Xlib accessor race condition with g
From: |
Reginald Kennedy |
Subject: |
Re: [Linphone-developers] patch: Fix Xlib accessor race condition with gtk >= 2.18 |
Date: |
Tue, 17 Oct 2017 10:33:19 +0800 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
This fix is still needed on 3.12.0
On Fri, Aug 11, 2017 at 02:58:53PM +0800, Reginald Kennedy wrote:
> When the video window is created in a video call, sometimes the window
> is completely black and the following X11 error appears in the debug
> log:
>
> [error ] 2017-08-10 13:59:28:998 X11 error reported.
>
> I have experienced this issue for years and thought it was some bug in
> the X.org Intel video drivers (seemed to work fine on systems with other
> drivers). It usually works after reconnecting the call a few times.
>
> When debugging the X11 error, I found a race condition.
>
> In gtk/videowindow.c, get_native_handle() sometimes returns a window id
> of 0 causing linphone_core_set_native_video_window_id() to bail. This is
> because the underlying Xlib calls are made in a separate thread and
> the window id may not yet exist when GDK_WINDOW_XID() is called.
> ( See
> https://developer.gnome.org/gtk2/stable/gtk-migrating-ClientSideWindows.html )
>
> To resolve this race condition, gdk_display_sync() can be called to
> ensure any pending Xlib calls are made prior to calling GDK_WINDOW_XID().
>
> Bugfix attached.
> commit 2448112f318e3f7801c1354d54ef98c1588e0c06
> Author: Reginald Kennedy <address@hidden>
> Date: Fri Aug 11 12:07:09 2017 +0800
>
> Fix Xlib accessor race condition with gtk >= 2.18
> see
> https://developer.gnome.org/gtk2/stable/gtk-migrating-ClientSideWindows.html
>
> diff --git a/gtk/videowindow.c b/gtk/videowindow.c
> index f7077041b..a2795f05c 100644
> --- a/gtk/videowindow.c
> +++ b/gtk/videowindow.c
> @@ -103,6 +103,9 @@ static gboolean drag_drop(GtkWidget *widget,
> GdkDragContext *drag_context, gint
>
> static void *get_native_handle(GdkWindow *gdkw){
> #ifdef GDK_WINDOWING_X11
> +#if GTK_CHECK_VERSION(2,18,0)
> + gdk_display_sync(gdk_window_get_display(gdkw));
> +#endif
> return (void *)GDK_WINDOW_XID(gdkw);
> #elif defined(_WIN32)
> return (void *)GDK_WINDOW_HWND(gdkw);
> _______________________________________________
> Linphone-developers mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/linphone-developers
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Linphone-developers] patch: Fix Xlib accessor race condition with gtk >= 2.18,
Reginald Kennedy <=