GNOME Bugzilla – Bug 673664
Evince cannot run with Broadway GDK backend. (Patch included)
Last modified: 2012-04-09 06:42:12 UTC
Created attachment 211508 [details] [review] Fix the GDK backend support. Building from git (specifically commit ea85150), evince does not load when trying to use the Broadway backend. $ GDK_BACKEND=broadway gdb evince ... Program received signal SIGSEGV, Segmentation fault. 0x00007ffff6e70a81 in gdk_x11_atom_to_xatom_for_display (atom=0x82d, display=0x69a010) at gdkproperty-x11.c:240 240 g_return_val_if_fail (ATOM_TO_INDEX (atom) < virtual_atom_array->len, None); ... (gdb) bt
+ Trace 230021
I've attached a patch which fixes the segfault. I've never contributed a patch to a project before, so I'm not sure I'm doing this correctly. I've tried to follow the coding style I observed in the file. I'm also not too familiar with the GDK/GTK API, so I tried to find appropriate API calls, but improvements from a more knowledgeable person would be greatly appreciated.
Review of attachment 211508 [details] [review]: Patch looks good, thank you very much. Just a minor comment. ::: shell/ev-application.c @@ +653,2 @@ #ifdef GDK_WINDOWING_X11 + if (GDK_IS_X11_DISPLAY(display)) { You don't need to get the display to check whether it's a X11 display, you can use the window and check whether it's a X11 window with GDK_IS_X11_WINDOW(). @@ +754,2 @@ #ifdef GDK_WINDOWING_X11 + if (GDK_IS_X11_DISPLAY(display)) { Ditto.
Thanks. I just followed the "Backend-specific code" change guide I found online, but I now see that there are more options than just that one example for detecting the running backend. I've attached an updated patch which addresses this change.
Created attachment 211585 [details] [review] Check GDK runtime backend, now using window class checks
Review of attachment 211585 [details] [review]: ::: shell/ev-application.c @@ +652,3 @@ #ifdef GDK_WINDOWING_X11 + if (GDK_IS_X11_WINDOW (GTK_WINDOW (ev_window))) { + gdk_window = gtk_widget_get_window (GTK_WIDGET (ev_window)); GDK_IS_X11_WINDOW() should be used with a GdkWindow, not a GtkWindow. This should be: gdk_window = gtk_widget_get_window (GTK_WIDGET (ev_window)); if (GDK_IS_X11_WINDOW (gdk_window)) { ..... @@ +752,3 @@ #ifdef GDK_WINDOWING_X11 + if (GDK_IS_X11_WINDOW (GTK_WINDOW (new_window))) { + gdk_window = gtk_widget_get_window (GTK_WIDGET (new_window)); Ditto.
Thank you for your patience. Hopefully I've got everything this time. Updated patch attached.
Created attachment 211600 [details] [review] Check GDK runtime backend; fixed window class checks.
Review of attachment 211600 [details] [review]: Perfect! Thank you very much.