DolphinQt2: FocusEventFilter -> WindowActivationEventFilter

This commit is contained in:
Michael Maltese committed 2017-06-15 16:12:05 -07:00
1 parent 220ce425cd
commit 5b3b6b7f3d
6 files changed
+33 -31

No files matched your search

@@ -1,19 +0,0 @@
// Copyright 2017 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#include <QEvent>
#include <QObject>
#include "DolphinQt2/QtUtils/FocusEventFilter.h"
bool FocusEventFilter::eventFilter(QObject* object, QEvent* event)
{
if (event->type() == QEvent::FocusOut)
emit focusOutEvent();
if (event->type() == QEvent::FocusIn)
emit focusInEvent();
return false;
}
@@ -0,0 +1,19 @@
// Copyright 2017 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#include <QEvent>
#include <QObject>
#include "DolphinQt2/QtUtils/WindowActivationEventFilter.h"
bool WindowActivationEventFilter::eventFilter(QObject* object, QEvent* event)
{
if (event->type() == QEvent::WindowDeactivate)
emit windowDeactivated();
if (event->type() == QEvent::WindowActivate)
emit windowActivated();
return false;
}
@@ -6,12 +6,12 @@
#include <QObject>
class FocusEventFilter : public QObject
class WindowActivationEventFilter : public QObject
{
Q_OBJECT
signals:
void focusInEvent();
void focusOutEvent();
void windowActivated();
void windowDeactivated();
private:
bool eventFilter(QObject* object, QEvent* event) override;