1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Merge pull request #2 from stqism/patch-7

Fixes global autoaway on OS X
This commit is contained in:
novist 2014-11-26 18:59:15 +02:00
commit 13dd4304c1
2 changed files with 5 additions and 5 deletions

View File

@ -70,7 +70,7 @@ win32 {
BUNDLEID = im.tox.qtox
ICON = img/icons/qtox.icns
QMAKE_INFO_PLIST = osx/info.plist
LIBS += -L$$PWD/libs/lib/ -ltoxcore -ltoxav -ltoxencryptsave -ltoxdns -lsodium -lvpx -framework OpenAL -lopencv_core -lopencv_highgui
LIBS += -L$$PWD/libs/lib/ -ltoxcore -ltoxav -ltoxencryptsave -ltoxdns -lsodium -lvpx -framework OpenAL -framework IOKit -lopencv_core -lopencv_highgui -framework CoreFoundation
} else {
# If we're building a package, static link libtox[core,av] and libsodium, since they are not provided by any package
contains(STATICPKG, YES) {

View File

@ -1,8 +1,8 @@
#include "platform.h"
#include <QDebug>
#if defined(Q_OS_WIN)
#if defined(Q_OS_WIN32)
#include <Windows.h>
#elif defined(Q_OS_DARWIN) && defined(HAVE_IOKIT)
#elif defined(__APPLE__) && defined(__MACH__)
#include <IOKit/IOKitLib.h>
#include <CoreFoundation/CoreFoundation.h>
#else // Q_OS_UNIX
@ -17,11 +17,11 @@ u_int32_t Platform::getIdleTime()
// https://hg.pidgin.im/pidgin/main/file/13e4ae613a6a/pidgin/gtkidle.c
u_int32_t idleTime = 0;
#if defined(Q_OS_WIN)
#if defined(Q_OS_WIN32)
LASTINPUTINFO info = { 0 };
if(GetLastInputInfo(&info))
idleTime = info.dwTime / 1000;
#elif defined(Q_OS_DARWIN) && defined(HAVE_IOKIT)
#elif defined(__APPLE__) && defined(__MACH__)
static io_service_t service = NULL;
CFTypeRef property;
u_int64_t idleTime_ns = 0;