aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xbmc/osx/DarwinUtils.h1
-rw-r--r--xbmc/osx/DarwinUtils.mm22
-rw-r--r--xbmc/osx/ios/XBMCController.h10
-rw-r--r--xbmc/osx/ios/XBMCController.mm223
-rw-r--r--xbmc/utils/MathUtils.h106
-rw-r--r--xbmc/utils/SystemInfo.cpp16
-rw-r--r--xbmc/windowing/WinSystem.h1
-rw-r--r--xbmc/windowing/osx/WinSystemIOS.h1
-rw-r--r--xbmc/windowing/osx/WinSystemIOS.mm13
-rw-r--r--xbmc/windows/GUIWindowPointer.cpp12
10 files changed, 212 insertions, 193 deletions
diff --git a/xbmc/osx/DarwinUtils.h b/xbmc/osx/DarwinUtils.h
index daab73da22..9278b6575c 100644
--- a/xbmc/osx/DarwinUtils.h
+++ b/xbmc/osx/DarwinUtils.h
@@ -27,6 +27,7 @@
extern "C"
{
#endif
+ bool DarwinIsAppleTV2(void);
float GetIOSVersion(void);
int GetDarwinFrameworkPath(bool forPython, char* path, uint32_t *pathsize);
int GetDarwinExecutablePath(char* path, uint32_t *pathsize);
diff --git a/xbmc/osx/DarwinUtils.mm b/xbmc/osx/DarwinUtils.mm
index cacca43ba3..155411a385 100644
--- a/xbmc/osx/DarwinUtils.mm
+++ b/xbmc/osx/DarwinUtils.mm
@@ -38,6 +38,28 @@
#import "AutoPool.h"
#import "DarwinUtils.h"
+
+bool DarwinIsAppleTV2(void)
+{
+ static int result = -1;
+#if defined(__APPLE__) && defined(__arm__)
+ if( result == -1 )
+ {
+ char buffer[512];
+ size_t len = 512;
+ result = 0;
+ std::string hw_machine = "unknown";
+
+ if (sysctlbyname("hw.machine", &buffer, &len, NULL, 0) == 0)
+ hw_machine = buffer;
+
+ if (hw_machine.find("AppleTV2,1") != std::string::npos)
+ result = 1;
+ }
+#endif
+ return (result == 1);
+}
+
float GetIOSVersion(void)
{
CCocoaAutoPool pool;
diff --git a/xbmc/osx/ios/XBMCController.h b/xbmc/osx/ios/XBMCController.h
index d913cd4f22..101d5e90b5 100644
--- a/xbmc/osx/ios/XBMCController.h
+++ b/xbmc/osx/ios/XBMCController.h
@@ -32,17 +32,19 @@
int m_screensaverTimeout;
/* Touch handling */
- CGPoint firstTouch;
- CGPoint lastTouch;
CGSize screensize;
+ CGPoint lastGesturePoint;
+ int lastAllowedGestures;
+ bool touchBeginSignaled;
UIInterfaceOrientation orientation;
XBMC_Event lastEvent;
}
@property (readonly, nonatomic, getter=isAnimating) BOOL animating;
-@property CGPoint firstTouch;
-@property CGPoint lastTouch;
+@property CGPoint lastGesturePoint;
+@property int lastAllowedGestures;
+@property bool touchBeginSignaled;
@property CGSize screensize;
@property XBMC_Event lastEvent;
diff --git a/xbmc/osx/ios/XBMCController.mm b/xbmc/osx/ios/XBMCController.mm
index 34d8ac8d99..c2651eb4e3 100644
--- a/xbmc/osx/ios/XBMCController.mm
+++ b/xbmc/osx/ios/XBMCController.mm
@@ -31,6 +31,7 @@
#include "Application.h"
#include "MouseStat.h"
#include "WindowingFactory.h"
+#include "guilib/GUIWindowManager.h"
#include "VideoReferenceClock.h"
#include "utils/log.h"
#include "utils/TimeUtils.h"
@@ -62,9 +63,10 @@ XBMCEAGLView *m_glView;
@end
@implementation XBMCController
-@synthesize firstTouch;
-@synthesize lastTouch;
+@synthesize lastGesturePoint;
@synthesize lastEvent;
+@synthesize lastAllowedGestures;
+@synthesize touchBeginSignaled;
@synthesize screensize;
//--------------------------------------------------------------
@@ -87,7 +89,7 @@ XBMCEAGLView *m_glView;
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
orientation = toInterfaceOrientation;
-
+
CGRect rect;
CGRect srect = [[UIScreen mainScreen] bounds];
@@ -110,13 +112,13 @@ XBMCEAGLView *m_glView;
{
XBMC_Event newEvent;
memset(&newEvent, 0, sizeof(newEvent));
-
+
//newEvent.key.keysym.unicode = key;
newEvent.key.keysym.sym = key;
-
+
newEvent.type = XBMC_KEYDOWN;
CWinEventsIOS::MessagePush(&newEvent);
-
+
newEvent.type = XBMC_KEYUP;
CWinEventsIOS::MessagePush(&newEvent);
}
@@ -124,70 +126,35 @@ XBMCEAGLView *m_glView;
- (void)createGestureRecognizers
{
- UITapGestureRecognizer *singleFingerDTap = [[UITapGestureRecognizer alloc]
- initWithTarget:self action:@selector(handleSingleDoubleTap:)];
- singleFingerDTap.delaysTouchesBegan = YES;
- singleFingerDTap.numberOfTapsRequired = 2;
- [self.view addGestureRecognizer:singleFingerDTap];
- [singleFingerDTap release];
-
+ //2 finger single tab - right mouse
+ //single finger double tab delays single finger single tab - so we
+ //go for 2 fingers here - so single finger single tap is instant
+ UITapGestureRecognizer *doubleFingerSingleTap = [[UITapGestureRecognizer alloc]
+ initWithTarget:self action:@selector(handleDoubleFingerSingleTap:)];
+ doubleFingerSingleTap.delaysTouchesBegan = NO;
+ doubleFingerSingleTap.numberOfTapsRequired = 1;
+ doubleFingerSingleTap.numberOfTouchesRequired = 2;
+ [self.view addGestureRecognizer:doubleFingerSingleTap];
+ [doubleFingerSingleTap release];
+
+ //double finger swipe left for backspace ... i like this fast backspace feature ;)
UISwipeGestureRecognizer *swipeLeft = [[UISwipeGestureRecognizer alloc]
- initWithTarget:self action:@selector(handleSwipeLeft:)];
+ initWithTarget:self action:@selector(handleSwipeLeft:)];
+ swipeLeft.delaysTouchesBegan = NO;
+ swipeLeft.numberOfTouchesRequired = 2;
swipeLeft.direction = UISwipeGestureRecognizerDirectionLeft;
- swipeLeft.delaysTouchesBegan = YES;
[self.view addGestureRecognizer:swipeLeft];
[swipeLeft release];
-
- UISwipeGestureRecognizer *swipeRight = [[UISwipeGestureRecognizer alloc]
- initWithTarget:self action:@selector(handleSwipeRight:)];
- swipeRight.direction = UISwipeGestureRecognizerDirectionRight;
- swipeRight.delaysTouchesBegan = YES;
- [self.view addGestureRecognizer:swipeRight];
- [swipeRight release];
-
- UISwipeGestureRecognizer *swipeUp = [[UISwipeGestureRecognizer alloc]
- initWithTarget:self action:@selector(handleSwipeUp:)];
- swipeUp.direction = UISwipeGestureRecognizerDirectionUp;
- swipeUp.delaysTouchesBegan = YES;
- [self.view addGestureRecognizer:swipeUp];
- [swipeUp release];
-
- UISwipeGestureRecognizer *swipeDown = [[UISwipeGestureRecognizer alloc]
- initWithTarget:self action:@selector(handleSwipeDown:)];
- swipeDown.direction = UISwipeGestureRecognizerDirectionDown;
- swipeDown.delaysTouchesBegan = YES;
- [self.view addGestureRecognizer:swipeDown];
- [swipeDown release];
}
//--------------------------------------------------------------
- (IBAction)handleSwipeLeft:(UISwipeGestureRecognizer *)sender
{
- //NSLog(@"%s swipeLeft", __PRETTY_FUNCTION__);
[self sendKey:XBMCK_BACKSPACE];
}
//--------------------------------------------------------------
-- (IBAction)handleSwipeRight:(UISwipeGestureRecognizer *)sender
-{
- //NSLog(@"%s swipeRight", __PRETTY_FUNCTION__);
- [self sendKey:XBMCK_TAB];
-}
-//--------------------------------------------------------------
-- (IBAction)handleSwipeUp:(UISwipeGestureRecognizer *)sender
-{
- //NSLog(@"%s swipeUp", __PRETTY_FUNCTION__);
- [self sendKey:XBMCK_UP];
-}
-//--------------------------------------------------------------
-- (IBAction)handleSwipeDown:(UISwipeGestureRecognizer *)sender
-{
- //NSLog(@"%s swipeDown", __PRETTY_FUNCTION__);
- [self sendKey:XBMCK_DOWN];
-}
-//--------------------------------------------------------------
-- (IBAction)handleSingleDoubleTap:(UIGestureRecognizer *)sender
+- (IBAction)handleDoubleFingerSingleTap:(UIGestureRecognizer *)sender
{
- firstTouch = [sender locationOfTouch:0 inView:m_glView];
- lastTouch = [sender locationOfTouch:0 inView:m_glView];
+ CGPoint point = [sender locationOfTouch:0 inView:m_glView];
//NSLog(@"%s toubleTap", __PRETTY_FUNCTION__);
@@ -197,11 +164,11 @@ XBMCEAGLView *m_glView;
newEvent.type = XBMC_MOUSEBUTTONDOWN;
newEvent.button.type = XBMC_MOUSEBUTTONDOWN;
newEvent.button.button = XBMC_BUTTON_RIGHT;
- newEvent.button.x = lastTouch.x;
- newEvent.button.y = lastTouch.y;
+ newEvent.button.x = point.x;
+ newEvent.button.y = point.y;
CWinEventsIOS::MessagePush(&newEvent);
-
+
newEvent.type = XBMC_MOUSEBUTTONUP;
newEvent.button.type = XBMC_MOUSEBUTTONUP;
CWinEventsIOS::MessagePush(&newEvent);
@@ -213,82 +180,90 @@ XBMCEAGLView *m_glView;
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
- firstTouch = [touch locationInView:m_glView];
- lastTouch = [touch locationInView:m_glView];
-
- //NSLog(@"%s touchesBegan x=%f, y=%f count=%d", __PRETTY_FUNCTION__, lastTouch.x, lastTouch.y, [touch tapCount]);
-
- XBMC_Event newEvent;
- memset(&newEvent, 0, sizeof(newEvent));
-
- newEvent.type = XBMC_MOUSEBUTTONDOWN;
- newEvent.button.type = XBMC_MOUSEBUTTONDOWN;
- newEvent.button.x = lastTouch.x;
- newEvent.button.y = lastTouch.y;
- newEvent.button.button = XBMC_BUTTON_LEFT;
- CWinEventsIOS::MessagePush(&newEvent);
-
- /* Store the tap action for later */
- memcpy(&lastEvent, &newEvent, sizeof(XBMC_Event));
+ CGPoint point = [touch locationInView:m_glView];
+ CGUIMessage message(GUI_MSG_GESTURE_NOTIFY, 0, 0, point.x, point.y);
+ if (g_windowManager.SendMessage(message))
+ {
+ lastAllowedGestures = message.GetParam1();
+ touchBeginSignaled = false;
+ lastGesturePoint = point;
+ }
}
//--------------------------------------------------------------
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
+ bool bNotify = false;
UITouch *touch = [touches anyObject];
- lastTouch = [touch locationInView:m_glView];
+ CGPoint point = [touch locationInView:m_glView];
+ CGFloat yMovement=point.y - lastGesturePoint.y;
+ CGFloat xMovement=point.x - lastGesturePoint.x;
+
+ if( xMovement && (lastAllowedGestures & EVENT_RESULT_PAN_HORIZONTAL) )
+ {
+ bNotify = true;
+ }
- //NSLog(@"%s touchesMoved x=%f, y=%f count=%d", __PRETTY_FUNCTION__, lastTouch.x, lastTouch.y, touch.tapCount);
+ if( yMovement && (lastAllowedGestures & EVENT_RESULT_PAN_VERTICAL) )
+ {
+ bNotify = true;
+ }
- static int nCount = 0;
+ if( bNotify )
+ {
+ if( !touchBeginSignaled )
+ {
+ g_application.getApplicationMessenger().SendAction(CAction(ACTION_GESTURE_BEGIN, 0, (float)point.x, (float)point.y,
+ 0, 0), WINDOW_INVALID);
+ touchBeginSignaled = true;
+ }
- /* Only process move when we are not in right click state */
- if(nCount == 4) {
-
- XBMC_Event newEvent;
- memcpy(&newEvent, &lastEvent, sizeof(XBMC_Event));
-
- newEvent.motion.x = lastTouch.x;
- newEvent.motion.y = lastTouch.y;
-
- CWinEventsIOS::MessagePush(&newEvent);
-
- nCount = 0;
-
- } else {
-
- nCount++;
-
+ g_application.getApplicationMessenger().SendAction(CAction(ACTION_GESTURE_PAN, 0, (float)point.x, (float)point.y,
+ xMovement, yMovement), WINDOW_INVALID);
+ lastGesturePoint = point;
}
}
//--------------------------------------------------------------
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
- lastTouch = [touch locationInView:m_glView];
-
- //NSLog(@"%s touchesEnded x=%f, y=%f count=%d", __PRETTY_FUNCTION__, lastTouch.x, lastTouch.y, [touch tapCount]);
-
- XBMC_Event newEvent;
- memcpy(&newEvent, &lastEvent, sizeof(XBMC_Event));
-
- newEvent.type = XBMC_MOUSEBUTTONUP;
- newEvent.button.type = XBMC_MOUSEBUTTONUP;
- newEvent.button.x = lastTouch.x;
- newEvent.button.y = lastTouch.y;
- CWinEventsIOS::MessagePush(&newEvent);
-
- memset(&lastEvent, 0x0, sizeof(XBMC_Event));
+ CGPoint point = [touch locationInView:m_glView];
+ if( [touch tapCount] == 1 )
+ {
+ XBMC_Event newEvent;
+ memset(&newEvent, 0, sizeof(newEvent));
+
+ newEvent.type = XBMC_MOUSEBUTTONDOWN;
+ newEvent.button.type = XBMC_MOUSEBUTTONDOWN;
+ newEvent.button.button = XBMC_BUTTON_LEFT;
+ newEvent.button.x = point.x;
+ newEvent.button.y = point.y;
+
+ CWinEventsIOS::MessagePush(&newEvent);
+
+ newEvent.type = XBMC_MOUSEBUTTONUP;
+ newEvent.button.type = XBMC_MOUSEBUTTONUP;
+ CWinEventsIOS::MessagePush(&newEvent);
+
+ memset(&lastEvent, 0x0, sizeof(XBMC_Event));
+ }
+ else
+ {
+ //TODO some inertial emulation here... threaded - should stop immediatly if touchesBegan is called
+ g_application.getApplicationMessenger().SendAction(CAction(ACTION_GESTURE_END),WINDOW_INVALID);
+ touchBeginSignaled = false;
+ lastAllowedGestures = 0;
+ }
}
//--------------------------------------------------------------
- (id)initWithFrame:(CGRect)frame
{
//NSLog(@"%s", __PRETTY_FUNCTION__);
-
+
self = [super init];
if ( !self )
return ( nil );
-
+
NSNotificationCenter *center;
center = [NSNotificationCenter defaultCenter];
[center addObserver: self
@@ -303,13 +278,13 @@ XBMCEAGLView *m_glView;
m_glView = [[XBMCEAGLView alloc] initWithFrame: srect];
[m_glView setMultipleTouchEnabled:YES];
-
+
//[self setView: m_glView];
-
+
[self.view addSubview: m_glView];
[self createGestureRecognizers];
-
+
g_xbmcController = self;
return self;
@@ -324,24 +299,24 @@ XBMCEAGLView *m_glView;
{
[m_glView stopAnimation];
[m_glView release];
-
+
NSNotificationCenter *center;
// take us off the default center for our app
center = [NSNotificationCenter defaultCenter];
[center removeObserver: self];
-
+
[super dealloc];
}
//--------------------------------------------------------------
- (void)viewWillAppear:(BOOL)animated
{
//NSLog(@"%s", __PRETTY_FUNCTION__);
-
+
// move this later into CocoaPowerSyscall
[[UIApplication sharedApplication] setIdleTimerDisabled:YES];
-
+
[self resumeAnimation];
-
+
[super viewWillAppear:animated];
}
//--------------------------------------------------------------
@@ -404,7 +379,7 @@ XBMCEAGLView *m_glView;
{
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
-
+
// Release any cached data, images, etc. that aren't in use.
}
//--------------------------------------------------------------
@@ -449,7 +424,7 @@ XBMCEAGLView *m_glView;
newEvent.appcommand.type = XBMC_APPCOMMAND;
newEvent.appcommand.action = ACTION_PLAYER_PLAY;
CWinEventsIOS::MessagePush(&newEvent);
-
+
[m_glView resumeAnimation];
}
//--------------------------------------------------------------
diff --git a/xbmc/utils/MathUtils.h b/xbmc/utils/MathUtils.h
index 69cfa247e0..649b352e29 100644
--- a/xbmc/utils/MathUtils.h
+++ b/xbmc/utils/MathUtils.h
@@ -35,7 +35,7 @@ namespace MathUtils
assert(x < static_cast <double>(INT_MAX / 2) + 1.0);
const float round_to_nearest = 0.5f;
int i;
-
+
#ifndef _LINUX
__asm
{
@@ -46,31 +46,39 @@ namespace MathUtils
sar i, 1
}
#else
- #if defined(__powerpc__) || defined(__ppc__) || defined(__arm__)
- i = floor(x + round_to_nearest);
- #else
- __asm__ __volatile__ (
- "fadd %%st\n\t"
- "fadd %%st(1)\n\t"
- "fistpl %0\n\t"
- "sarl $1, %0\n"
- : "=m"(i) : "u"(round_to_nearest), "t"(x) : "st"
- );
- #endif
+#if defined(__powerpc__) || defined(__ppc__)
+ i = floor(x + round_to_nearest);
+#elif defined(__arm__)
+ __asm__ __volatile__ (
+ "vmov.F64 d1,%[rnd_val] \n\t" // Copy 0.5 into a working register
+ "vadd.F64 %P[value],%P[value],d1 \n\t" // Add round_to_nearest to the working register
+ "vcvt.S32.F64 %[result],%P[value] \n\t" // Truncate(round towards zero) and store the result
+ : [result] "=w"(i), [value] "+w"(x) /* Outputs */
+ : [rnd_val] "Da" (round_to_nearest)
+ );
+#else
+ __asm__ __volatile__ (
+ "fadd %%st\n\t"
+ "fadd %%st(1)\n\t"
+ "fistpl %0\n\t"
+ "sarl $1, %0\n"
+ : "=m"(i) : "u"(round_to_nearest), "t"(x) : "st"
+ );
+#endif
#endif
return (i);
}
-
+
inline int ceil_int (double x)
{
assert(x > static_cast<double>(INT_MIN / 2) - 1.0);
assert(x < static_cast <double>(INT_MAX / 2) + 1.0);
-
- #if !defined(__powerpc__) && !defined(__ppc__) && !defined(__arm__)
- const float round_towards_p_i = -0.5f;
- #endif
+
+#if !defined(__powerpc__) && !defined(__ppc__) && !defined(__arm__)
+ const float round_towards_p_i = -0.5f;
+#endif
int i;
-
+
#ifndef _LINUX
__asm
{
@@ -81,31 +89,31 @@ namespace MathUtils
sar i, 1
}
#else
- #if defined(__powerpc__) || defined(__ppc__) || defined(__arm__)
- return (int)ceil(x);
- #else
- __asm__ __volatile__ (
- "fadd %%st\n\t"
- "fsubr %%st(1)\n\t"
- "fistpl %0\n\t"
- "sarl $1, %0\n"
- : "=m"(i) : "u"(round_towards_p_i), "t"(x) : "st"
- );
- #endif
+#if defined(__powerpc__) || defined(__ppc__) || defined(__arm__)
+ return (int)ceil(x);
+#else
+ __asm__ __volatile__ (
+ "fadd %%st\n\t"
+ "fsubr %%st(1)\n\t"
+ "fistpl %0\n\t"
+ "sarl $1, %0\n"
+ : "=m"(i) : "u"(round_towards_p_i), "t"(x) : "st"
+ );
+#endif
#endif
return (-i);
}
-
+
inline int truncate_int(double x)
{
assert(x > static_cast<double>(INT_MIN / 2) - 1.0);
assert(x < static_cast <double>(INT_MAX / 2) + 1.0);
-
- #if !defined(__powerpc__) && !defined(__ppc__) && !defined(__arm__)
- const float round_towards_m_i = -0.5f;
- #endif
+
+#if !defined(__powerpc__) && !defined(__ppc__) && !defined(__arm__)
+ const float round_towards_m_i = -0.5f;
+#endif
int i;
-
+
#ifndef _LINUX
__asm
{
@@ -117,29 +125,29 @@ namespace MathUtils
sar i, 1
}
#else
- #if defined(__powerpc__) || defined(__ppc__) || defined(__arm__)
- return (int)x;
- #else
- __asm__ __volatile__ (
- "fadd %%st\n\t"
- "fabs\n\t"
- "fadd %%st(1)\n\t"
- "fistpl %0\n\t"
- "sarl $1, %0\n"
- : "=m"(i) : "u"(round_towards_m_i), "t"(x) : "st"
- );
- #endif
+#if defined(__powerpc__) || defined(__ppc__) || defined(__arm__)
+ return (int)x;
+#else
+ __asm__ __volatile__ (
+ "fadd %%st\n\t"
+ "fabs\n\t"
+ "fadd %%st(1)\n\t"
+ "fistpl %0\n\t"
+ "sarl $1, %0\n"
+ : "=m"(i) : "u"(round_towards_m_i), "t"(x) : "st"
+ );
+#endif
#endif
if (x < 0)
i = -i;
return (i);
}
-
+
inline int64_t abs(int64_t a)
{
return (a < 0) ? -a : a;
}
-
+
inline void hack()
{
// stupid hack to keep compiler from dropping these
diff --git a/xbmc/utils/SystemInfo.cpp b/xbmc/utils/SystemInfo.cpp
index 8fb83a6a18..5f3445400b 100644
--- a/xbmc/utils/SystemInfo.cpp
+++ b/xbmc/utils/SystemInfo.cpp
@@ -711,19 +711,11 @@ bool CSysInfo::IsAppleTV()
bool CSysInfo::IsAppleTV2()
{
- bool result = false;
-#if defined(__APPLE__) && defined(__arm__)
- char buffer[512];
- size_t len = 512;
- std::string hw_machine = "unknown";
-
- if (sysctlbyname("hw.machine", &buffer, &len, NULL, 0) == 0)
- hw_machine = buffer;
-
- if (hw_machine.find("AppleTV2,1") != std::string::npos)
- result = true;
+#if defined(__APPLE__)
+ return DarwinIsAppleTV2();
+#else
+ return false;
#endif
- return result;
}
bool CSysInfo::HasVideoToolBoxDecoder()
diff --git a/xbmc/windowing/WinSystem.h b/xbmc/windowing/WinSystem.h
index 5029560054..c7be3bab13 100644
--- a/xbmc/windowing/WinSystem.h
+++ b/xbmc/windowing/WinSystem.h
@@ -70,6 +70,7 @@ public:
virtual void NotifyAppFocusChange(bool bGaining) {}
virtual void NotifyAppActiveChange(bool bActivated) {}
virtual void ShowOSMouse(bool show) {};
+ virtual bool HasCursor(){ return true; }
virtual bool Minimize() { return false; }
virtual bool Restore() { return false; }
diff --git a/xbmc/windowing/osx/WinSystemIOS.h b/xbmc/windowing/osx/WinSystemIOS.h
index 5c0ce54af8..c7dd6f25b3 100644
--- a/xbmc/windowing/osx/WinSystemIOS.h
+++ b/xbmc/windowing/osx/WinSystemIOS.h
@@ -44,6 +44,7 @@ public:
virtual void UpdateResolutions();
virtual void ShowOSMouse(bool show);
+ virtual bool HasCursor();
virtual void NotifyAppActiveChange(bool bActivated);
diff --git a/xbmc/windowing/osx/WinSystemIOS.mm b/xbmc/windowing/osx/WinSystemIOS.mm
index ca0889ee25..f36501b3ee 100644
--- a/xbmc/windowing/osx/WinSystemIOS.mm
+++ b/xbmc/windowing/osx/WinSystemIOS.mm
@@ -40,6 +40,7 @@
#import <OpenGLES/ES2/gl.h>
#import <OpenGLES/ES2/glext.h>
#import "XBMCController.h"
+#include "osx/DarwinUtils.h"
#import <dlfcn.h>
CWinSystemIOS::CWinSystemIOS() : CWinSystemBase()
@@ -200,6 +201,18 @@ void CWinSystemIOS::ShowOSMouse(bool show)
{
}
+bool CWinSystemIOS::HasCursor()
+{
+ if( DarwinIsAppleTV2() )
+ {
+ return true;
+ }
+ else//apple touch devices
+ {
+ return false;
+ }
+}
+
void CWinSystemIOS::NotifyAppActiveChange(bool bActivated)
{
if (bActivated && m_bWasFullScreenBeforeMinimize && !g_graphicsContext.IsFullScreenRoot())
diff --git a/xbmc/windows/GUIWindowPointer.cpp b/xbmc/windows/GUIWindowPointer.cpp
index bbbb936b0a..6a8030e773 100644
--- a/xbmc/windows/GUIWindowPointer.cpp
+++ b/xbmc/windows/GUIWindowPointer.cpp
@@ -21,6 +21,7 @@
#include "GUIWindowPointer.h"
#include "input/MouseStat.h"
+#include "windowing/WindowingFactory.h"
#include <climits>
#define ID_POINTER 10
@@ -56,10 +57,13 @@ void CGUIWindowPointer::SetPointer(int pointer)
void CGUIWindowPointer::UpdateVisibility()
{
- if (g_Mouse.IsActive())
- Show();
- else
- Close();
+ if(g_Windowing.HasCursor())
+ {
+ if (g_Mouse.IsActive())
+ Show();
+ else
+ Close();
+ }
}
void CGUIWindowPointer::OnWindowLoaded()