mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
idle-monitor: Use the XSync idle monitor under X11 nested
This commit is contained in:
parent
2d6bcf3885
commit
f3ee9be4cb
@ -163,10 +163,12 @@ meta_idle_monitor_init (MetaIdleMonitor *monitor)
|
||||
static GType
|
||||
get_idle_monitor_type (void)
|
||||
{
|
||||
if (meta_is_wayland_compositor ())
|
||||
return META_TYPE_IDLE_MONITOR_NATIVE;
|
||||
else
|
||||
#if defined(CLUTTER_WINDOWING_X11)
|
||||
if (clutter_check_windowing_backend (CLUTTER_WINDOWING_X11))
|
||||
return META_TYPE_IDLE_MONITOR_XSYNC;
|
||||
#endif
|
||||
|
||||
return META_TYPE_IDLE_MONITOR_NATIVE;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -358,10 +360,14 @@ meta_idle_monitor_xsync_handle_xevent_all (XEvent *xevent)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (meta_is_wayland_compositor ())
|
||||
return;
|
||||
|
||||
for (i = 0; i <= device_id_max; i++)
|
||||
if (device_monitors[i])
|
||||
meta_idle_monitor_xsync_handle_xevent (device_monitors[i], (XSyncAlarmNotifyEvent*)xevent);
|
||||
{
|
||||
if (device_monitors[i])
|
||||
{
|
||||
if (!META_IS_IDLE_MONITOR_XSYNC (device_monitors[i]))
|
||||
return;
|
||||
|
||||
meta_idle_monitor_xsync_handle_xevent (device_monitors[i], (XSyncAlarmNotifyEvent*)xevent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,8 @@
|
||||
#include "meta-idle-monitor-xsync.h"
|
||||
#include "meta-idle-monitor-private.h"
|
||||
|
||||
#include <clutter/x11/clutter-x11.h>
|
||||
|
||||
#include <meta/util.h>
|
||||
#include "display-private.h"
|
||||
|
||||
@ -192,9 +194,7 @@ meta_idle_monitor_xsync_constructed (GObject *object)
|
||||
{
|
||||
MetaIdleMonitorXSync *monitor_xsync = META_IDLE_MONITOR_XSYNC (object);
|
||||
|
||||
g_assert (!meta_is_wayland_compositor ());
|
||||
|
||||
monitor_xsync->display = meta_get_display ()->xdisplay;
|
||||
monitor_xsync->display = clutter_x11_get_default_display ();;
|
||||
init_xsync (monitor_xsync);
|
||||
|
||||
G_OBJECT_CLASS (meta_idle_monitor_xsync_parent_class)->constructed (object);
|
||||
|
@ -1877,8 +1877,10 @@ handle_idletime_for_event (const ClutterEvent *event)
|
||||
int device_id;
|
||||
|
||||
/* This is handled by XSync under X11. */
|
||||
if (!meta_is_wayland_compositor ())
|
||||
#if defined(CLUTTER_WINDOWING_X11)
|
||||
if (clutter_check_windowing_backend (CLUTTER_WINDOWING_X11))
|
||||
return;
|
||||
#endif
|
||||
|
||||
device = clutter_event_get_device (event);
|
||||
if (device == NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user