Support Control-Cmd-F to exit full screen

It is common for many fullscreen apps to use this command
sequence to exit full-screen (e.g. Chrome, Safari).
This commit is contained in:
Mark Liversedge
2011-11-01 15:41:40 +00:00
parent bae9ce8bc1
commit a09e2d1348

View File

@@ -37,7 +37,9 @@ LionFullScreen::eventFilter(QObject *obj, QEvent *event)
if (obj != main) return false;
if (event->type() == QEvent::KeyPress &&
static_cast<QKeyEvent *>(event)->key() == Qt::Key_Escape) {
(static_cast<QKeyEvent *>(event)->key() == Qt::Key_Escape ||
(static_cast<QKeyEvent *>(event)->key() == Qt::Key_F &&
static_cast<QKeyEvent *>(event)->modifiers() == (Qt::MetaModifier|Qt::ControlModifier)))) {
// if in full screen then toggle, otherwise do nothing
NSView *nsview = (NSView *) main->winId();