mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-31 11:35:24 +01:00
parent
4a96ce9561
commit
a1361dfa7e
@ -5,6 +5,7 @@
|
||||
|
||||
class MacGlobalShortcutBackend;
|
||||
class QObject;
|
||||
class QWidget;
|
||||
|
||||
class PlatformInterface {
|
||||
public:
|
||||
@ -28,6 +29,7 @@ QString GetApplicationSupportPath();
|
||||
QString GetMusicDirectory();
|
||||
|
||||
bool MigrateLegacyConfigFiles();
|
||||
void EnableFullScreen(const QWidget& main_window);
|
||||
|
||||
} // namespace mac
|
||||
|
||||
|
@ -52,11 +52,13 @@
|
||||
#import <Sparkle/SUUpdater.h>
|
||||
#endif
|
||||
|
||||
#include <QApplication>
|
||||
#include <QCoreApplication>
|
||||
#include <QDir>
|
||||
#include <QEvent>
|
||||
#include <QFile>
|
||||
#include <QSettings>
|
||||
#include <QWidget>
|
||||
|
||||
#include <QtDebug>
|
||||
|
||||
@ -472,4 +474,17 @@ void DumpDictionary(CFDictionaryRef dict) {
|
||||
NSLog(@"%@", d);
|
||||
}
|
||||
|
||||
// NSWindowCollectionBehaviorFullScreenPrimary
|
||||
static const NSUInteger kFullScreenPrimary = 1 << 7;
|
||||
|
||||
void EnableFullScreen(const QWidget& main_window) {
|
||||
if (QSysInfo::MacintoshVersion == QSysInfo::MV_SNOWLEOPARD) {
|
||||
return; // Unsupported on 10.6
|
||||
}
|
||||
|
||||
NSView* view = reinterpret_cast<NSView*>(main_window.winId());
|
||||
NSWindow* window = [view window];
|
||||
[window setCollectionBehavior: kFullScreenPrimary];
|
||||
}
|
||||
|
||||
} // namespace mac
|
||||
|
@ -431,6 +431,9 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
// Window
|
||||
MainWindow w(&app, tray_icon.get(), &osd);
|
||||
#ifdef Q_OS_DARWIN
|
||||
mac::EnableFullScreen(w);
|
||||
#endif // Q_OS_DARWIN
|
||||
#ifdef HAVE_GIO
|
||||
ScanGIOModulePath();
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user