gaim/gaim

Fix the cursors to work as they were intended to.
oldstatus
2005-05-26, Daniel Atallah
78d1272d2662
Parents 72ae9106c3bd
Children 4823dd0ced9c
Fix the cursors to work as they were intended to.
--- a/src/gtkimhtml.c Thu May 26 19:57:57 2005 -0400
+++ b/src/gtkimhtml.c Thu May 26 23:06:30 2005 -0400
@@ -536,6 +536,23 @@
return FALSE;
}
+gboolean gtk_enter_event_notify(GtkWidget *imhtml, GdkEventCrossing *event, gpointer data)
+{
+ if (GTK_IMHTML(imhtml)->editable)
+ gdk_window_set_cursor(
+ gtk_text_view_get_window(GTK_TEXT_VIEW(imhtml),
+ GTK_TEXT_WINDOW_TEXT),
+ GTK_IMHTML(imhtml)->text_cursor);
+ else
+ gdk_window_set_cursor(
+ gtk_text_view_get_window(GTK_TEXT_VIEW(imhtml),
+ GTK_TEXT_WINDOW_TEXT),
+ GTK_IMHTML(imhtml)->arrow_cursor);
+
+ /* propagate the event normally */
+ return FALSE;
+}
+
gboolean gtk_leave_event_notify(GtkWidget *imhtml, GdkEventCrossing *event, gpointer data)
{
/* when leaving the widget, clear any current & pending tooltips and restore the cursor */
@@ -547,10 +564,9 @@
g_source_remove(GTK_IMHTML(imhtml)->tip_timer);
GTK_IMHTML(imhtml)->tip_timer = 0;
}
- if (GTK_IMHTML(imhtml)->editable)
- gdk_window_set_cursor(event->window, GTK_IMHTML(imhtml)->text_cursor);
- else
- gdk_window_set_cursor(event->window, GTK_IMHTML(imhtml)->arrow_cursor);
+ gdk_window_set_cursor(
+ gtk_text_view_get_window(GTK_TEXT_VIEW(imhtml),
+ GTK_TEXT_WINDOW_TEXT), NULL);
/* propagate the event normally */
return FALSE;
@@ -1117,6 +1133,7 @@
g_signal_connect(G_OBJECT(imhtml), "size-allocate", G_CALLBACK(gtk_size_allocate_cb), NULL);
g_signal_connect(G_OBJECT(imhtml), "motion-notify-event", G_CALLBACK(gtk_motion_event_notify), NULL);
g_signal_connect(G_OBJECT(imhtml), "leave-notify-event", G_CALLBACK(gtk_leave_event_notify), NULL);
+ g_signal_connect(G_OBJECT(imhtml), "enter-notify-event", G_CALLBACK(gtk_enter_event_notify), NULL);
g_signal_connect(G_OBJECT(imhtml), "key_press_event", G_CALLBACK(gtk_key_pressed_cb), NULL);
g_signal_connect(G_OBJECT(imhtml), "button_press_event", G_CALLBACK(gtk_imhtml_button_press_event), NULL);
g_signal_connect(G_OBJECT(imhtml->text_buffer), "insert-text", G_CALLBACK(preinsert_cb), imhtml);
@@ -1137,7 +1154,8 @@
g_signal_connect_after(G_OBJECT(GTK_IMHTML(imhtml)->text_buffer), "mark-set",
G_CALLBACK(mark_set_so_update_selection_cb), imhtml);
- gtk_widget_add_events(GTK_WIDGET(imhtml), GDK_LEAVE_NOTIFY_MASK);
+ gtk_widget_add_events(GTK_WIDGET(imhtml),
+ GDK_LEAVE_NOTIFY_MASK | GDK_ENTER_NOTIFY_MASK);
imhtml->clipboard_text_string = NULL;
imhtml->clipboard_html_string = NULL;