mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-06 10:44:01 +00:00
[client] wayland: split Wayland display server into modules
The Wayland display server is getting unwieldy due to the sheer size. To make it easier to edit in the future, I split it into many components based on logical boundaries.
This commit is contained in:
59
client/displayservers/Wayland/idle.c
Normal file
59
client/displayservers/Wayland/idle.c
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
Looking Glass - KVM FrameRelay (KVMFR) Client
|
||||
Copyright (C) 2021 Guanzhong Chen (quantum2048@gmail.com)
|
||||
Copyright (C) 2021 Tudor Brindus (contact@tbrindus.ca)
|
||||
https://looking-glass.io
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License as published by the Free Software
|
||||
Foundation; either version 2 of the License, or (at your option) any later
|
||||
version.
|
||||
|
||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with
|
||||
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "wayland.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <wayland-client.h>
|
||||
|
||||
#include "common/debug.h"
|
||||
|
||||
bool waylandIdleInit(void)
|
||||
{
|
||||
if (!wlWm.idleInhibitManager)
|
||||
DEBUG_WARN("zwp_idle_inhibit_manager_v1 not exported by compositor, will "
|
||||
"not be able to suppress idle states");
|
||||
return true;
|
||||
}
|
||||
|
||||
void waylandIdleFree(void)
|
||||
{
|
||||
if (wlWm.idleInhibitManager)
|
||||
{
|
||||
waylandUninhibitIdle();
|
||||
zwp_idle_inhibit_manager_v1_destroy(wlWm.idleInhibitManager);
|
||||
}
|
||||
}
|
||||
|
||||
void waylandInhibitIdle(void)
|
||||
{
|
||||
if (wlWm.idleInhibitManager && !wlWm.idleInhibitor)
|
||||
wlWm.idleInhibitor = zwp_idle_inhibit_manager_v1_create_inhibitor(
|
||||
wlWm.idleInhibitManager, wlWm.surface);
|
||||
}
|
||||
|
||||
void waylandUninhibitIdle(void)
|
||||
{
|
||||
if (wlWm.idleInhibitor)
|
||||
{
|
||||
zwp_idle_inhibitor_v1_destroy(wlWm.idleInhibitor);
|
||||
wlWm.idleInhibitor = NULL;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user