diff --git a/legacy/ecore/AUTHORS b/legacy/ecore/AUTHORS index 7677f08bde..d2b47da35f 100644 --- a/legacy/ecore/AUTHORS +++ b/legacy/ecore/AUTHORS @@ -47,3 +47,4 @@ Rafael Antognolli Kim Yunhan Youness Alaoui Bluezery +Doyoun Kang diff --git a/legacy/ecore/ChangeLog b/legacy/ecore/ChangeLog index ac9065f18d..7cf1d9ca0b 100644 --- a/legacy/ecore/ChangeLog +++ b/legacy/ecore/ChangeLog @@ -403,3 +403,7 @@ the same as timers and mark them as "just added" to skip in this run of animators +2011-12-13 Doyun Kang + + * Add ability to get resource id of last x error in ecore_x. + diff --git a/legacy/ecore/src/lib/ecore_x/Ecore_X.h b/legacy/ecore/src/lib/ecore_x/Ecore_X.h index ecd19f300d..b5d2c3f44b 100644 --- a/legacy/ecore/src/lib/ecore_x/Ecore_X.h +++ b/legacy/ecore/src/lib/ecore_x/Ecore_X.h @@ -1181,6 +1181,8 @@ EAPI int ecore_x_error_request_get(void); EAPI int ecore_x_error_code_get(void); +EAPI Ecore_X_ID +ecore_x_error_resource_id_get(void); EAPI void ecore_x_event_mask_set(Ecore_X_Window w, diff --git a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_error.c b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_error.c index bbd9c2ab5a..fc329265d5 100644 --- a/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_error.c +++ b/legacy/ecore/src/lib/ecore_x/xcb/ecore_xcb_error.c @@ -8,6 +8,7 @@ static void (*_io_error_func)(void *data) = NULL; static void *_io_error_data = NULL; static int _error_request_code = 0; static int _error_code = 0; +static Ecore_X_ID _error_resource_id = 0; /** * Set the error handler. @@ -63,6 +64,18 @@ ecore_x_error_code_get(void) return _error_code; } +/** + * Get the resource id that caused the error. + * @return The resource id causing the X error + * + * Return the X resource id that caused the last X error + */ +EAPI Ecore_X_ID +ecore_x_error_resource_id_get(void) +{ + return _error_resource_id; +} + int _ecore_xcb_error_handle(xcb_generic_error_t *err) { @@ -84,6 +97,7 @@ _ecore_xcb_error_handle(xcb_generic_error_t *err) _error_request_code = err->sequence; _error_code = err->error_code; + _error_resource_id = err->resource_id; if (_error_func) _error_func(_error_data); diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_error.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_error.c index 9f18772ad5..11e9f20502 100644 --- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_error.c +++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_error.c @@ -19,6 +19,7 @@ static void (*_io_error_func)(void *data) = NULL; static void *_io_error_data = NULL; static int _error_request_code = 0; static int _error_code = 0; +static Ecore_X_ID _error_resource_id = 0; /** * Set the error handler. @@ -74,6 +75,18 @@ ecore_x_error_code_get(void) return _error_code; } +/** + * Get the resource id that caused the error. + * @return The resource id causing the X error + * + * Return the X resource id that caused the last X error + */ +EAPI Ecore_X_ID +ecore_x_error_resource_id_get(void) +{ + return _error_resource_id; +} + void _ecore_x_error_handler_init(void) { @@ -89,6 +102,7 @@ _ecore_x_error_handle(Display *d, { _error_request_code = ev->request_code; _error_code = ev->error_code; + _error_resource_id = ev->resourceid; if (_error_func) _error_func(_error_data); }