Mercurial > mplayer.hg
comparison libvo/x11_common.c @ 25466:9ee347c404c9
Add support for XScreenSaverSuspend
author | reimar |
---|---|
date | Sat, 22 Dec 2007 11:09:43 +0000 |
parents | 3c9a46550d16 |
children | fa7aa062be2d |
comparison
equal
deleted
inserted
replaced
25465:6b9447dc7590 | 25466:9ee347c404c9 |
---|---|
1700 static void xscreensaver_enable(void) | 1700 static void xscreensaver_enable(void) |
1701 { | 1701 { |
1702 xs_windowid = 0; | 1702 xs_windowid = 0; |
1703 } | 1703 } |
1704 | 1704 |
1705 static int xss_suspend(Bool suspend) | |
1706 { | |
1707 #ifndef HAVE_XSS | |
1708 return 0; | |
1709 #else | |
1710 int event, error, major, minor; | |
1711 if (XScreenSaverQueryExtension(mDisplay, &event, &error) != True || | |
1712 XScreenSaverQueryVersion(mDisplay, &major, &minor) != True) | |
1713 return 0; | |
1714 if (major < 1 || major == 1 && minor < 1) | |
1715 return 0; | |
1716 XScreenSaverSuspend(mDisplay, suspend); | |
1717 return 1; | |
1718 #endif | |
1719 } | |
1720 | |
1705 /* | 1721 /* |
1706 * End of XScreensaver stuff | 1722 * End of XScreensaver stuff |
1707 */ | 1723 */ |
1708 | 1724 |
1709 void saver_on(Display * mDisplay) | 1725 void saver_on(Display * mDisplay) |
1710 { | 1726 { |
1711 | 1727 |
1728 if (xss_suspend(False)) | |
1729 return; | |
1712 #ifdef HAVE_XDPMS | 1730 #ifdef HAVE_XDPMS |
1713 if (dpms_disabled) | 1731 if (dpms_disabled) |
1714 { | 1732 { |
1715 int nothing; | 1733 int nothing; |
1716 if (DPMSQueryExtension(mDisplay, ¬hing, ¬hing)) | 1734 if (DPMSQueryExtension(mDisplay, ¬hing, ¬hing)) |
1765 | 1783 |
1766 } | 1784 } |
1767 | 1785 |
1768 void saver_off(Display * mDisplay) | 1786 void saver_off(Display * mDisplay) |
1769 { | 1787 { |
1788 int nothing; | |
1789 | |
1790 if (xss_suspend(True)) | |
1791 return; | |
1770 #ifdef HAVE_XDPMS | 1792 #ifdef HAVE_XDPMS |
1771 int nothing; | |
1772 | |
1773 if (DPMSQueryExtension(mDisplay, ¬hing, ¬hing)) | 1793 if (DPMSQueryExtension(mDisplay, ¬hing, ¬hing)) |
1774 { | 1794 { |
1775 BOOL onoff; | 1795 BOOL onoff; |
1776 CARD16 state; | 1796 CARD16 state; |
1777 | 1797 |