Replace several implementation of blank cursor setting by

* gtk/gtkentry.c:
        * gtk/gtkfilechooserentry.c:
        * gtk/gtktextview.c: Replace several implementation of
        blank cursor setting by GDK_BLANK_CURSOR.


svn path=/trunk/; revision=22148
This commit is contained in:
Matthias Clasen 2009-01-20 02:45:19 +00:00
parent c98305ac00
commit b6b5237663
4 changed files with 21 additions and 56 deletions

View File

@ -1,3 +1,10 @@
2009-01-19 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkentry.c:
* gtk/gtkfilechooserentry.c:
* gtk/gtktextview.c: Replace several implementation of
blank cursor setting by GDK_BLANK_CURSOR.
2009-01-19 Matthias Clasen <mclasen@redhat.com>
* gdk/gdkcursor.c:

View File

@ -3782,28 +3782,15 @@ gtk_entry_motion_notify (GtkWidget *widget,
static void
set_invisible_cursor (GdkWindow *window)
{
GdkBitmap *empty_bitmap;
GdkDisplay *display;
GdkCursor *cursor;
GdkColor useless;
char invisible_cursor_bits[] = { 0x0 };
useless.red = useless.green = useless.blue = 0;
useless.pixel = 0;
empty_bitmap = gdk_bitmap_create_from_data (window,
invisible_cursor_bits,
1, 1);
cursor = gdk_cursor_new_from_pixmap (empty_bitmap,
empty_bitmap,
&useless,
&useless, 0, 0);
display = gdk_drawable_get_display (window);
cursor = gdk_cursor_new_for_display (display, GDK_BLANK_CURSOR);
gdk_window_set_cursor (window, cursor);
gdk_cursor_unref (cursor);
g_object_unref (empty_bitmap);
}
static void

View File

@ -862,31 +862,15 @@ completion_feedback_window_expose_event_cb (GtkWidget *widget,
static void
set_invisible_mouse_cursor (GdkWindow *window)
{
/* Stolen from gtkentry.c:set_invisible_cursor() */
/* FIXME: implement a stupid public gdk_window_set_invisible_mouse_cursor() */
GdkBitmap *empty_bitmap;
GdkDisplay *display;
GdkCursor *cursor;
GdkColor useless;
char invisible_cursor_bits[] = { 0x0 };
useless.red = useless.green = useless.blue = 0;
useless.pixel = 0;
empty_bitmap = gdk_bitmap_create_from_data (window,
invisible_cursor_bits,
1, 1);
cursor = gdk_cursor_new_from_pixmap (empty_bitmap,
empty_bitmap,
&useless,
&useless, 0, 0);
display = gdk_drawable_get_display (window);
cursor = gdk_cursor_new_for_display (display, GDK_BLANK_CURSOR);
gdk_window_set_cursor (window, cursor);
gdk_cursor_unref (cursor);
g_object_unref (empty_bitmap);
}
static void

View File

@ -3988,28 +3988,15 @@ gtk_text_view_state_changed (GtkWidget *widget,
static void
set_invisible_cursor (GdkWindow *window)
{
GdkBitmap *empty_bitmap;
GdkDisplay *display;
GdkCursor *cursor;
GdkColor useless;
char invisible_cursor_bits[] = { 0x0 };
useless.red = useless.green = useless.blue = 0;
useless.pixel = 0;
empty_bitmap = gdk_bitmap_create_from_data (window,
invisible_cursor_bits,
1, 1);
cursor = gdk_cursor_new_from_pixmap (empty_bitmap,
empty_bitmap,
&useless,
&useless, 0, 0);
display = gdk_drawable_get_display (window);
cursor = gdk_cursor_new_for_display (display, GDK_BLANK_CURSOR);
gdk_window_set_cursor (window, cursor);
gdk_cursor_unref (cursor);
g_object_unref (empty_bitmap);
}
static void