summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/ecore_x/Ecore_X.h1
-rw-r--r--src/lib/ecore_x/xcb/ecore_xcb_randr.c36
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_randr.c35
3 files changed, 72 insertions, 0 deletions
diff --git a/src/lib/ecore_x/Ecore_X.h b/src/lib/ecore_x/Ecore_X.h
index a23b1739c6..876770474f 100644
--- a/src/lib/ecore_x/Ecore_X.h
+++ b/src/lib/ecore_x/Ecore_X.h
@@ -1986,6 +1986,7 @@ typedef struct _Ecore_X_Randr_Crtc_Gamma_Info
1986 1986
1987EAPI int ecore_x_randr_version_get(void); 1987EAPI int ecore_x_randr_version_get(void);
1988EAPI Eina_Bool ecore_x_randr_query(void); 1988EAPI Eina_Bool ecore_x_randr_query(void);
1989EAPI Ecore_X_Time ecore_x_randr_config_timestamp_get(Ecore_X_Window root); /** @since 1.8 */
1989EAPI Ecore_X_Randr_Orientation ecore_x_randr_screen_primary_output_orientations_get(Ecore_X_Window root); 1990EAPI Ecore_X_Randr_Orientation ecore_x_randr_screen_primary_output_orientations_get(Ecore_X_Window root);
1990EAPI Ecore_X_Randr_Orientation ecore_x_randr_screen_primary_output_orientation_get(Ecore_X_Window root); 1991EAPI Ecore_X_Randr_Orientation ecore_x_randr_screen_primary_output_orientation_get(Ecore_X_Window root);
1991EAPI Eina_Bool ecore_x_randr_screen_primary_output_orientation_set(Ecore_X_Window root, Ecore_X_Randr_Orientation orientation); 1992EAPI Eina_Bool ecore_x_randr_screen_primary_output_orientation_set(Ecore_X_Window root, Ecore_X_Randr_Orientation orientation);
diff --git a/src/lib/ecore_x/xcb/ecore_xcb_randr.c b/src/lib/ecore_x/xcb/ecore_xcb_randr.c
index 2bb43c17ce..a429b35f03 100644
--- a/src/lib/ecore_x/xcb/ecore_xcb_randr.c
+++ b/src/lib/ecore_x/xcb/ecore_xcb_randr.c
@@ -254,6 +254,42 @@ ecore_x_randr_version_get(void)
254 return _randr_version; 254 return _randr_version;
255} 255}
256 256
257/**
258 * @brief This function returns the current config timestamp from
259 * XRRScreenConfiguration.
260 *
261 * @params root root window to query screen configuration from
262 *
263 * @returns The screen configuration timestamp
264 *
265 * @since 1.8
266 */
267EAPI Ecore_X_Time
268ecore_x_randr_config_timestamp_get(Ecore_X_Window root)
269{
270 Ecore_X_Time timestamp = 0;
271
272#ifdef ECORE_XCB_RANDR
273 xcb_randr_get_screen_info_cookie_t cookie;
274 xcb_randr_get_screen_info_reply_t *reply;
275#endif
276
277 LOGFN(__FILE__, __LINE__, __FUNCTION__);
278 CHECK_XCB_CONN;
279
280#ifdef ECORE_XCB_RANDR
281 cookie = xcb_randr_get_screen_info_unchecked(_ecore_xcb_conn, root);
282 reply = xcb_randr_get_screen_info_reply(_ecore_xcb_conn, cookie, NULL);
283 if (reply)
284 {
285 timestamp = (Ecore_X_Time)reply->config_timestamp;
286 free(reply);
287 }
288#endif
289
290 return timestamp;
291}
292
257/* 293/*
258 * @param root window which's primary output will be queried 294 * @param root window which's primary output will be queried
259 */ 295 */
diff --git a/src/lib/ecore_x/xlib/ecore_x_randr.c b/src/lib/ecore_x/xlib/ecore_x_randr.c
index 22b7e1cbd1..b6f74f0154 100644
--- a/src/lib/ecore_x/xlib/ecore_x_randr.c
+++ b/src/lib/ecore_x/xlib/ecore_x_randr.c
@@ -85,6 +85,41 @@ ecore_x_randr_query(void)
85 return _randr_avail; 85 return _randr_avail;
86} 86}
87 87
88/**
89 * @brief This function returns the current config timestamp from
90 * XRRScreenConfiguration.
91 *
92 * @params root root window to query screen configuration from
93 *
94 * @returns The screen configuration timestamp
95 *
96 * @since 1.8
97 */
98EAPI Ecore_X_Time
99ecore_x_randr_config_timestamp_get(Ecore_X_Window root)
100{
101 Ecore_X_Time timestamp = 0;
102
103#ifdef ECORE_XRANDR
104 XRRScreenConfiguration *cfg;
105
106 /* try to get the screen configuration from Xrandr */
107 if ((cfg = XRRGetScreenInfo(_ecore_x_disp, root)))
108 {
109 Time tm;
110
111 XRRConfigTimes(cfg, &tm);
112
113 timestamp = (Ecore_X_Time)tm;
114
115 /* free any returned screen config */
116 if (cfg) XRRFreeScreenConfigInfo(cfg);
117 }
118#endif
119
120 return timestamp;
121}
122
88/*************************************** 123/***************************************
89 * API Functions for RandR version 1.1 * 124 * API Functions for RandR version 1.1 *
90 ***************************************/ 125 ***************************************/