From 0f52e4027de25cf17edd199f933d60bffab20ad4 Mon Sep 17 00:00:00 2001 From: raster Date: Wed, 24 Feb 2010 04:36:22 +0000 Subject: [PATCH] some roundtrips-- git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@46420 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/ecore_x/xlib/ecore_x.c | 18 ++++++------------ src/lib/ecore_x/xlib/ecore_x_events.c | 10 +++++++--- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/src/lib/ecore_x/xlib/ecore_x.c b/src/lib/ecore_x/xlib/ecore_x.c index 695dd83..ecb3e33 100644 --- a/src/lib/ecore_x/xlib/ecore_x.c +++ b/src/lib/ecore_x/xlib/ecore_x.c @@ -138,6 +138,7 @@ EAPI int ECORE_X_LOCK_NUM = 0; EAPI int ECORE_X_LOCK_CAPS = 0; #ifdef LOGRT +static double t0 = 0.0; static Status (*_logrt_real_reply) (Display *disp, void *rep, int extra, Bool discard) = NULL; static void _logrt_init(void) @@ -149,6 +150,7 @@ _logrt_init(void) if (!lib) lib = dlopen("libX11.so.6.3", RTLD_GLOBAL | RTLD_LAZY); if (!lib) lib = dlopen("libX11.so.6.3.0", RTLD_GLOBAL | RTLD_LAZY); _logrt_real_reply = dlsym(lib, "_XReply"); + t0 = ecore_time_get(); } Status _XReply(Display *disp, void *rep, int extra, Bool discard) @@ -161,7 +163,7 @@ _XReply(Display *disp, void *rep, int extra, Bool discard) if (n > 0) { sym = backtrace_symbols(bt, n); - printf("ROUNDTRIP: "); + printf("ROUNDTRIP: %4.4f :", ecore_time_get() - t0); if (sym) { for (i = n - 1; i > 0; i--) @@ -1265,23 +1267,15 @@ EAPI void ecore_x_grab(void) { _ecore_x_grab_count++; - - if (_ecore_x_grab_count == 1) - XGrabServer(_ecore_x_disp); + if (_ecore_x_grab_count == 1) XGrabServer(_ecore_x_disp); } EAPI void ecore_x_ungrab(void) { _ecore_x_grab_count--; - if (_ecore_x_grab_count < 0) - _ecore_x_grab_count = 0; - - if (_ecore_x_grab_count == 0) - { - XUngrabServer(_ecore_x_disp); - XSync(_ecore_x_disp, False); - } + if (_ecore_x_grab_count < 0) _ecore_x_grab_count = 0; + if (_ecore_x_grab_count == 0) XUngrabServer(_ecore_x_disp); } int _ecore_window_grabs_num = 0; diff --git a/src/lib/ecore_x/xlib/ecore_x_events.c b/src/lib/ecore_x/xlib/ecore_x_events.c index 02fd926..bd50dc8 100644 --- a/src/lib/ecore_x/xlib/ecore_x_events.c +++ b/src/lib/ecore_x/xlib/ecore_x_events.c @@ -1776,7 +1776,7 @@ _ecore_x_event_handle_client_message(XEvent *xevent) && (xevent->xclient.format == 32)) { Ecore_X_Event_Ping *e; - Ecore_X_Window root; + Ecore_X_Window root = 0; e = calloc(1, sizeof(Ecore_X_Event_Ping)); if (!e) return; @@ -1784,9 +1784,13 @@ _ecore_x_event_handle_client_message(XEvent *xevent) e->time = xevent->xclient.data.l[1]; e->event_win = xevent->xclient.data.l[2]; - ecore_event_add(ECORE_X_EVENT_PING, e, NULL, NULL); /* send a reply anyway - we are alive... eventloop at least */ - root = ecore_x_window_root_get(e->win); + ecore_event_add(ECORE_X_EVENT_PING, e, NULL, NULL); + if (ScreenCount(_ecore_x_disp) > 1) + root = ecore_x_window_root_get(e->win); + else + root = DefaultRootWindow(_ecore_x_disp); + if (xevent->xclient.window != root) { xevent->xclient.window = root; -- 2.7.4