Skip to content
This repository
Browse code

[osx] - since the osx windowing refactoring and sdk 10.6 bump we don'…

…t need to diddle with hiding the dock on resume anymore. The applescript approach had a flaw which just toggled the autohide option systemwide - which would overwrite usersettings. Just get rid of that cocoa stuff for autodock hiding and let the osx windowing do its magic.
  • Loading branch information...
commit 687abf2d7f169b8c5846f325e813603ff04570ac 1 parent 2896704
Memphiz authored November 25, 2012
39  xbmc/osx/CocoaInterface.mm
@@ -372,36 +372,19 @@ void Cocoa_ShowMouse()
372 372
   [NSCursor unhide];
373 373
 }
374 374
 
375  
-void Cocoa_HideDock()
  375
+//---------------------------------------------------------------------------------
  376
+void SetMenuBarVisible2(bool visible)
376 377
 {
377  
-  // Find which display we are on
378  
-  NSOpenGLContext* context = [NSOpenGLContext currentContext];
379  
-  if (context)
  378
+  if(visible)
380 379
   {
381  
-    NSView* view;
382  
-
383  
-    view = [context view];
384  
-    if (view)
385  
-    {
386  
-      NSWindow* window;
387  
-      window = [view window];
388  
-      if (window)
389  
-      {
390  
-        NSDictionary* screenInfo = [[window screen] deviceDescription];
391  
-        NSNumber* screenID = [screenInfo objectForKey:@"NSScreenNumber"];
392  
-        if (kCGDirectMainDisplay == (CGDirectDisplayID)[screenID longValue])
393  
-        {
394  
-          CStdString tmp_str;
395  
-
396  
-          // keep the dock hidden using applescriptif on main screen with the dock.
397  
-          tmp_str = "tell application \"System Events\" \n";
398  
-          tmp_str += "keystroke \"d\" using {command down, option down} \n";
399  
-          tmp_str += "end tell \n";
400  
-          
401  
-          Cocoa_DoAppleScript( tmp_str.c_str() );
402  
-        }
403  
-      }
404  
-    }
  380
+    [[NSApplication sharedApplication]
  381
+      setPresentationOptions:   NSApplicationPresentationDefault];
  382
+  }
  383
+  else
  384
+  {
  385
+    [[NSApplication sharedApplication]
  386
+      setPresentationOptions:   NSApplicationPresentationHideMenuBar |
  387
+                                NSApplicationPresentationHideDock];
405 388
   }
406 389
 }
407 390
 
4  xbmc/powermanagement/osx/CocoaPowerSyscall.cpp
@@ -239,10 +239,6 @@ bool CCocoaPowerSyscall::PumpPowerEvents(IPowerEventsCallback *callback)
239 239
   else if (m_OnResume)
240 240
   {
241 241
     callback->OnWake();
242  
-#if !defined(TARGET_DARWIN_IOS)
243  
-    if (g_Windowing.IsFullScreen())
244  
-      Cocoa_HideDock();
245  
-#endif
246 242
     m_OnResume = false;
247 243
   } 
248 244
   

0 notes on commit 687abf2

Please sign in to comment.
Something went wrong with that request. Please try again.