Blame SOURCES/0303-lokdocview-support-LOK_CALLBACK_MOUSE_POINTER.patch

f325b2
From b077183a4d3005427949a6b60fa8aafda4d088c8 Mon Sep 17 00:00:00 2001
f325b2
From: Andrzej Hunt <andrzej@ahunt.org>
f325b2
Date: Tue, 10 Nov 2015 11:40:41 +0100
f325b2
Subject: [PATCH 303/398] lokdocview: support LOK_CALLBACK_MOUSE_POINTER
f325b2
f325b2
Change-Id: I2052e39fa2e25988a40f293389d5a183a625acd4
f325b2
Reviewed-on: https://gerrit.libreoffice.org/19903
f325b2
Reviewed-by: Andrzej Hunt <andrzej@ahunt.org>
f325b2
Tested-by: Andrzej Hunt <andrzej@ahunt.org>
f325b2
(cherry picked from commit cc920bc27a0c37233d65ee1b20712e3ac6896c9a)
f325b2
---
f325b2
 libreofficekit/source/gtk/lokdocview.cxx | 11 +++++++++++
f325b2
 1 file changed, 11 insertions(+)
f325b2
f325b2
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
f325b2
index 0d1dec1ddb05..687323d6ca11 100644
f325b2
--- a/libreofficekit/source/gtk/lokdocview.cxx
f325b2
+++ b/libreofficekit/source/gtk/lokdocview.cxx
f325b2
@@ -282,6 +282,8 @@ callbackTypeToString (int nType)
f325b2
         return "LOK_CALLBACK_CELL_CURSOR";
f325b2
     case LOK_CALLBACK_HYPERLINK_CLICKED:
f325b2
         return "LOK_CALLBACK_HYPERLINK_CLICKED";
f325b2
+    case LOK_CALLBACK_MOUSE_POINTER:
f325b2
+        return "LOK_CALLBACK_MOUSE_POINTER";
f325b2
     case LOK_CALLBACK_STATE_CHANGED:
f325b2
         return "LOK_CALLBACK_STATE_CHANGED";
f325b2
     case LOK_CALLBACK_STATUS_INDICATOR_START:
f325b2
@@ -736,6 +738,15 @@ callback (gpointer pData)
f325b2
         priv->m_bCursorVisible = pCallback->m_aPayload == "true";
f325b2
     }
f325b2
     break;
f325b2
+    case LOK_CALLBACK_MOUSE_POINTER:
f325b2
+    {
f325b2
+        // The gtk docs claim that most css cursors should be supported, however
f325b2
+        // on my system at least this is not true and many cursors are unsupported.
f325b2
+        // In this case pCursor = null, which results in the default cursor being set.
f325b2
+        GdkCursor* pCursor = gdk_cursor_new_from_name(gtk_widget_get_display(GTK_WIDGET(pDocView)), pCallback->m_aPayload.c_str());
f325b2
+        gdk_window_set_cursor(gtk_widget_get_window(GTK_WIDGET(pDocView)), pCursor);
f325b2
+    }
f325b2
+    break;
f325b2
     case LOK_CALLBACK_GRAPHIC_SELECTION:
f325b2
     {
f325b2
         if (pCallback->m_aPayload != "EMPTY")
f325b2
-- 
f325b2
2.12.0
f325b2