Mercurial > pidgin.yaz
comparison src/gtkimhtml.c @ 10946:2d30f151146d
[gaim-migrate @ 12742]
Fix the cursors to work as they were intended to.
committer: Tailor Script <tailor@pidgin.im>
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Fri, 27 May 2005 03:14:45 +0000 |
parents | ea9e65f52b4b |
children | 5d3b0a920d83 |
comparison
equal
deleted
inserted
replaced
10945:1ce8013f5642 | 10946:2d30f151146d |
---|---|
564 GTK_IMHTML(imhtml)->tip = tip; | 564 GTK_IMHTML(imhtml)->tip = tip; |
565 g_slist_free(tags); | 565 g_slist_free(tags); |
566 return FALSE; | 566 return FALSE; |
567 } | 567 } |
568 | 568 |
569 gboolean gtk_enter_event_notify(GtkWidget *imhtml, GdkEventCrossing *event, gpointer data) | |
570 { | |
571 if (GTK_IMHTML(imhtml)->editable) | |
572 gdk_window_set_cursor( | |
573 gtk_text_view_get_window(GTK_TEXT_VIEW(imhtml), | |
574 GTK_TEXT_WINDOW_TEXT), | |
575 GTK_IMHTML(imhtml)->text_cursor); | |
576 else | |
577 gdk_window_set_cursor( | |
578 gtk_text_view_get_window(GTK_TEXT_VIEW(imhtml), | |
579 GTK_TEXT_WINDOW_TEXT), | |
580 GTK_IMHTML(imhtml)->arrow_cursor); | |
581 | |
582 /* propagate the event normally */ | |
583 return FALSE; | |
584 } | |
585 | |
569 gboolean gtk_leave_event_notify(GtkWidget *imhtml, GdkEventCrossing *event, gpointer data) | 586 gboolean gtk_leave_event_notify(GtkWidget *imhtml, GdkEventCrossing *event, gpointer data) |
570 { | 587 { |
571 /* when leaving the widget, clear any current & pending tooltips and restore the cursor */ | 588 /* when leaving the widget, clear any current & pending tooltips and restore the cursor */ |
572 if (GTK_IMHTML(imhtml)->prelit_tag) { | 589 if (GTK_IMHTML(imhtml)->prelit_tag) { |
573 GdkColor *norm; | 590 GdkColor *norm; |
585 } | 602 } |
586 if (GTK_IMHTML(imhtml)->tip_timer) { | 603 if (GTK_IMHTML(imhtml)->tip_timer) { |
587 g_source_remove(GTK_IMHTML(imhtml)->tip_timer); | 604 g_source_remove(GTK_IMHTML(imhtml)->tip_timer); |
588 GTK_IMHTML(imhtml)->tip_timer = 0; | 605 GTK_IMHTML(imhtml)->tip_timer = 0; |
589 } | 606 } |
590 if (GTK_IMHTML(imhtml)->editable) | 607 gdk_window_set_cursor( |
591 gdk_window_set_cursor(event->window, GTK_IMHTML(imhtml)->text_cursor); | 608 gtk_text_view_get_window(GTK_TEXT_VIEW(imhtml), |
592 else | 609 GTK_TEXT_WINDOW_TEXT), NULL); |
593 gdk_window_set_cursor(event->window, GTK_IMHTML(imhtml)->arrow_cursor); | |
594 | 610 |
595 /* propagate the event normally */ | 611 /* propagate the event normally */ |
596 return FALSE; | 612 return FALSE; |
597 } | 613 } |
598 | 614 |
1274 imhtml->default_smilies = gtk_smiley_tree_new(); | 1290 imhtml->default_smilies = gtk_smiley_tree_new(); |
1275 | 1291 |
1276 g_signal_connect(G_OBJECT(imhtml), "size-allocate", G_CALLBACK(gtk_size_allocate_cb), NULL); | 1292 g_signal_connect(G_OBJECT(imhtml), "size-allocate", G_CALLBACK(gtk_size_allocate_cb), NULL); |
1277 g_signal_connect(G_OBJECT(imhtml), "motion-notify-event", G_CALLBACK(gtk_motion_event_notify), NULL); | 1293 g_signal_connect(G_OBJECT(imhtml), "motion-notify-event", G_CALLBACK(gtk_motion_event_notify), NULL); |
1278 g_signal_connect(G_OBJECT(imhtml), "leave-notify-event", G_CALLBACK(gtk_leave_event_notify), NULL); | 1294 g_signal_connect(G_OBJECT(imhtml), "leave-notify-event", G_CALLBACK(gtk_leave_event_notify), NULL); |
1295 g_signal_connect(G_OBJECT(imhtml), "enter-notify-event", G_CALLBACK(gtk_enter_event_notify), NULL); | |
1279 #if (!GTK_CHECK_VERSION(2,2,0)) | 1296 #if (!GTK_CHECK_VERSION(2,2,0)) |
1280 /* See the comment for gtk_key_pressed_cb */ | 1297 /* See the comment for gtk_key_pressed_cb */ |
1281 g_signal_connect(G_OBJECT(imhtml), "key_press_event", G_CALLBACK(gtk_key_pressed_cb), NULL); | 1298 g_signal_connect(G_OBJECT(imhtml), "key_press_event", G_CALLBACK(gtk_key_pressed_cb), NULL); |
1282 #endif | 1299 #endif |
1283 g_signal_connect(G_OBJECT(imhtml), "button_press_event", G_CALLBACK(gtk_imhtml_button_press_event), NULL); | 1300 g_signal_connect(G_OBJECT(imhtml), "button_press_event", G_CALLBACK(gtk_imhtml_button_press_event), NULL); |
1297 g_signal_connect(G_OBJECT(imhtml), "unrealize", G_CALLBACK(imhtml_destroy_add_primary), NULL); | 1314 g_signal_connect(G_OBJECT(imhtml), "unrealize", G_CALLBACK(imhtml_destroy_add_primary), NULL); |
1298 | 1315 |
1299 g_signal_connect_after(G_OBJECT(GTK_IMHTML(imhtml)->text_buffer), "mark-set", | 1316 g_signal_connect_after(G_OBJECT(GTK_IMHTML(imhtml)->text_buffer), "mark-set", |
1300 G_CALLBACK(mark_set_so_update_selection_cb), imhtml); | 1317 G_CALLBACK(mark_set_so_update_selection_cb), imhtml); |
1301 | 1318 |
1302 gtk_widget_add_events(GTK_WIDGET(imhtml), GDK_LEAVE_NOTIFY_MASK); | 1319 gtk_widget_add_events(GTK_WIDGET(imhtml), |
1320 GDK_LEAVE_NOTIFY_MASK | GDK_ENTER_NOTIFY_MASK); | |
1303 | 1321 |
1304 imhtml->clipboard_text_string = NULL; | 1322 imhtml->clipboard_text_string = NULL; |
1305 imhtml->clipboard_html_string = NULL; | 1323 imhtml->clipboard_html_string = NULL; |
1306 | 1324 |
1307 imhtml->tip = NULL; | 1325 imhtml->tip = NULL; |