Quellcode durchsuchen

osx: remove presentation options

those options have been added long ago to avoid having troubles with topbar that would remain in some cases. Now this issue seems fixed.

It also has a side effect with OSX not allowing to show the topbar as other apps would when you hover the mouse on it.

Removing this to restore some OSX "standard behavior".
Lionel CHAZALLON vor 7 Jahren
Ursprung
Commit
840d5f8d86

+ 0 - 5
src/display/osx/DisplayManagerOSX.cpp

@@ -105,11 +105,6 @@ bool DisplayManagerOSX::setDisplayMode(int display, int mode)
     return false;
   }
 
-  // HACK : on OSX, switching display mode can leave dock in a state where mouse cursor
-  // will not hide on top of hidden dock, so we reset it state to fix this
-  OSXUtils::SetPresentationOptions(OSXUtils::GetPresentationOptionsForFullscreen(false));
-  OSXUtils::SetPresentationOptions(OSXUtils::GetPresentationOptionsForFullscreen(true));
-
   return true;
 }
 

+ 0 - 13
src/ui/KonvergoWindow.cpp

@@ -545,19 +545,6 @@ void KonvergoWindow::onVisibilityChanged(QWindow::Visibility visibility)
     SystemComponent::Get().setCursorVisibility(false);
   }
 
-#ifdef Q_OS_MAC
-  if (visibility == QWindow::Windowed)
-  {
-    QTimer::singleShot(1 * 1000, [this] { OSXUtils::SetPresentationOptions(m_osxPresentationOptions); });
-  }
-  else if (visibility == QWindow::FullScreen)
-  {
-    QTimer::singleShot(1 * 1000, [this] {
-      OSXUtils::SetPresentationOptions(m_osxPresentationOptions | OSXUtils::GetPresentationOptionsForFullscreen(!m_webDesktopMode));
-    });
-  }
-#endif
-
   InputComponent::Get().cancelAutoRepeat();
 }
 

+ 0 - 3
src/utils/osx/OSXUtils.h

@@ -9,9 +9,6 @@ namespace OSXUtils
   QString ComputerName();
   OSStatus SendAppleEventToSystemProcess(AEEventID eventToSendID);
 
-  void SetPresentationOptions(unsigned long flags);
-  unsigned long GetPresentationOptions();
-  unsigned long GetPresentationOptionsForFullscreen(bool hideMenuAndDock);
   void SetCursorVisible(bool visible);
 };
 

+ 0 - 33
src/utils/osx/OSXUtils.mm

@@ -2,39 +2,6 @@
 #include "QsLog.h"
 #import <Cocoa/Cocoa.h>
 
-/////////////////////////////////////////////////////////////////////////////////////////
-unsigned long OSXUtils::GetPresentationOptionsForFullscreen(bool hideMenuAndDock)
-{
-  unsigned long flags = 0;
-  if (hideMenuAndDock)
-  {
-    flags = flags & ~(NSApplicationPresentationAutoHideDock | NSApplicationPresentationAutoHideMenuBar);
-    flags |= NSApplicationPresentationHideDock | NSApplicationPresentationHideMenuBar;
-  }
-  else
-  {
-    flags = flags & ~(NSApplicationPresentationHideDock | NSApplicationPresentationHideMenuBar);
-    flags |= NSApplicationPresentationAutoHideDock | NSApplicationPresentationAutoHideMenuBar;
-  }
-
-  return flags;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-void OSXUtils::SetPresentationOptions(unsigned long flags)
-{
-  QLOG_DEBUG() << "Setting presentationOptions =" << flags;
-  [[NSApplication sharedApplication] setPresentationOptions:flags];
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-unsigned long OSXUtils::GetPresentationOptions()
-{
-  unsigned long options = [[NSApplication sharedApplication] presentationOptions];
-  QLOG_DEBUG() << "Getting presentationOptions =" << options;
-  return options;
-}
-
 /////////////////////////////////////////////////////////////////////////////////////////
 QString OSXUtils::ComputerName()
 {