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