]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-chat-text-view.c
Merge remote-tracking branch 'glassrose/add-All-service-selection-in-debug-window'
[empathy.git] / libempathy-gtk / empathy-chat-text-view.c
index 18d12963e6d636fc9739c8256e1870a640a9b926..60d642ccb7bb84c9e7c1f0175980023f4eb3f978 100644 (file)
@@ -151,7 +151,7 @@ chat_text_view_event_cb (EmpathyChatTextView *view,
                return FALSE;
        }
 
-       gdk_window_get_pointer (win, &x, &y, NULL);
+       gdk_window_get_device_position (win, event->device, &x, &y, NULL);
 
        /* Get the iter where the cursor is at */
        gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (view), type,
@@ -286,7 +286,9 @@ chat_text_view_populate_popup (EmpathyChatTextView *view,
        table = gtk_text_buffer_get_tag_table (priv->buffer);
        tag = gtk_text_tag_table_lookup (table, EMPATHY_CHAT_TEXT_VIEW_TAG_LINK);
 
-       gtk_widget_get_pointer (GTK_WIDGET (view), &x, &y);
+       gdk_window_get_device_position (gtk_widget_get_window (GTK_WIDGET (view)),
+               gdk_device_manager_get_client_pointer (gdk_display_get_device_manager (
+                       gtk_widget_get_display (GTK_WIDGET (view)))), &x, &y, NULL);
 
        gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (view),
                                               GTK_TEXT_WINDOW_WIDGET,
@@ -453,7 +455,7 @@ chat_text_maybe_append_date_and_time (EmpathyChatTextView *view,
        /* Get the date of the message we are appending */
        date = g_date_time_new_from_unix_utc (timestamp);
 
-       delta = g_date_time_difference (last_date, date);
+       delta = g_date_time_difference (date, last_date);
        /* If last message was from another day we append date and time */
        if (delta >= G_TIME_SPAN_DAY) {
                append_date = TRUE;
@@ -715,7 +717,8 @@ chat_text_view_scroll_down (EmpathyChatView *view)
 
 static void
 chat_text_view_append_message (EmpathyChatView *view,
-                              EmpathyMessage  *msg)
+                              EmpathyMessage  *msg,
+                              gboolean         should_highlight)
 {
        EmpathyChatTextView     *text_view = EMPATHY_CHAT_TEXT_VIEW (view);
        EmpathyChatTextViewPriv *priv = GET_PRIV (text_view);
@@ -737,7 +740,8 @@ chat_text_view_append_message (EmpathyChatView *view,
        chat_text_maybe_append_date_and_time (text_view, timestamp);
        if (EMPATHY_CHAT_TEXT_VIEW_GET_CLASS (view)->append_message) {
                EMPATHY_CHAT_TEXT_VIEW_GET_CLASS (view)->append_message (text_view,
-                                                                        msg);
+                                                                        msg,
+                                                                        should_highlight);
        }
 
        if (bottom) {