Enlightenment CVS committal Author : kwo Project : e16 Module : e
Dir : e16/e/src Modified Files: E.h ecore-e16.c ecore-e16.h events.c ewins.h hints.h icccm.c Log Message: Support for _NET_WM_SYNC_REQUEST - Not enabled. =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v retrieving revision 1.531 retrieving revision 1.532 diff -u -3 -r1.531 -r1.532 --- E.h 12 Feb 2006 17:27:30 -0000 1.531 +++ E.h 12 Feb 2006 19:14:14 -0000 1.532 @@ -61,6 +61,8 @@ #define USE_COMPOSITE 1 #endif +#define USE_XSYNC 0 /* Experimental */ + #include <Imlib2.h> #define ENABLE_COLOR_MODIFIERS 0 /* Not functional */ =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/ecore-e16.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -3 -r1.22 -r1.23 --- ecore-e16.c 7 Jan 2006 08:53:15 -0000 1.22 +++ ecore-e16.c 12 Feb 2006 19:14:14 -0000 1.23 @@ -858,8 +858,9 @@ Ecore_X_Atom ECORE_X_ATOM_NET_WM_HANDLED_ICONS; Ecore_X_Atom ECORE_X_ATOM_NET_WM_PING; -Ecore_X_Atom ECORE_X_ATOM_NET_WM_SYNC_REQUEST; #endif +Ecore_X_Atom ECORE_X_ATOM_NET_WM_SYNC_REQUEST; +Ecore_X_Atom ECORE_X_ATOM_NET_WM_SYNC_REQUEST_COUNTER; Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_OPACITY; @@ -974,8 +975,10 @@ ECORE_X_ATOM_NET_WM_HANDLED_ICONS = _ATOM_GET("_NET_WM_HANDLED_ICONS"); ECORE_X_ATOM_NET_WM_PING = _ATOM_GET("_NET_WM_PING"); - ECORE_X_ATOM_NET_WM_SYNC_REQUEST = _ATOM_GET("_NET_WM_SYNC_REQUEST"); #endif + ECORE_X_ATOM_NET_WM_SYNC_REQUEST = _ATOM_GET("_NET_WM_SYNC_REQUEST"); + ECORE_X_ATOM_NET_WM_SYNC_REQUEST_COUNTER = + _ATOM_GET("_NET_WM_SYNC_REQUEST_COUNTER"); ECORE_X_ATOM_NET_WM_WINDOW_OPACITY = _ATOM_GET("_NET_WM_WINDOW_OPACITY"); =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/ecore-e16.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- ecore-e16.h 7 Jan 2006 08:53:15 -0000 1.16 +++ ecore-e16.h 12 Feb 2006 19:14:14 -0000 1.17 @@ -231,8 +231,9 @@ extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_HANDLED_ICONS; extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_PING; -extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_SYNC_REQUEST; #endif +extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_SYNC_REQUEST; +extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_SYNC_REQUEST_COUNTER; extern Ecore_X_Atom ECORE_X_ATOM_NET_WM_WINDOW_OPACITY; =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/events.c,v retrieving revision 1.115 retrieving revision 1.116 diff -u -3 -r1.115 -r1.116 --- events.c 12 Feb 2006 17:27:30 -0000 1.115 +++ events.c 12 Feb 2006 19:14:14 -0000 1.116 @@ -27,6 +27,9 @@ #include "emodule.h" #include "xwin.h" #include <sys/time.h> +#if USE_XSYNC +#include <X11/extensions/sync.h> +#endif #if USE_XRANDR #include <X11/extensions/Xrandr.h> #endif @@ -44,6 +47,11 @@ static int event_base_shape = 0; static int error_base_shape = 0; +#if USE_XSYNC +static int event_base_sync = 0; +static int error_base_sync = 0; +#endif + #if USE_XRANDR static int event_base_randr = 0; static int error_base_randr = 0; @@ -96,6 +104,32 @@ EExit(1); } +#if USE_XSYNC + if (XSyncQueryExtension(disp, &event_base_sync, &error_base_sync)) + { + XSyncInitialize(disp, &major, &minor); + EventsExtensionShowInfo("SYNC", major, minor, + event_base_sync, error_base_sync); + +#if 1 /* Debug */ + { + int i, num; + XSyncSystemCounter *xssc; + + xssc = XSyncListSystemCounters(disp, &num); + for (i = 0; i < num; i++) + { + Eprintf("%2d: %10s %#lx %#x:%#x\n", i, + xssc[i].name, + xssc[i].counter, + XSyncValueHigh32(xssc[i].resolution), + XSyncValueLow32(xssc[i].resolution)); + } + } +#endif + } +#endif + #if USE_XRANDR if (XRRQueryExtension(disp, &event_base_randr, &error_base_randr)) { =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/ewins.h,v retrieving revision 1.39 retrieving revision 1.40 diff -u -3 -r1.39 -r1.40 --- ewins.h 20 Jan 2006 22:04:49 -0000 1.39 +++ ewins.h 12 Feb 2006 19:14:14 -0000 1.40 @@ -206,6 +206,11 @@ char *wm_icon_name; unsigned int *wm_icon, wm_icon_len; unsigned int opacity; +#if USE_XSYNC + char sync_request_enable; + XID sync_request_counter; + long long sync_request_count; +#endif } ewmh; struct { =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/hints.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- hints.h 7 Jan 2006 07:20:58 -0000 1.4 +++ hints.h 12 Feb 2006 19:14:14 -0000 1.5 @@ -122,7 +122,7 @@ unsigned int winc, unsigned int hinc, double amin, double amax); -void ICCCM_Configure(const EWin * ewin); +void ICCCM_Configure(EWin * ewin); void ICCCM_AdoptStart(const EWin * ewin); void ICCCM_Adopt(const EWin * ewin); void ICCCM_Withdraw(const EWin * ewin); =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/icccm.c,v retrieving revision 1.117 retrieving revision 1.118 diff -u -3 -r1.117 -r1.118 --- icccm.c 11 Feb 2006 12:57:34 -0000 1.117 +++ icccm.c 12 Feb 2006 19:14:14 -0000 1.118 @@ -27,6 +27,9 @@ #include "ewins.h" #include "hints.h" #include "xwin.h" +#if USE_XSYNC +#include <X11/extensions/sync.h> +#endif static void ICCCM_SetIconSizes(void); @@ -250,7 +253,7 @@ } void -ICCCM_Configure(const EWin * ewin) +ICCCM_Configure(EWin * ewin) { XEvent ev; Window child; @@ -258,6 +261,24 @@ if (EwinIsInternal(ewin)) return; +#if USE_XSYNC + if (ewin->ewmh.sync_request_enable && !EServerIsGrabbed()) + { + long long count; + + count = ++ewin->ewmh.sync_request_count; + + if (count == 0) + ewin->ewmh.sync_request_count = ++count; + ecore_x_client_message32_send(_EwinGetClientXwin(ewin), + ECORE_X_ATOM_WM_PROTOCOLS, + StructureNotifyMask, + ECORE_X_ATOM_NET_WM_SYNC_REQUEST, + Mode.events.time, + count & 0xffffffff, count >> 32, 0); + } +#endif + ev.type = ConfigureNotify; ev.xconfigure.display = disp; ev.xconfigure.event = _EwinGetClientXwin(ewin); @@ -282,6 +303,24 @@ ev.xconfigure.above = EoGetWin(ewin); ev.xconfigure.override_redirect = False; XSendEvent(disp, _EwinGetClientXwin(ewin), False, StructureNotifyMask, &ev); + +#if USE_XSYNC + if (ewin->ewmh.sync_request_enable && !EServerIsGrabbed()) + { + XSyncWaitCondition xswc[1]; + + xswc[0].trigger.counter = ewin->ewmh.sync_request_counter; + xswc[0].trigger.value_type = XSyncAbsolute; + XSyncIntsToValue(&xswc[0].trigger.wait_value, + ewin->ewmh.sync_request_count & 0xffffffff, + ewin->ewmh.sync_request_count >> 32); + xswc[0].trigger.test_type = XSyncPositiveComparison; + XSyncIntsToValue(&xswc[0].event_threshold, 0, 0); + Eprintf("Sync t=%#lx c=%llx\n", xswc[0].trigger.counter, + ewin->ewmh.sync_request_count); + XSyncAwait(disp, xswc, 1); + } +#endif } void @@ -679,6 +718,18 @@ ewin->icccm.take_focus = ewin->icccm.need_input = 1; else if (prop[i] == ECORE_X_ATOM_WM_DELETE_WINDOW) ewin->icccm.delete_window = 1; +#if USE_XSYNC + else if (prop[i] == ECORE_X_ATOM_NET_WM_SYNC_REQUEST) + { + unsigned int c; + + ewin->ewmh.sync_request_enable = 1; + ecore_x_window_prop_card32_get(_EwinGetClientXwin(ewin), + ECORE_X_ATOM_NET_WM_SYNC_REQUEST_COUNTER, + &c, 1); + ewin->ewmh.sync_request_counter = c; + } +#endif } XFree(prop); } ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs