mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-08 22:52:54 -04:00
fixed compile on Linux with Qt5 (patch from sehraf)
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8116 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
ee68d00376
commit
a37ab6f644
2 changed files with 11 additions and 0 deletions
|
@ -73,7 +73,11 @@ bool IdlePlatform::init()
|
|||
old_handler = XSetErrorHandler(xerrhandler);
|
||||
|
||||
int event_base, error_base;
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||
if(XScreenSaverQueryExtension(QX11Info::display(), &event_base, &error_base)) {
|
||||
#else
|
||||
if(XScreenSaverQueryExtension(QApplication::desktop()->screen()->x11Info().display(), &event_base, &error_base)) {
|
||||
#endif
|
||||
d->ss_info = XScreenSaverAllocInfo();
|
||||
return true;
|
||||
}
|
||||
|
@ -84,7 +88,11 @@ int IdlePlatform::secondsIdle()
|
|||
{
|
||||
if(!d->ss_info)
|
||||
return 0;
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
|
||||
if(!XScreenSaverQueryInfo(QX11Info::display(), QX11Info::appRootWindow(), d->ss_info))
|
||||
#else
|
||||
if(!XScreenSaverQueryInfo(QApplication::desktop()->screen()->x11Info().display(), QX11Info::appRootWindow(), d->ss_info))
|
||||
#endif
|
||||
return 0;
|
||||
return d->ss_info->idle / 1000;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue