mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 13:37:22 +00:00
[client] x11: implement screensaver (un)inhibit
This commit is contained in:
parent
d1043e590a
commit
ee8c883201
@ -5,6 +5,7 @@ find_package(PkgConfig)
|
|||||||
pkg_check_modules(DISPLAYSERVER_X11_PKGCONFIG REQUIRED
|
pkg_check_modules(DISPLAYSERVER_X11_PKGCONFIG REQUIRED
|
||||||
x11
|
x11
|
||||||
xfixes
|
xfixes
|
||||||
|
xscrnsaver
|
||||||
)
|
)
|
||||||
|
|
||||||
pkg_check_modules(DISPLAYSERVER_X11_OPT_PKGCONFIG
|
pkg_check_modules(DISPLAYSERVER_X11_OPT_PKGCONFIG
|
||||||
|
@ -27,6 +27,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <X11/extensions/XInput2.h>
|
#include <X11/extensions/XInput2.h>
|
||||||
|
#include <X11/extensions/scrnsaver.h>
|
||||||
#include <X11/extensions/Xfixes.h>
|
#include <X11/extensions/Xfixes.h>
|
||||||
|
|
||||||
#include "app.h"
|
#include "app.h"
|
||||||
@ -669,6 +670,16 @@ static void x11WarpPointer(int x, int y, bool exiting)
|
|||||||
XSync(x11.display, False);
|
XSync(x11.display, False);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void x11InhibitIdle(void)
|
||||||
|
{
|
||||||
|
XScreenSaverSuspend(x11.display, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void x11UninhibitIdle(void)
|
||||||
|
{
|
||||||
|
XScreenSaverSuspend(x11.display, false);
|
||||||
|
}
|
||||||
|
|
||||||
static bool x11CBInit()
|
static bool x11CBInit()
|
||||||
{
|
{
|
||||||
x11.aSelection = XInternAtom(x11.display, "CLIPBOARD" , False);
|
x11.aSelection = XInternAtom(x11.display, "CLIPBOARD" , False);
|
||||||
@ -1011,9 +1022,8 @@ struct LG_DisplayServerOps LGDS_X11 =
|
|||||||
.ungrabKeyboard = x11UngrabKeyboard,
|
.ungrabKeyboard = x11UngrabKeyboard,
|
||||||
.warpPointer = x11WarpPointer,
|
.warpPointer = x11WarpPointer,
|
||||||
|
|
||||||
/* Use SDL implementation for now */
|
.inhibitIdle = x11InhibitIdle,
|
||||||
.inhibitIdle = NULL,
|
.uninhibitIdle = x11UninhibitIdle,
|
||||||
.uninhibitIdle = NULL,
|
|
||||||
|
|
||||||
.cbInit = x11CBInit,
|
.cbInit = x11CBInit,
|
||||||
.cbNotice = x11CBNotice,
|
.cbNotice = x11CBNotice,
|
||||||
|
Loading…
Reference in New Issue
Block a user