Fixed Issue #24: Display not turning on from Synergy Input

This commit is contained in:
syed.amer@gilani.eu 2009-03-29 13:14:07 +00:00
parent 8b2f75f376
commit a4464ffb4b
1 changed files with 16 additions and 0 deletions

View File

@ -36,6 +36,9 @@
# define XK_MISCELLANY # define XK_MISCELLANY
# define XK_XKB_KEYS # define XK_XKB_KEYS
# include <X11/keysymdef.h> # include <X11/keysymdef.h>
extern "C" {
# include <X11/extensions/dpms.h>
}
# if HAVE_X11_EXTENSIONS_XTEST_H # if HAVE_X11_EXTENSIONS_XTEST_H
# include <X11/extensions/XTest.h> # include <X11/extensions/XTest.h>
# else # else
@ -230,6 +233,19 @@ CXWindowsScreen::enter()
XSetInputFocus(m_display, m_lastFocus, m_lastFocusRevert, CurrentTime); XSetInputFocus(m_display, m_lastFocus, m_lastFocusRevert, CurrentTime);
} }
// Force the DPMS to turn screen back on since we don't
// actually cause physical hardware input to trigger it
int dummy;
CARD16 powerlevel;
BOOL enabled;
if (DPMSQueryExtension(m_display, &dummy, &dummy) &&
DPMSCapable(m_display) &&
DPMSInfo(m_display, &powerlevel, &enabled))
{
if (enabled && powerlevel != DPMSModeOn)
DPMSForceLevel(m_display, DPMSModeOn);
}
// unmap the hider/grab window. this also ungrabs the mouse and // unmap the hider/grab window. this also ungrabs the mouse and
// keyboard if they're grabbed. // keyboard if they're grabbed.
XUnmapWindow(m_display, m_window); XUnmapWindow(m_display, m_window);