Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

Commit

Permalink
merged: r35545,r35546 from trunk:
Browse files Browse the repository at this point in the history
added: [osx] Cocoa_ShowCursor to complement Cocoa_HideCursor (cherry picked from commit 1762b2e9e8fa8ff59bbf222d2a99cbbe2dc2e99b)
fixed: Ensure the mouse cursor is really hidden when in fullscreen (and that it comes back again when not).  Ideally this can be cleaned up once we move away from SDL (cherry picked from commit ed432147a55fd8b4057824e716cadd5302e90fb5)

git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/Dharma@35551 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
  • Loading branch information
jmarshallnz committed Nov 30, 2010
1 parent 98fcc62 commit 47b493d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
10 changes: 10 additions & 0 deletions xbmc/Application.cpp
Expand Up @@ -4685,6 +4685,16 @@ void CApplication::ProcessSlow()
{
g_powerManager.ProcessEvents();

#if defined(__APPLE__)
// There is an issue on OS X that several system services ask the cursor to become visible
// during their startup routines. Given that we can't control this, we hack it in by
// forcing the
if (g_Windowing.IsFullScreen())
{ // SDL thinks it's hidden
Cocoa_HideMouse();
}
#endif

// Store our file state for use on close()
UpdateFileState();

Expand Down
8 changes: 8 additions & 0 deletions xbmc/WinEventsSDL.cpp
Expand Up @@ -28,6 +28,9 @@
#endif
#include "MouseStat.h"
#include "WindowingFactory.h"
#if defined(__APPLE__)
#include "osx/CocoaInterface.h"
#endif

#ifdef HAS_SDL_WIN_EVENTS

Expand Down Expand Up @@ -149,6 +152,11 @@ bool CWinEventsSDL::MessagePump()
if (0 == (SDL_GetAppState() & SDL_APPMOUSEFOCUS))
{
g_Mouse.SetActive(false);
#if defined(__APPLE__)
// See CApplication::ProcessSlow() for a description as to why we call Cocoa_HideMouse.
// this is here to restore the pointer when toggling back to window mode from fullscreen.
Cocoa_ShowMouse();
#endif
break;
}
XBMC_Event newEvent;
Expand Down
1 change: 1 addition & 0 deletions xbmc/osx/CocoaInterface.h
Expand Up @@ -71,6 +71,7 @@ extern "C"
// Mouse.
//
void Cocoa_HideMouse();
void Cocoa_ShowMouse();
void Cocoa_HideDock();

// Smart folders.
Expand Down
5 changes: 5 additions & 0 deletions xbmc/osx/CocoaInterface.mm
Expand Up @@ -421,6 +421,11 @@ void Cocoa_HideMouse()
[NSCursor hide];
}

void Cocoa_ShowMouse()
{
[NSCursor unhide];
}

void Cocoa_HideDock()
{
// Find which display we are on
Expand Down

0 comments on commit 47b493d

Please sign in to comment.