Index: gtkstatusbar.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkstatusbar.c,v
retrieving revision 1.37
diff -u -r1.37 gtkstatusbar.c
--- gtkstatusbar.c	18 Jul 2003 18:52:02 -0000	1.37
+++ gtkstatusbar.c	18 Dec 2003 15:36:48 -0000
@@ -54,36 +54,39 @@
   PROP_HAS_RESIZE_GRIP
 };
 
-static void     gtk_statusbar_class_init     (GtkStatusbarClass *class);
-static void     gtk_statusbar_init           (GtkStatusbar      *statusbar);
-static void     gtk_statusbar_destroy        (GtkObject         *object);
-static void     gtk_statusbar_update         (GtkStatusbar      *statusbar,
-					      guint              context_id,
-					      const gchar       *text);
-static void     gtk_statusbar_size_allocate  (GtkWidget         *widget,
-					      GtkAllocation     *allocation);
-static void     gtk_statusbar_realize        (GtkWidget         *widget);
-static void     gtk_statusbar_unrealize      (GtkWidget         *widget);
-static void     gtk_statusbar_map            (GtkWidget         *widget);
-static void     gtk_statusbar_unmap          (GtkWidget         *widget);
-static gboolean gtk_statusbar_button_press   (GtkWidget         *widget,
-					      GdkEventButton    *event);
-static gboolean gtk_statusbar_expose_event   (GtkWidget         *widget,
-					      GdkEventExpose    *event);
-static void     gtk_statusbar_size_request   (GtkWidget         *widget,
-                                              GtkRequisition    *requisition);
-static void     gtk_statusbar_size_allocate  (GtkWidget         *widget,
-                                              GtkAllocation     *allocation);
-static void     gtk_statusbar_create_window  (GtkStatusbar      *statusbar);
-static void     gtk_statusbar_destroy_window (GtkStatusbar      *statusbar);
-static void     gtk_statusbar_get_property   (GObject           *object, 
-					      guint              prop_id, 
-					      GValue            *value, 
-					      GParamSpec        *pspec);
-static void    gtk_statusbar_set_property    (GObject           *object, 
-					      guint              prop_id, 
-					      const GValue      *value, 
-					      GParamSpec        *pspec);
+static void     gtk_statusbar_class_init        (GtkStatusbarClass *class);
+static void     gtk_statusbar_init              (GtkStatusbar      *statusbar);
+static void     gtk_statusbar_destroy           (GtkObject         *object);
+static void     gtk_statusbar_update            (GtkStatusbar      *statusbar,
+						 guint              context_id,
+						 const gchar       *text);
+static void     gtk_statusbar_size_allocate     (GtkWidget         *widget,
+						 GtkAllocation     *allocation);
+static void     gtk_statusbar_realize           (GtkWidget         *widget);
+static void     gtk_statusbar_unrealize         (GtkWidget         *widget);
+static void     gtk_statusbar_map               (GtkWidget         *widget);
+static void     gtk_statusbar_unmap             (GtkWidget         *widget);
+static gboolean gtk_statusbar_button_press      (GtkWidget         *widget,
+						 GdkEventButton    *event);
+static gboolean gtk_statusbar_expose_event      (GtkWidget         *widget,
+						 GdkEventExpose    *event);
+static void     gtk_statusbar_size_request      (GtkWidget         *widget,
+						 GtkRequisition    *requisition);
+static void     gtk_statusbar_size_allocate     (GtkWidget         *widget,
+						 GtkAllocation     *allocation);
+static void     gtk_statusbar_direction_changed (GtkWidget         *widget,
+						 GtkTextDirection   prev_dir);
+static void     gtk_statusbar_create_window     (GtkStatusbar      *statusbar);
+static void     gtk_statusbar_destroy_window    (GtkStatusbar      *statusbar);
+static void     gtk_statusbar_get_property      (GObject           *object,
+						 guint              prop_id,
+						 GValue            *value,
+						 GParamSpec        *pspec);
+static void     gtk_statusbar_set_property      (GObject           *object,
+						 guint              prop_id,
+						 const GValue      *value,
+						 GParamSpec        *pspec);
+
 
 static GtkContainerClass *parent_class;
 static guint              statusbar_signals[SIGNAL_LAST] = { 0 };
@@ -145,6 +148,8 @@
 
   widget_class->size_request = gtk_statusbar_size_request;
   widget_class->size_allocate = gtk_statusbar_size_allocate;
+
+  widget_class->direction_changed = gtk_statusbar_direction_changed;
   
   class->messages_mem_chunk = g_mem_chunk_new ("GtkStatusbar messages mem chunk",
 					       sizeof (GtkStatusbarMsg),
@@ -529,9 +534,30 @@
   rect->y = widget->allocation.y + widget->allocation.height - h;
 
   if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR) 
-      rect->x = widget->allocation.x + widget->allocation.width - w;
+    rect->x = widget->allocation.x + widget->allocation.width - w;
   else 
-      rect->x = widget->allocation.x + widget->style->xthickness;
+    rect->x = widget->allocation.x + widget->style->xthickness;
+}
+
+static void
+set_grip_cursor (GtkStatusbar *statusbar)
+{
+  if (statusbar->has_resize_grip)
+    {
+      GtkWidget *widget = GTK_WIDGET (statusbar);
+      GdkDisplay *display = gtk_widget_get_display (widget);
+      GdkCursorType cursor_type;
+      GdkCursor *cursor;
+      
+      if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
+	cursor_type = GDK_BOTTOM_RIGHT_CORNER;
+      else
+	cursor_type = GDK_BOTTOM_LEFT_CORNER;
+
+      cursor = gdk_cursor_new_for_display (display, cursor_type);
+      gdk_window_set_cursor (statusbar->grip_window, cursor);
+      gdk_cursor_unref (cursor);
+    }
 }
 
 static void
@@ -563,6 +589,17 @@
   statusbar->grip_window = gdk_window_new (widget->window,
                                            &attributes, attributes_mask);
   gdk_window_set_user_data (statusbar->grip_window, widget);
+
+  set_grip_cursor (statusbar);
+}
+
+static void
+gtk_statusbar_direction_changed (GtkWidget        *widget,
+				 GtkTextDirection  prev_dir)
+{
+  GtkStatusbar *statusbar = GTK_STATUSBAR (widget);
+
+  set_grip_cursor (statusbar);
 }
 
 static void
