More patches



Hi,

here are more patches.

I could not find any related bug entry so I'm posting to the list once again.


gdk-directfb-cleanups.patch
	Fixed remaining warnings, wonder why I did not see them last time.
	Cleaned up a bit, e.g. removing obsolete prototypes without an implementation
	or making _gdk_directfb_draw_rectangle() static again as it's no longer used
	from outside and all other drawable methods are static, too.

gdk-directfb-copy-to-image.patch
	Fixes cooperative level setting for the layer if the root window is the one
	to copy from. The exclusive level was wrong as it switches to a new surface etc.
	Usage of gdk_visual_get_system() to create the new image seemed wrong to me to
	I changed it to call gdk_drawable_get_visual() so the copy has the same format.
	Last and least, the locking afterwards only used DSLF_WRITE, but it should have
	used DSLF_READ as well, or are images specified to be write only?

gtk-add-glib-libs-to-executables.patch
	This was a scary build issue. I installed glib, pango and gtk, but kept using
	my system's atk. When gtk-query-immodules-2.0 was built it failed to link as
	it missed a lot of new functions in the glib, e.g. glib_checksum_new(). I found
	out that it somehow tried to link against my system's glib, though using pkg-config
	the correct new glib was returned. Not sure if it's libstuhl or just the order
	on the linker command line, but adding $(GLIB_LIBS) explicitly did the trick.


--
Best regards,
  Denis Oliver Kropp

.------------------------------------------.
| DirectFB - Hardware accelerated graphics |
| http://www.directfb.org/                 |
"------------------------------------------"
Index: gdk/directfb/gdkdisplay-directfb.c
===================================================================
--- gdk/directfb/gdkdisplay-directfb.c	(revision 19439)
+++ gdk/directfb/gdkdisplay-directfb.c	(working copy)
@@ -410,9 +410,10 @@
  */
 
 GdkGrabStatus
-gdk_directfb_keyboard_grab (GdkDisplay *display,GdkWindow *window,
-                            gint       owner_events,
-                            guint32    time)
+gdk_directfb_keyboard_grab (GdkDisplay *display,
+                            GdkWindow  *window,
+                            gint        owner_events,
+                            guint32     time)
 {
   GdkWindow             *toplevel;
   GdkWindowImplDirectFB *impl;
@@ -437,7 +438,8 @@
 }
 
 void
-gdk_directfb_keyboard_ungrab (GdkDisplay *display,guint32 time)
+gdk_directfb_keyboard_ungrab (GdkDisplay *display,
+                              guint32     time)
 {
   GdkWindow             *toplevel;
   GdkWindowImplDirectFB *impl;
@@ -445,8 +447,7 @@
   if (!_gdk_directfb_keyboard_grab_window)
     return;
 
-  toplevel =
-    gdk_directfb_window_find_toplevel (_gdk_directfb_keyboard_grab_window);
+  toplevel = gdk_directfb_window_find_toplevel (_gdk_directfb_keyboard_grab_window);
   impl = GDK_WINDOW_IMPL_DIRECTFB (GDK_WINDOW_OBJECT (toplevel)->impl);
 
   if (impl->window)
@@ -477,50 +478,19 @@
  */
 
 GdkGrabStatus
-gdk_display_keyboard_grab (GdkDisplay *display,GdkWindow *window,
-                   gint       owner_events,
-                   guint32    time)
+gdk_display_keyboard_grab (GdkDisplay *display,
+                           GdkWindow  *window,
+                           gint        owner_events,
+                           guint32     time)
 {
-  GdkWindow             *toplevel;
-  GdkWindowImplDirectFB *impl;
-
-  g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
-
-  if (_gdk_directfb_keyboard_grab_window)
-    gdk_keyboard_ungrab (time);
-
-  toplevel = gdk_directfb_window_find_toplevel (window);
-  impl = GDK_WINDOW_IMPL_DIRECTFB (GDK_WINDOW_OBJECT (toplevel)->impl);
-
-  if (impl->window)
-    {
-      if (impl->window->GrabKeyboard (impl->window) == DFB_LOCKED)
-        return GDK_GRAB_ALREADY_GRABBED;
-    }
-
-  _gdk_directfb_keyboard_grab_window = g_object_ref (window);
-  _gdk_directfb_keyboard_grab_owner_events = owner_events;
-  return GDK_GRAB_SUCCESS;
+  return gdk_directfb_keyboard_grab (display, window, owner_events, time);
 }
 
 void
-gdk_display_keyboard_ungrab (GdkDisplay *display,guint32 time)
+gdk_display_keyboard_ungrab (GdkDisplay *display,
+                             guint32     time)
 {
-  GdkWindow             *toplevel;
-  GdkWindowImplDirectFB *impl;
-
-  if (!_gdk_directfb_keyboard_grab_window)
-    return;
-
-  toplevel =
-    gdk_directfb_window_find_toplevel (_gdk_directfb_keyboard_grab_window);
-  impl = GDK_WINDOW_IMPL_DIRECTFB (GDK_WINDOW_OBJECT (toplevel)->impl);
-
-  if (impl->window)
-    impl->window->UngrabKeyboard (impl->window);
-
-  g_object_unref (_gdk_directfb_keyboard_grab_window);
-  _gdk_directfb_keyboard_grab_window = NULL;
+  return gdk_directfb_keyboard_ungrab (display, time);
 }
 
 
Index: gdk/directfb/gdkdrawable-directfb.c
===================================================================
--- gdk/directfb/gdkdrawable-directfb.c	(revision 19439)
+++ gdk/directfb/gdkdrawable-directfb.c	(working copy)
@@ -255,7 +255,7 @@
 
   if (private->buffered) {
        D_DEBUG_AT( GDKDFB_DrawClip, "  -> buffered region   > %4d,%4d - %4dx%4d <  (%ld boxes)\n",
-                   GDKDFB_RECTANGLE_VALS_FROM_SEGMENT( &private->paint_region.extents ),
+                   GDKDFB_RECTANGLE_VALS_FROM_BOX( &private->paint_region.extents ),
                    private->paint_region.numRects );
 
     gdk_region_intersect (ret_clip, &private->paint_region);
@@ -269,7 +269,7 @@
       if (region->numRects)
         {
           D_DEBUG_AT( GDKDFB_DrawClip, "  -> clipping region   > %4d,%4d - %4dx%4d <  (%ld boxes)\n",
-                      GDKDFB_RECTANGLE_VALS_FROM_SEGMENT( &region->extents ), region->numRects );
+                      GDKDFB_RECTANGLE_VALS_FROM_BOX( &region->extents ), region->numRects );
 
           if (gc->clip_x_origin || gc->clip_y_origin)
             {
@@ -290,7 +290,7 @@
 
   if (private->buffered) {
        D_DEBUG_AT( GDKDFB_DrawClip, "  => returning clip   >> %4d,%4d - %4dx%4d << (%ld boxes)\n",
-                   GDKDFB_RECTANGLE_VALS_FROM_SEGMENT( &ret_clip->extents ), ret_clip->numRects );
+                   GDKDFB_RECTANGLE_VALS_FROM_BOX( &ret_clip->extents ), ret_clip->numRects );
     return;
   }
 
@@ -324,15 +324,15 @@
           temp.extents.x2 = cur_private->x + cur_impl->width;
           temp.extents.y2 = cur_private->y + cur_impl->height;
 
-          D_DEBUG_AT( GDKDFB_DrawClip, "  -> clipping child    [ %4d,%4d - %4dx%4d ]\n",
-                      GDKDFB_RECTANGLE_VALS_FROM_SEGMENT( &temp.extents ), temp.numRects );
+          D_DEBUG_AT( GDKDFB_DrawClip, "  -> clipping child    [ %4d,%4d - %4dx%4d ]  (%ld boxes)\n",
+                      GDKDFB_RECTANGLE_VALS_FROM_BOX( &temp.extents ), temp.numRects );
 
           gdk_region_subtract (ret_clip, &temp);
         }
     }
 
   D_DEBUG_AT( GDKDFB_DrawClip, "  => returning clip   >> %4d,%4d - %4dx%4d << (%ld boxes)\n",
-              GDKDFB_RECTANGLE_VALS_FROM_SEGMENT( &ret_clip->extents ), ret_clip->numRects );
+              GDKDFB_RECTANGLE_VALS_FROM_BOX( &ret_clip->extents ), ret_clip->numRects );
 }
 
 /* Drawing
@@ -418,14 +418,14 @@
   return TRUE;
 }
 
-void
-_gdk_directfb_draw_rectangle (GdkDrawable *drawable,
-                              GdkGC       *gc,
-                              gint         filled,
-                              gint         x,
-                              gint         y,
-                              gint         width,
-                              gint         height)
+static void
+gdk_directfb_draw_rectangle (GdkDrawable *drawable,
+                             GdkGC       *gc,
+                             gint         filled,
+                             gint         x,
+                             gint         y,
+                             gint         width,
+                             gint         height)
 {
   GdkDrawableImplDirectFB *impl;
   GdkRegion                clip;
@@ -1519,7 +1519,7 @@
   object_class->finalize = gdk_drawable_impl_directfb_finalize;
 
   drawable_class->create_gc      = _gdk_directfb_gc_new;
-  drawable_class->draw_rectangle = _gdk_directfb_draw_rectangle;
+  drawable_class->draw_rectangle = gdk_directfb_draw_rectangle;
   drawable_class->draw_arc       = gdk_directfb_draw_arc;
   drawable_class->draw_polygon   = gdk_directfb_draw_polygon;
   drawable_class->draw_text      = gdk_directfb_draw_text;
Index: gdk/directfb/gdkwindow-directfb.c
===================================================================
--- gdk/directfb/gdkwindow-directfb.c	(revision 19439)
+++ gdk/directfb/gdkwindow-directfb.c	(working copy)
@@ -3055,7 +3055,7 @@
   private->update_area = NULL;
       
   D_DEBUG_AT( GDKDFB_Paintable, "  -> update area %4d,%4d-%4dx%4d\n",
-              GDKDFB_RECTANGLE_VALS_FROM_SEGMENT( &update_area->extents ) );
+              GDKDFB_RECTANGLE_VALS_FROM_BOX( &update_area->extents ) );
 
   if (_gdk_event_func && gdk_window_is_viewable (window))
     {
@@ -3105,8 +3105,8 @@
   if (!region)
     return;
 
-  D_DEBUG_AT( GDKDFB_Window, "%s( %p ) <- %4d,%4d-%4d,%4d (%d boxes)\n", __FUNCTION__,
-              paintable, GDKDFB_RECTANGLE_VALS_FROM_SEGMENT(&region->extents), region->numRects );
+  D_DEBUG_AT( GDKDFB_Window, "%s( %p ) <- %4d,%4d-%4d,%4d (%ld boxes)\n", __FUNCTION__,
+              paintable, GDKDFB_RECTANGLE_VALS_FROM_BOX(&region->extents), region->numRects );
 
   /* When it's buffered... */
   if (impl->buffered)
@@ -3114,7 +3114,7 @@
       /* ...we're already painting on it! */
       g_assert( impl->paint_depth > 0 );
     
-      D_DEBUG_AT( GDKDFB_Window, "  -> painted  %4d,%4d-%4dx%4d (%d boxes)\n",
+      D_DEBUG_AT( GDKDFB_Window, "  -> painted  %4d,%4d-%4dx%4d (%ld boxes)\n",
                   DFB_RECTANGLE_VALS_FROM_REGION( &impl->paint_region.extents ), impl->paint_region.numRects );
 
       /* Add the new region to the paint region... */
@@ -3134,13 +3134,13 @@
       impl->buffered = TRUE;
     }
 
-  D_DEBUG_AT( GDKDFB_Window, "  -> painting %4d,%4d-%4dx%4d (%d boxes)\n",
+  D_DEBUG_AT( GDKDFB_Window, "  -> painting %4d,%4d-%4dx%4d (%ld boxes)\n",
               DFB_RECTANGLE_VALS_FROM_REGION( &impl->paint_region.extents ), impl->paint_region.numRects );
 
   /* ...but clip the initial/compound result against the clip region. */
   gdk_region_intersect (&impl->paint_region, &impl->clip_region);
 
-  D_DEBUG_AT( GDKDFB_Window, "  -> clipped  %4d,%4d-%4dx%4d (%d boxes)\n",
+  D_DEBUG_AT( GDKDFB_Window, "  -> clipped  %4d,%4d-%4dx%4d (%ld boxes)\n",
               DFB_RECTANGLE_VALS_FROM_REGION( &impl->paint_region.extents ), impl->paint_region.numRects );
 
   impl->paint_depth++;
@@ -3151,7 +3151,7 @@
     {
       GdkRegionBox *box = &region->rects[i];
 
-      D_DEBUG_AT( GDKDFB_Window, "  -> [%2d] %4d,%4d-%4dx%4d\n", i, GDKDFB_RECTANGLE_VALS_FROM_SEGMENT( box ) );
+      D_DEBUG_AT( GDKDFB_Window, "  -> [%2d] %4d,%4d-%4dx%4d\n", i, GDKDFB_RECTANGLE_VALS_FROM_BOX( box ) );
 
       _gdk_windowing_window_clear_area (GDK_WINDOW(wimpl->gdkWindow),
                                         box->x1,
@@ -3188,7 +3188,7 @@
                             impl->paint_region.extents.x2-1,
                             impl->paint_region.extents.y2-1 };
 
-          D_DEBUG_AT( GDKDFB_Window, "  -> flip %4d,%4d-%4dx%4d (%d boxes)\n",
+          D_DEBUG_AT( GDKDFB_Window, "  -> flip %4d,%4d-%4dx%4d (%ld boxes)\n",
                       DFB_RECTANGLE_VALS_FROM_REGION( &reg ), impl->paint_region.numRects );
 
           impl->surface->Flip( impl->surface, &reg, 0 );
@@ -3221,7 +3221,7 @@
                   reg.x2 = impl->abs_x - top->x + impl->paint_region.extents.x2 - 1;
                   reg.y2 = impl->abs_y - top->y + impl->paint_region.extents.y2 - 1;
   
-                  D_DEBUG_AT( GDKDFB_Window, "  -> queue flip %4d,%4d-%4dx%4d (%d boxes)\n",
+                  D_DEBUG_AT( GDKDFB_Window, "  -> queue flip %4d,%4d-%4dx%4d (%ld boxes)\n",
                               DFB_RECTANGLE_VALS_FROM_REGION( &reg ), impl->paint_region.numRects );
   
                   dfb_updates_add( &wimpl->flips, &reg );
Index: gdk/directfb/gdkprivate-directfb.h
===================================================================
--- gdk/directfb/gdkprivate-directfb.h	(revision 19439)
+++ gdk/directfb/gdkprivate-directfb.h	(working copy)
@@ -96,17 +96,6 @@
 
 GType      gdk_drawable_impl_directfb_get_type (void);
 
-void       _gdk_directfb_draw_rectangle (GdkDrawable *drawable,
-                                         GdkGC       *gc,
-                                         gint         filled,
-                                         gint         x,
-                                         gint         y,
-                                         gint         width,
-                                         gint         height);
-
-void       _gdk_directfb_update         (GdkDrawableImplDirectFB *impl,
-                                         DFBRegion               *region);
-
 GdkEvent *  gdk_directfb_event_make     (GdkWindow               *window,
                                          GdkEventType             type);
 
@@ -244,6 +233,14 @@
 void       gdk_directfb_event_windows_remove (GdkWindow *window);
 #endif
 
+GdkGrabStatus gdk_directfb_keyboard_grab  (GdkDisplay          *display,
+                                           GdkWindow           *window,
+                                           gint                 owner_events,
+                                           guint32              time);
+
+void          gdk_directfb_keyboard_ungrab(GdkDisplay          *display,
+                                           guint32              time);
+
 GdkGrabStatus gdk_directfb_pointer_grab   (GdkWindow           *window,
                                            gint                 owner_events,
                                            GdkEventMask         event_mask,
@@ -410,7 +407,7 @@
 }
 
 
-#define GDKDFB_RECTANGLE_VALS_FROM_SEGMENT(s)     (s)->x1, (s)->y1, (s)->x2-(s)->x1, (s)->y2-(s)->y1
+#define GDKDFB_RECTANGLE_VALS_FROM_BOX(s)   (s)->x1, (s)->y1, (s)->x2-(s)->x1, (s)->y2-(s)->y1
 
 
 #endif /* __GDK_PRIVATE_DIRECTFB_H__ */
Index: gdk/directfb/gdkimage-directfb.c
===================================================================
--- gdk/directfb/gdkimage-directfb.c	(revision 19439)
+++ gdk/directfb/gdkimage-directfb.c	(working copy)
@@ -278,7 +278,7 @@
     {
       DFBResult ret;
 
-      ret = layer->SetCooperativeLevel (layer, DLSCL_EXCLUSIVE);
+      ret = layer->SetCooperativeLevel (layer, DLSCL_ADMINISTRATIVE);
       if (ret)
         {
           DirectFBError ("_gdk_directfb_copy_to_image - SetCooperativeLevel",
@@ -300,7 +300,7 @@
 
   if (!image)
     image =  gdk_image_new (GDK_IMAGE_NORMAL,
-                            gdk_visual_get_system (), width, height);
+                            gdk_drawable_get_visual (drawable), width, height);
 
   private = image->windowing_data;
 
@@ -309,7 +309,7 @@
   private->surface->Blit( private->surface,
                           impl->surface, &rect, dest_x, dest_y );
 
-  private->surface->Lock( private->surface, DSLF_WRITE, &image->mem, &pitch );
+  private->surface->Lock( private->surface, DSLF_READ | DSLF_WRITE, &image->mem, &pitch );
   image->bpl = pitch;
 
   if (impl->wrapper == _gdk_parent_root)
Index: gtk/Makefile.am
===================================================================
--- gtk/Makefile.am	(revision 19439)
+++ gtk/Makefile.am	(working copy)
@@ -889,7 +889,8 @@
 LDADDS =								\
 	$(gtktargetlib)							\
 	$(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la	\
-	$(top_builddir)/gdk/$(gdktargetlib)
+	$(top_builddir)/gdk/$(gdktargetlib)				\
+	$(GLIB_LIBS)
 
 #
 # Installed tools


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]