summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_randr.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/lib/ecore_x/xlib/ecore_x_randr.c b/src/lib/ecore_x/xlib/ecore_x_randr.c
index 7191f38067..1d003a72f1 100644
--- a/src/lib/ecore_x/xlib/ecore_x_randr.c
+++ b/src/lib/ecore_x/xlib/ecore_x_randr.c
@@ -1780,6 +1780,42 @@ ecore_x_randr_crtc_pos_relative_set(Ecore_X_Window root, Ecore_X_Randr_Crtc crtc
1780} 1780}
1781 1781
1782/* 1782/*
1783 * @since 1.8
1784 */
1785EAPI Ecore_X_Randr_Crtc_Info *
1786ecore_x_randr_crtc_info_get(Ecore_X_Window root, const Ecore_X_Randr_Crtc crtc)
1787{
1788#ifdef ECORE_XRANDR
1789 XRRScreenResources *res = NULL;
1790
1791 if (_randr_version < RANDR_VERSION_1_2) return NULL;
1792
1793 /* try to get the screen resources from Xrandr */
1794 if ((res = _ecore_x_randr_screen_resources_get(_ecore_x_disp, root)))
1795 {
1796 XRRCrtcInfo *info = NULL;
1797 Ecore_X_Randr_Crtc_Info *ret = NULL;
1798
1799 /* try to get crtc info */
1800 if ((info = XRRGetCrtcInfo(_ecore_x_disp, res, crtc)))
1801 {
1802 if ((ret = malloc(sizeof(Ecore_X_Randr_Crtc_Info))))
1803 memcpy(ret, info, sizeof(Ecore_X_Randr_Crtc_Info));
1804
1805 /* free the crtc info */
1806 XRRFreeCrtcInfo(info);
1807 }
1808
1809 /* free the resources */
1810 XRRFreeScreenResources(res);
1811
1812 return ret;
1813 }
1814#endif
1815 return NULL;
1816}
1817
1818/*
1783 * @brief Add given mode to given output. 1819 * @brief Add given mode to given output.
1784 * 1820 *
1785 * @param output The output the mode is added to. 1821 * @param output The output the mode is added to.