Merge pull request #9492 from nolange/fix_norandr_build

Cleanup X11 and XRANDR Macros
This commit is contained in:
Léo Lam
2021-03-01 11:36:39 +01:00
committed by GitHub
10 changed files with 19 additions and 20 deletions

View File

@ -39,7 +39,7 @@
#include "UICommon/UICommon.h"
#include "UICommon/USBUtils.h"
#if defined(HAVE_XRANDR) && HAVE_XRANDR
#ifdef HAVE_X11
#include "UICommon/X11Utils.h"
#endif
@ -394,7 +394,7 @@ bool TriggerSTMPowerEvent()
return true;
}
#if defined(HAVE_XRANDR) && HAVE_XRANDR
#ifdef HAVE_X11
void InhibitScreenSaver(Window win, bool inhibit)
#else
void InhibitScreenSaver(bool inhibit)
@ -403,7 +403,7 @@ void InhibitScreenSaver(bool inhibit)
// Inhibit the screensaver. Depending on the operating system this may also
// disable low-power states and/or screen dimming.
#if defined(HAVE_X11) && HAVE_X11
#ifdef HAVE_X11
X11Utils::InhibitScreensaver(win, inhibit);
#endif

View File

@ -13,7 +13,7 @@ namespace UICommon
void Init();
void Shutdown();
#if defined(HAVE_XRANDR) && HAVE_XRANDR
#ifdef HAVE_X11
void InhibitScreenSaver(unsigned long win, bool enable);
#else
void InhibitScreenSaver(bool enable);

View File

@ -11,7 +11,7 @@
#include <Windows.h>
#endif
#if defined(HAVE_XRANDR) && HAVE_XRANDR
#ifdef HAVE_XRANDR
#include "UICommon/X11Utils.h"
#endif

View File

@ -64,7 +64,7 @@ void InhibitScreensaver(Window win, bool suspend)
}
}
#if defined(HAVE_XRANDR) && HAVE_XRANDR
#ifdef HAVE_XRANDR
XRRConfiguration::XRRConfiguration(Display* _dpy, Window _win)
: dpy(_dpy), win(_win), screenResources(nullptr), outputInfo(nullptr), crtcInfo(nullptr),
fullMode(0), fs_fb_width(0), fs_fb_height(0), fs_fb_width_mm(0), fs_fb_height_mm(0),

View File

@ -7,7 +7,7 @@
#include <string>
#include <vector>
#if defined(HAVE_XRANDR) && HAVE_XRANDR
#ifdef HAVE_XRANDR
#include <X11/extensions/Xrandr.h>
#endif
#include <X11/Xlib.h>
@ -26,7 +26,7 @@ Display* XDisplayFromHandle(void* Handle);
void InhibitScreensaver(Window win, bool suspend);
#if defined(HAVE_XRANDR) && HAVE_XRANDR
#ifdef HAVE_XRANDR
class XRRConfiguration
{
public: