GNOME Bugzilla – Bug 554407
directfb backend does not implement GdkWindowImpl
Last modified: 2009-02-19 21:48:48 UTC
Please describe the problem: When trying to crosscompile Gtk+ with gdk-target=directfb with following configure string: ./configure --enable-static --prefix=/usr/lib/gtkdfb --host=powerpc-unknown-linux-gnu --with-gdktarget=directfb make fails with error message: gdkwindow-directfb.c: In function `gdk_window_directfb_process_all_updates': gdkwindow-directfb.c:102: warning: unused variable `wimpl' gdkwindow-directfb.c: In function `IA__gdk_window_hide': gdkwindow-directfb.c:1279: warning: implicit declaration of function `_gdk_windowing_window _clear_area' gdkwindow-directfb.c: At top level: gdkwindow-directfb.c:1620: error: conflicting types for '_gdk_windowing_window_clear_area' gdkwindow-directfb.c:1279: error: previous implicit declaration of '_gdk_windowing_window_c lear_area' was here make[4]: *** [gdkwindow-directfb.lo] Error 1 I tried to put to function header of _gdk_windowing_window_clear_area on the top of the file but then linking fails later on with duplicate symbols of IA__gdk_window_hide and other functions with similar name. Steps to reproduce: 1. extract gtk+-2.14.3 2. ./configure --enable-static --prefix=/usr/lib/gtkdfb --host=powerpc-unknown-linux-gnu --with-gdktarget=directfb 3. make Actual results: make fails with: gdkwindow-directfb.c: In function `gdk_window_directfb_process_all_updates': gdkwindow-directfb.c:102: warning: unused variable `wimpl' gdkwindow-directfb.c: In function `IA__gdk_window_hide': gdkwindow-directfb.c:1279: warning: implicit declaration of function `_gdk_windowing_window _clear_area' gdkwindow-directfb.c: At top level: gdkwindow-directfb.c:1620: error: conflicting types for '_gdk_windowing_window_clear_area' gdkwindow-directfb.c:1279: error: previous implicit declaration of '_gdk_windowing_window_c lear_area' was here make[4]: *** [gdkwindow-directfb.lo] Error 1 Expected results: make should succeed Does this happen every time? yes Other information:
the directfb backend has not been updated both in 2.14 and in trunk to the new internal GdkWindowImpl interface, see: http://mail.gnome.org/archives/gtk-devel-list/2008-February/msg00099.html for more informations. retitling for clarity.
*** Bug 557311 has been marked as a duplicate of this bug. ***
Created attachment 122159 [details] [review] implement GdkWindowImplIface in directfb backend Here is a patch for this bug. I haven't test yet if the backend works correctly anyway (because of lack of time and a little problem with directfb on my system right now), but at least it compiles. I'll test later it if I found time for that.
I cannot confirm for sure, but I think this patch is not working like intended. When using it in gtk 2.14.5, gtk-demo crashes. Everything else being equal, I tried with gtk+2.13.0 that didn't not need this patch and gtk-demo works ok Unfortunately I don't know DirectFB and GTK+ well enough to help :-(
*** Bug 564075 has been marked as a duplicate of this bug. ***
Same things here. it crash on line 230 in directfb/gdkcolor-directfb.c: surface=GDK_WINDOW_IMPL_DIRECTFB (GDK_WINDOW_OBJECT (_gdk_parent_root)->impl)->drawable.surface; From what I've seen, there is a problem with _gdk_parent_root,wich seems to be uninitialized. What's quite strange is that I have't touch this with my patch.
Created attachment 126234 [details] [review] implement GdkWindowImplIface in directfb backend This time, I have been able to make gtk-demo working on my system. So, please at least review this.
+/** + * gdk_window_scroll: + * @window: a #GdkWindow + * @dx: Amount to scroll in the X direction + * @dy: Amount to scroll in the Y direction + * + * Scroll the contents of its window, both pixels and children, by + * the given amount. Portions of the window that the scroll operation + * brings in from offscreen areas are invalidated. + **/ Please don't add doc comments for such functions in gdk/direct-fb/.They are documented in gdk/ (or, depending on where they are implemented, in gdk/x11/). Having the documentation in multiple places leads to redundancy and problems with gtk-doc. void -_gdk_window_directfb_show_raised (GdkWindow *window) +gdk_window_show (GdkWindow *window) This can not be right. gdk_window_show is already implemented in gdk/gdkwindow.c. The same goes for all the other functions that you renamed.
Created attachment 126611 [details] [review] implement GdkWindowImplIface in directfb backend Sorry, but it seems I inverted the filenames when creating my patch. This one is OK.
Created attachment 128872 [details] [review] alternative approach based on the patch from Ubuntu Masse, I've made a similar attempt based on this patch: http://patch-tracking.debian.net/patch/series/view/gtk+2.0/2.14.7-1/071_correct_directfb_declarations.patch In my opinion my attempt looks somewhat cleaner than your patch, but I haven't been able to test it yet. It would help a lot if you could test and review this patch for me. I can then help to get it committed.
Created attachment 128932 [details] [review] updated patch, needs more work
Created attachment 128934 [details] [review] another updates, incorporates move_resize changes from the patch by Masse Nicolas gdkgeometry-directfb.c | 20 +- gdkprivate-directfb.h | 11 + gdkwindow-directfb.c | 468 +++++++++++++++++++++++-------------------------- 3 files changed, 242 insertions(+), 257 deletions(-) This seems to restore basic functionality of the DirectFB backend. Scrolling doesn't work and popups seem broken as well. But I guess this is still better than having a tree that doesn't even compile. Unless someone objects I will commit this to trunk and merge the changes to the gtk-2-14 branch.
I've committed this to both branches now: 2009-02-18 Sven Neumann <sven@gimp.org> Bug 554407 – directfb backend does not implement GdkWindowImpl * gdk/directfb/gdkgeometry-directfb.c * gdk/directfb/gdkprivate-directfb.h * gdk/directfb/gdkwindow-directfb.c: fix the build of the DirectFB backend and resurrect basic functionality. Based on a patch from the Ubuntu bug-tracker and work by Masse Nicolas. If there are problems with these changes, please let me know. Patches to fix the remaining issues are much appreciated.
Some remarks: *in gdkwindow-directfb.c I think that private->impl = g_object_new (_gdk_window_impl_get_type (), NULL); need to be added on line 2656 and 2733 *in gdkdisplay-directfb.c The reason why I put _gdk_windowing_window_init (); before gdk_screen_set_default_colormap (_gdk_screen, gdk_screen_get_system_colormap (_gdk_screen)); is because this way _gdk_parent_root is initialised before the call to gdk_screen_get_system_colormap. This fixed a bug on my system. "Scrolling doesn't work and popups seem broken as well." I had the same. "But I guess this is still better than having a tree that doesn't even compile." I completely agree with you here.
Thanks for the patch review. I have done the changes you suggested in both branches. Now it would be nice if we would figure out the scrolling issue...