Skip to content

Commit

Permalink
Merge pull request #5 from Daxx/master
Browse files Browse the repository at this point in the history
Adjust nativeEventFilter install method
  • Loading branch information
user-none committed Apr 14, 2015
2 parents 51bf347 + 63e1da3 commit adac615
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 11 deletions.
4 changes: 0 additions & 4 deletions src/application.cpp
Expand Up @@ -22,19 +22,15 @@

Application::Application(const QString &appId, int &argc, char **argv) : QtSingleApplication(appId, argc, argv) {
m_kdocker = 0;
m_filter = 0;
}

void Application::setKDockerInstance(KDocker *kdocker) {
m_kdocker = kdocker;
m_filter = m_kdocker-> getTrayItemManager();
installNativeEventFilter(m_filter);
}

void Application::close() {
if (m_kdocker) {
m_kdocker->undockAll();
}
removeNativeEventFilter(m_filter);
quit();
}
1 change: 0 additions & 1 deletion src/application.h
Expand Up @@ -36,7 +36,6 @@ class Application : public QtSingleApplication {

private:
KDocker *m_kdocker;
TrayItemManager *m_filter;
};

#endif /* _APPLICATION_H */
4 changes: 0 additions & 4 deletions src/kdocker.cpp
Expand Up @@ -46,10 +46,6 @@ KDocker::~KDocker() {
}
}

TrayItemManager *KDocker::getTrayItemManager() {
return m_trayItemManager;
}

void KDocker::undockAll() {
if (m_trayItemManager) {
m_trayItemManager->undockAll();
Expand Down
2 changes: 0 additions & 2 deletions src/kdocker.h
Expand Up @@ -36,8 +36,6 @@ class KDocker : public QObject {
KDocker();
~KDocker();

TrayItemManager *getTrayItemManager();

void undockAll();

void preProcessCommand(int argc, char **argv);
Expand Down
2 changes: 2 additions & 0 deletions src/trayitemmanager.cpp
Expand Up @@ -56,6 +56,7 @@ TrayItemManager::TrayItemManager() {
// The isValidWindowId function in util.cpp will generate errors if the
// window is not valid while it is checking.
XSetErrorHandler(ignoreXErrors);
qApp-> installNativeEventFilter(this);
}

TrayItemManager::~TrayItemManager() {
Expand All @@ -66,6 +67,7 @@ TrayItemManager::~TrayItemManager() {
delete m_grabInfo.qtimer;
delete m_grabInfo.qloop;
delete m_scanner;
qApp-> removeNativeEventFilter(this);
}

/* The X11 Event Filter. Pass on events to the TrayItems that we created. */
Expand Down

0 comments on commit adac615

Please sign in to comment.