void
CXWindowsScreenSaver::activate()
{
	// remove disable job timer
	m_suppressDisable = true;
	updateDisableTimer();

	// enable DPMS if it was enabled
	enableDPMS(m_dpmsEnabled);

	// try xscreensaver
	findXScreenSaver();
	if (m_xscreensaver != None) {
		sendXScreenSaverCommand(m_atomScreenSaverActivate);
		return;
	}

	// try built-in X screen saver
	if (m_timeout != 0) {
		XForceScreenSaver(m_display, ScreenSaverActive);
	}

	// try DPMS
	activateDPMS(true);
}
void
CXWindowsScreenSaver::deactivate()
{
	// reinstall disable job timer
	m_suppressDisable = false;
	updateDisableTimer();

	// try DPMS
	activateDPMS(false);

	// disable DPMS if screen saver is disabled
	if (m_disabled) {
		enableDPMS(false);
	}

	// try xscreensaver
	findXScreenSaver();
	if (m_xscreensaver != None) {
		sendXScreenSaverCommand(m_atomScreenSaverDeactivate);
		return;
	}

	// use built-in X screen saver
	XForceScreenSaver(m_display, ScreenSaverReset);
}
void
CXWindowsScreenSaver::activate()
{
	// remove disable job timer
	m_suppressDisable = true;
	updateDisableJob();

	// try xscreensaver
	findXScreenSaver();
	if (m_xscreensaver != None) {
		sendXScreenSaverCommand(m_atomScreenSaverActivate);
		return;
	}

	// use built-in X screen saver
	XForceScreenSaver(m_display, ScreenSaverActive);
}