From 70700509ee969b58c6110310f5a962dcff854d6e Mon Sep 17 00:00:00 2001 From: Vasily Date: Thu, 10 Dec 2015 00:54:50 +0300 Subject: Implemented NaCl cursor hiding, custom cursor is supported now --- src/defaults.cpp | 4 ---- src/gui/gui.cpp | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/defaults.cpp b/src/defaults.cpp index 45cec23a8..a301d2323 100644 --- a/src/defaults.cpp +++ b/src/defaults.cpp @@ -139,11 +139,7 @@ DefaultsData* getConfigDefaults() AddDEF("fpslimit", 60); AddDEF("theme", ""); AddDEF("showChatColorsList", true); -#ifdef __native_client__ - AddDEF("customcursor", false); -#else AddDEF("customcursor", true); -#endif AddDEF("showDidYouKnow", true); AddDEF("longmouseclick", false); #endif diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index ea527e3ef..f7878a55f 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -98,6 +98,13 @@ #include "net/ipc.h" +#ifdef __native_client__ +#include +#include +#include +#include +#endif + #include "debug.h" Gui *gui = nullptr; @@ -533,6 +540,18 @@ void Gui::setUseCustomCursor(const bool customCursor) { mCustomCursor = customCursor; +#ifdef __native_client__ + PP_MouseCursor_Type cursor; + if (mCustomCursor) + cursor = PP_MOUSECURSOR_TYPE_NONE; // hide cursor + else + cursor = PP_MOUSECURSOR_TYPE_POINTER; // show default cursor + + pp::MouseCursor::SetCursor( + pp::InstanceHandle(PSGetInstanceId()), + cursor); +#endif + if (mCustomCursor) { // Hide the SDL mouse cursor -- cgit v1.2.3-70-g09d2