summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorMike Blumenkrantz <m.blumenkran@samsung.com>2013-07-18 06:17:40 +0100
committerMike Blumenkrantz <m.blumenkran@samsung.com>2013-07-18 06:17:40 +0100
commit60111ce8caf2f0ce28299cd5a073a66442079f86 (patch)
tree62c729248702c153913f39c5d7adcfd4970a0562 /src/lib
parentd77d9134f8c9d86443662ad4581c047562d560ba (diff)
add ECORE_X_SYNC env variable for xlib backend
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/ecore_x/Ecore_X.h3
-rw-r--r--src/lib/ecore_x/xlib/ecore_x.c156
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_atoms.c7
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_composite.c12
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_cursor.c18
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_damage.c2
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_dnd.c9
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_drawable.c6
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_e.c10
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_events.c5
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_fixes.c17
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_gc.c6
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_gesture.c27
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_icccm.c54
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_image.c7
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_netwm.c11
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_pixmap.c17
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_private.h3
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_region.c5
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_selection.c1
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_window.c89
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_window_prop.c59
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_window_shape.c26
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_xi2.c4
-rw-r--r--src/lib/ecore_x/xlib/ecore_x_xinerama.c3
25 files changed, 445 insertions, 112 deletions
diff --git a/src/lib/ecore_x/Ecore_X.h b/src/lib/ecore_x/Ecore_X.h
index ca77664..e0e24ae 100644
--- a/src/lib/ecore_x/Ecore_X.h
+++ b/src/lib/ecore_x/Ecore_X.h
@@ -54,6 +54,9 @@
54 * @li @ref Ecore_X_Window_Z_Order_Group 54 * @li @ref Ecore_X_Window_Z_Order_Group
55 * @li @ref Ecore_X_Window_Parent_Group 55 * @li @ref Ecore_X_Window_Parent_Group
56 * @li @ref Ecore_X_Window_Shape 56 * @li @ref Ecore_X_Window_Shape
57 *
58 * When using the XLib backend, setting the ECORE_X_SYNC environment variable
59 * will cause X calls to be run synchronously for easier debugging.
57 */ 60 */
58 61
59typedef unsigned int Ecore_X_ID; 62typedef unsigned int Ecore_X_ID;
diff --git a/src/lib/ecore_x/xlib/ecore_x.c b/src/lib/ecore_x/xlib/ecore_x.c
index fe16255..16377c0 100644
--- a/src/lib/ecore_x/xlib/ecore_x.c
+++ b/src/lib/ecore_x/xlib/ecore_x.c
@@ -50,6 +50,8 @@ static int _ecore_x_event_screensaver_id = 0;
50static int _ecore_x_event_sync_id = 0; 50static int _ecore_x_event_sync_id = 0;
51int _ecore_xlib_log_dom = -1; 51int _ecore_xlib_log_dom = -1;
52 52
53Eina_Bool _ecore_xlib_sync = EINA_FALSE;
54
53#ifdef ECORE_XRANDR 55#ifdef ECORE_XRANDR
54static int _ecore_x_event_randr_id = 0; 56static int _ecore_x_event_randr_id = 0;
55#endif /* ifdef ECORE_XRANDR */ 57#endif /* ifdef ECORE_XRANDR */
@@ -678,6 +680,7 @@ ecore_x_init(const char *name)
678 goto free_event_handlers; 680 goto free_event_handlers;
679 681
680 _ecore_x_private_win = ecore_x_window_override_new(0, -77, -777, 123, 456); 682 _ecore_x_private_win = ecore_x_window_override_new(0, -77, -777, 123, 456);
683 _ecore_xlib_sync = !!getenv("ECORE_X_SYNC");
681 684
682 return _ecore_x_init_count; 685 return _ecore_x_init_count;
683 686
@@ -738,6 +741,7 @@ _ecore_x_shutdown(int close_display)
738 eina_log_domain_unregister(_ecore_xlib_log_dom); 741 eina_log_domain_unregister(_ecore_xlib_log_dom);
739 _ecore_xlib_log_dom = -1; 742 _ecore_xlib_log_dom = -1;
740 eina_shutdown(); 743 eina_shutdown();
744 _ecore_xlib_sync = EINA_FALSE;
741 745
742 return _ecore_x_init_count; 746 return _ecore_x_init_count;
743} 747}
@@ -993,6 +997,7 @@ ecore_x_kill(Ecore_X_Window win)
993{ 997{
994 LOGFN(__FILE__, __LINE__, __FUNCTION__); 998 LOGFN(__FILE__, __LINE__, __FUNCTION__);
995 XKillClient(_ecore_x_disp, win); 999 XKillClient(_ecore_x_disp, win);
1000 if (_ecore_xlib_sync) ecore_x_sync();
996} 1001}
997 1002
998/** 1003/**
@@ -1329,6 +1334,7 @@ ecore_x_window_container_manage(Ecore_X_Window win)
1329 XSelectInput(_ecore_x_disp, win, 1334 XSelectInput(_ecore_x_disp, win,
1330 SubstructureRedirectMask | 1335 SubstructureRedirectMask |
1331 SubstructureNotifyMask); 1336 SubstructureNotifyMask);
1337 if (_ecore_xlib_sync) ecore_x_sync();
1332} 1338}
1333 1339
1334EAPI void 1340EAPI void
@@ -1344,7 +1350,9 @@ ecore_x_window_client_manage(Ecore_X_Window win)
1344 StructureNotifyMask | 1350 StructureNotifyMask |
1345 SubstructureNotifyMask 1351 SubstructureNotifyMask
1346 ); 1352 );
1353 if (_ecore_xlib_sync) ecore_x_sync();
1347 XShapeSelectInput(_ecore_x_disp, win, ShapeNotifyMask); 1354 XShapeSelectInput(_ecore_x_disp, win, ShapeNotifyMask);
1355 if (_ecore_xlib_sync) ecore_x_sync();
1348} 1356}
1349 1357
1350EAPI void 1358EAPI void
@@ -1354,6 +1362,7 @@ ecore_x_window_sniff(Ecore_X_Window win)
1354 XSelectInput(_ecore_x_disp, win, 1362 XSelectInput(_ecore_x_disp, win,
1355 PropertyChangeMask | 1363 PropertyChangeMask |
1356 SubstructureNotifyMask); 1364 SubstructureNotifyMask);
1365 if (_ecore_xlib_sync) ecore_x_sync();
1357} 1366}
1358 1367
1359EAPI void 1368EAPI void
@@ -1367,7 +1376,9 @@ ecore_x_window_client_sniff(Ecore_X_Window win)
1367 VisibilityChangeMask | 1376 VisibilityChangeMask |
1368 StructureNotifyMask | 1377 StructureNotifyMask |
1369 SubstructureNotifyMask); 1378 SubstructureNotifyMask);
1379 if (_ecore_xlib_sync) ecore_x_sync();
1370 XShapeSelectInput(_ecore_x_disp, win, ShapeNotifyMask); 1380 XShapeSelectInput(_ecore_x_disp, win, ShapeNotifyMask);
1381 if (_ecore_xlib_sync) ecore_x_sync();
1371} 1382}
1372 1383
1373EAPI Eina_Bool 1384EAPI Eina_Bool
@@ -1375,10 +1386,12 @@ ecore_x_window_attributes_get(Ecore_X_Window win,
1375 Ecore_X_Window_Attributes *att_ret) 1386 Ecore_X_Window_Attributes *att_ret)
1376{ 1387{
1377 XWindowAttributes att; 1388 XWindowAttributes att;
1389 Eina_Bool ret;
1378 1390
1379 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1391 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1380 if (!XGetWindowAttributes(_ecore_x_disp, win, &att)) 1392 ret = XGetWindowAttributes(_ecore_x_disp, win, &att);
1381 return EINA_FALSE; 1393 if (_ecore_xlib_sync) ecore_x_sync();
1394 if (!ret) return EINA_FALSE;
1382 1395
1383 memset(att_ret, 0, sizeof(Ecore_X_Window_Attributes)); 1396 memset(att_ret, 0, sizeof(Ecore_X_Window_Attributes));
1384 att_ret->root = att.root; 1397 att_ret->root = att.root;
@@ -1418,6 +1431,7 @@ ecore_x_window_save_set_add(Ecore_X_Window win)
1418{ 1431{
1419 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1432 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1420 XAddToSaveSet(_ecore_x_disp, win); 1433 XAddToSaveSet(_ecore_x_disp, win);
1434 if (_ecore_xlib_sync) ecore_x_sync();
1421} 1435}
1422 1436
1423EAPI void 1437EAPI void
@@ -1425,6 +1439,7 @@ ecore_x_window_save_set_del(Ecore_X_Window win)
1425{ 1439{
1426 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1440 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1427 XRemoveFromSaveSet(_ecore_x_disp, win); 1441 XRemoveFromSaveSet(_ecore_x_disp, win);
1442 if (_ecore_xlib_sync) ecore_x_sync();
1428} 1443}
1429 1444
1430EAPI Ecore_X_Window * 1445EAPI Ecore_X_Window *
@@ -1432,13 +1447,15 @@ ecore_x_window_children_get(Ecore_X_Window win,
1432 int *num) 1447 int *num)
1433{ 1448{
1434 Ecore_X_Window *windows = NULL; 1449 Ecore_X_Window *windows = NULL;
1450 Eina_Bool success;
1435 Window root_ret = 0, parent_ret = 0, *children_ret = NULL; 1451 Window root_ret = 0, parent_ret = 0, *children_ret = NULL;
1436 unsigned int children_ret_num = 0; 1452 unsigned int children_ret_num = 0;
1437 1453
1438 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1454 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1439 if (!XQueryTree(_ecore_x_disp, win, &root_ret, &parent_ret, &children_ret, 1455 success = XQueryTree(_ecore_x_disp, win, &root_ret, &parent_ret, &children_ret,
1440 &children_ret_num)) 1456 &children_ret_num);
1441 return NULL; 1457 if (_ecore_xlib_sync) ecore_x_sync();
1458 if (!success) return NULL;
1442 1459
1443 if (children_ret) 1460 if (children_ret)
1444 { 1461 {
@@ -1463,9 +1480,12 @@ ecore_x_pointer_control_set(int accel_num,
1463 int accel_denom, 1480 int accel_denom,
1464 int threshold) 1481 int threshold)
1465{ 1482{
1483 Eina_Bool ret;
1466 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1484 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1467 return XChangePointerControl(_ecore_x_disp, 1, 1, 1485 ret = !!XChangePointerControl(_ecore_x_disp, 1, 1,
1468 accel_num, accel_denom, threshold) ? EINA_TRUE : EINA_FALSE; 1486 accel_num, accel_denom, threshold);
1487 if (_ecore_xlib_sync) ecore_x_sync();
1488 return ret;
1469} 1489}
1470 1490
1471EAPI Eina_Bool 1491EAPI Eina_Bool
@@ -1473,53 +1493,62 @@ ecore_x_pointer_control_get(int *accel_num,
1473 int *accel_denom, 1493 int *accel_denom,
1474 int *threshold) 1494 int *threshold)
1475{ 1495{
1496 Eina_Bool ret;
1476 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1497 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1477 return XGetPointerControl(_ecore_x_disp, 1498 ret = !!XGetPointerControl(_ecore_x_disp,
1478 accel_num, accel_denom, threshold) ? EINA_TRUE : EINA_FALSE; 1499 accel_num, accel_denom, threshold);
1500 if (_ecore_xlib_sync) ecore_x_sync();
1501 return ret;
1479} 1502}
1480 1503
1481EAPI Eina_Bool 1504EAPI Eina_Bool
1482ecore_x_pointer_mapping_set(unsigned char *map, 1505ecore_x_pointer_mapping_set(unsigned char *map,
1483 int nmap) 1506 int nmap)
1484{ 1507{
1508 Eina_Bool ret;
1485 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1509 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1486 return (XSetPointerMapping(_ecore_x_disp, map, nmap) == MappingSuccess) ? EINA_TRUE : EINA_FALSE; 1510 ret = (XSetPointerMapping(_ecore_x_disp, map, nmap) == MappingSuccess);
1511 if (_ecore_xlib_sync) ecore_x_sync();
1512 return ret;
1487} 1513}
1488 1514
1489EAPI Eina_Bool 1515EAPI Eina_Bool
1490ecore_x_pointer_mapping_get(unsigned char *map, 1516ecore_x_pointer_mapping_get(unsigned char *map,
1491 int nmap) 1517 int nmap)
1492{ 1518{
1519 Eina_Bool ret;
1493 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1520 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1494 return XGetPointerMapping(_ecore_x_disp, map, nmap) ? EINA_TRUE : EINA_FALSE; 1521 ret = !!XGetPointerMapping(_ecore_x_disp, map, nmap);
1522 if (_ecore_xlib_sync) ecore_x_sync();
1523 return ret;
1495} 1524}
1496 1525
1497EAPI Eina_Bool 1526EAPI Eina_Bool
1498ecore_x_pointer_grab(Ecore_X_Window win) 1527ecore_x_pointer_grab(Ecore_X_Window win)
1499{ 1528{
1529 Eina_Bool ret;
1500 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1530 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1501 if (XGrabPointer(_ecore_x_disp, win, False, 1531 ret = (XGrabPointer(_ecore_x_disp, win, False,
1502 ButtonPressMask | ButtonReleaseMask | 1532 ButtonPressMask | ButtonReleaseMask |
1503 EnterWindowMask | LeaveWindowMask | PointerMotionMask, 1533 EnterWindowMask | LeaveWindowMask | PointerMotionMask,
1504 GrabModeAsync, GrabModeAsync, 1534 GrabModeAsync, GrabModeAsync,
1505 None, None, CurrentTime) == GrabSuccess) 1535 None, None, CurrentTime) == GrabSuccess);
1506 return EINA_TRUE; 1536 if (_ecore_xlib_sync) ecore_x_sync();
1507 1537 return ret;
1508 return EINA_FALSE;
1509} 1538}
1510 1539
1511EAPI Eina_Bool 1540EAPI Eina_Bool
1512ecore_x_pointer_confine_grab(Ecore_X_Window win) 1541ecore_x_pointer_confine_grab(Ecore_X_Window win)
1513{ 1542{
1543 Eina_Bool ret;
1514 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1544 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1515 if (XGrabPointer(_ecore_x_disp, win, False, 1545 ret = (XGrabPointer(_ecore_x_disp, win, False,
1516 ButtonPressMask | ButtonReleaseMask | 1546 ButtonPressMask | ButtonReleaseMask |
1517 EnterWindowMask | LeaveWindowMask | PointerMotionMask, 1547 EnterWindowMask | LeaveWindowMask | PointerMotionMask,
1518 GrabModeAsync, GrabModeAsync, 1548 GrabModeAsync, GrabModeAsync,
1519 win, None, CurrentTime) == GrabSuccess) 1549 win, None, CurrentTime) == GrabSuccess);
1520 return EINA_TRUE; 1550 if (_ecore_xlib_sync) ecore_x_sync();
1521 1551 return ret;
1522 return EINA_FALSE;
1523} 1552}
1524 1553
1525EAPI void 1554EAPI void
@@ -1527,6 +1556,7 @@ ecore_x_pointer_ungrab(void)
1527{ 1556{
1528 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1557 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1529 XUngrabPointer(_ecore_x_disp, CurrentTime); 1558 XUngrabPointer(_ecore_x_disp, CurrentTime);
1559 if (_ecore_xlib_sync) ecore_x_sync();
1530} 1560}
1531 1561
1532EAPI Eina_Bool 1562EAPI Eina_Bool
@@ -1534,20 +1564,23 @@ ecore_x_pointer_warp(Ecore_X_Window win,
1534 int x, 1564 int x,
1535 int y) 1565 int y)
1536{ 1566{
1567 Eina_Bool ret;
1537 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1568 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1538 return XWarpPointer(_ecore_x_disp, None, win, 0, 0, 0, 0, x, y) ? EINA_TRUE : EINA_FALSE; 1569 ret = !!XWarpPointer(_ecore_x_disp, None, win, 0, 0, 0, 0, x, y);
1570 if (_ecore_xlib_sync) ecore_x_sync();
1571 return ret;
1539} 1572}
1540 1573
1541EAPI Eina_Bool 1574EAPI Eina_Bool
1542ecore_x_keyboard_grab(Ecore_X_Window win) 1575ecore_x_keyboard_grab(Ecore_X_Window win)
1543{ 1576{
1577 Eina_Bool ret;
1544 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1578 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1545 if (XGrabKeyboard(_ecore_x_disp, win, False, 1579 ret = (XGrabKeyboard(_ecore_x_disp, win, False,
1546 GrabModeAsync, GrabModeAsync, 1580 GrabModeAsync, GrabModeAsync,
1547 CurrentTime) == GrabSuccess) 1581 CurrentTime) == GrabSuccess);
1548 return EINA_TRUE; 1582 if (_ecore_xlib_sync) ecore_x_sync();
1549 1583 return ret;
1550 return EINA_FALSE;
1551} 1584}
1552 1585
1553EAPI void 1586EAPI void
@@ -1722,7 +1755,10 @@ ecore_x_window_button_ungrab(Ecore_X_Window win,
1722 locks[6] = ECORE_X_LOCK_NUM | ECORE_X_LOCK_SCROLL; 1755 locks[6] = ECORE_X_LOCK_NUM | ECORE_X_LOCK_SCROLL;
1723 locks[7] = ECORE_X_LOCK_CAPS | ECORE_X_LOCK_NUM | ECORE_X_LOCK_SCROLL; 1756 locks[7] = ECORE_X_LOCK_CAPS | ECORE_X_LOCK_NUM | ECORE_X_LOCK_SCROLL;
1724 for (i = 0; i < 8; i++) 1757 for (i = 0; i < 8; i++)
1725 XUngrabButton(_ecore_x_disp, b, m | locks[i], win); 1758 {
1759 XUngrabButton(_ecore_x_disp, b, m | locks[i], win);
1760 if (_ecore_xlib_sync) ecore_x_sync();
1761 }
1726 _ecore_x_sync_magic_send(1, win); 1762 _ecore_x_sync_magic_send(1, win);
1727} 1763}
1728 1764
@@ -1770,8 +1806,11 @@ ecore_x_window_key_grab(Ecore_X_Window win,
1770 locks[6] = ECORE_X_LOCK_NUM | ECORE_X_LOCK_SCROLL; 1806 locks[6] = ECORE_X_LOCK_NUM | ECORE_X_LOCK_SCROLL;
1771 locks[7] = ECORE_X_LOCK_CAPS | ECORE_X_LOCK_NUM | ECORE_X_LOCK_SCROLL; 1807 locks[7] = ECORE_X_LOCK_CAPS | ECORE_X_LOCK_NUM | ECORE_X_LOCK_SCROLL;
1772 for (i = 0; i < 8; i++) 1808 for (i = 0; i < 8; i++)
1773 XGrabKey(_ecore_x_disp, keycode, m | locks[i], 1809 {
1774 win, False, GrabModeSync, GrabModeAsync); 1810 XGrabKey(_ecore_x_disp, keycode, m | locks[i],
1811 win, False, GrabModeSync, GrabModeAsync);
1812 if (_ecore_xlib_sync) ecore_x_sync();
1813 }
1775 _ecore_key_grabs_num++; 1814 _ecore_key_grabs_num++;
1776 t = realloc(_ecore_key_grabs, 1815 t = realloc(_ecore_key_grabs,
1777 _ecore_key_grabs_num * sizeof(Window)); 1816 _ecore_key_grabs_num * sizeof(Window));
@@ -1882,6 +1921,7 @@ ecore_x_client_message32_send(Ecore_X_Window win,
1882 long d4) 1921 long d4)
1883{ 1922{
1884 XEvent xev; 1923 XEvent xev;
1924 Eina_Bool ret;
1885 1925
1886 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1926 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1887 xev.xclient.window = win; 1927 xev.xclient.window = win;
@@ -1894,7 +1934,9 @@ ecore_x_client_message32_send(Ecore_X_Window win,
1894 xev.xclient.data.l[3] = d3; 1934 xev.xclient.data.l[3] = d3;
1895 xev.xclient.data.l[4] = d4; 1935 xev.xclient.data.l[4] = d4;
1896 1936
1897 return XSendEvent(_ecore_x_disp, win, False, mask, &xev) ? EINA_TRUE : EINA_FALSE; 1937 ret = !!XSendEvent(_ecore_x_disp, win, False, mask, &xev);
1938 if (_ecore_xlib_sync) ecore_x_sync();
1939 return ret;
1898} 1940}
1899 1941
1900/** 1942/**
@@ -1914,6 +1956,7 @@ ecore_x_client_message8_send(Ecore_X_Window win,
1914 int len) 1956 int len)
1915{ 1957{
1916 XEvent xev; 1958 XEvent xev;
1959 Eina_Bool ret;
1917 1960
1918 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1961 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1919 xev.xclient.window = win; 1962 xev.xclient.window = win;
@@ -1926,7 +1969,9 @@ ecore_x_client_message8_send(Ecore_X_Window win,
1926 memcpy(xev.xclient.data.b, data, len); 1969 memcpy(xev.xclient.data.b, data, len);
1927 memset(xev.xclient.data.b + len, 0, 20 - len); 1970 memset(xev.xclient.data.b + len, 0, 20 - len);
1928 1971
1929 return XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev) ? EINA_TRUE : EINA_FALSE; 1972 ret = !!XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev);
1973 if (_ecore_xlib_sync) ecore_x_sync();
1974 return ret;
1930} 1975}
1931 1976
1932EAPI Eina_Bool 1977EAPI Eina_Bool
@@ -1938,6 +1983,7 @@ ecore_x_mouse_move_send(Ecore_X_Window win,
1938 XWindowAttributes att; 1983 XWindowAttributes att;
1939 Window tw; 1984 Window tw;
1940 int rx, ry; 1985 int rx, ry;
1986 Eina_Bool ret;
1941 1987
1942 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1988 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1943 XGetWindowAttributes(_ecore_x_disp, win, &att); 1989 XGetWindowAttributes(_ecore_x_disp, win, &att);
@@ -1954,7 +2000,9 @@ ecore_x_mouse_move_send(Ecore_X_Window win,
1954 xev.xmotion.state = 0; 2000 xev.xmotion.state = 0;
1955 xev.xmotion.is_hint = 0; 2001 xev.xmotion.is_hint = 0;
1956 xev.xmotion.same_screen = 1; 2002 xev.xmotion.same_screen = 1;
1957 return XSendEvent(_ecore_x_disp, win, True, PointerMotionMask, &xev) ? EINA_TRUE : EINA_FALSE; 2003 ret = !!XSendEvent(_ecore_x_disp, win, True, PointerMotionMask, &xev);
2004 if (_ecore_xlib_sync) ecore_x_sync();
2005 return ret;
1958} 2006}
1959 2007
1960EAPI Eina_Bool 2008EAPI Eina_Bool
@@ -1967,6 +2015,7 @@ ecore_x_mouse_down_send(Ecore_X_Window win,
1967 XWindowAttributes att; 2015 XWindowAttributes att;
1968 Window tw; 2016 Window tw;
1969 int rx, ry; 2017 int rx, ry;
2018 Eina_Bool ret;
1970 2019
1971 LOGFN(__FILE__, __LINE__, __FUNCTION__); 2020 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1972 XGetWindowAttributes(_ecore_x_disp, win, &att); 2021 XGetWindowAttributes(_ecore_x_disp, win, &att);
@@ -1983,7 +2032,9 @@ ecore_x_mouse_down_send(Ecore_X_Window win,
1983 xev.xbutton.state = 1 << b; 2032 xev.xbutton.state = 1 << b;
1984 xev.xbutton.button = b; 2033 xev.xbutton.button = b;
1985 xev.xbutton.same_screen = 1; 2034 xev.xbutton.same_screen = 1;
1986 return XSendEvent(_ecore_x_disp, win, True, ButtonPressMask, &xev) ? EINA_TRUE : EINA_FALSE; 2035 ret = !!XSendEvent(_ecore_x_disp, win, True, ButtonPressMask, &xev);
2036 if (_ecore_xlib_sync) ecore_x_sync();
2037 return ret;
1987} 2038}
1988 2039
1989EAPI Eina_Bool 2040EAPI Eina_Bool
@@ -1996,6 +2047,7 @@ ecore_x_mouse_up_send(Ecore_X_Window win,
1996 XWindowAttributes att; 2047 XWindowAttributes att;
1997 Window tw; 2048 Window tw;
1998 int rx, ry; 2049 int rx, ry;
2050 Eina_Bool ret;
1999 2051
2000 LOGFN(__FILE__, __LINE__, __FUNCTION__); 2052 LOGFN(__FILE__, __LINE__, __FUNCTION__);
2001 XGetWindowAttributes(_ecore_x_disp, win, &att); 2053 XGetWindowAttributes(_ecore_x_disp, win, &att);
@@ -2012,7 +2064,9 @@ ecore_x_mouse_up_send(Ecore_X_Window win,
2012 xev.xbutton.state = 0; 2064 xev.xbutton.state = 0;
2013 xev.xbutton.button = b; 2065 xev.xbutton.button = b;
2014 xev.xbutton.same_screen = 1; 2066 xev.xbutton.same_screen = 1;
2015 return XSendEvent(_ecore_x_disp, win, True, ButtonReleaseMask, &xev) ? EINA_TRUE : EINA_FALSE; 2067 ret = !!XSendEvent(_ecore_x_disp, win, True, ButtonReleaseMask, &xev);
2068 if (_ecore_xlib_sync) ecore_x_sync();
2069 return ret;
2016} 2070}
2017 2071
2018EAPI Eina_Bool 2072EAPI Eina_Bool
@@ -2024,6 +2078,7 @@ ecore_x_mouse_in_send(Ecore_X_Window win,
2024 XWindowAttributes att; 2078 XWindowAttributes att;
2025 Window tw; 2079 Window tw;
2026 int rx, ry; 2080 int rx, ry;
2081 Eina_Bool ret;
2027 2082
2028 LOGFN(__FILE__, __LINE__, __FUNCTION__); 2083 LOGFN(__FILE__, __LINE__, __FUNCTION__);
2029 XGetWindowAttributes(_ecore_x_disp, win, &att); 2084 XGetWindowAttributes(_ecore_x_disp, win, &att);
@@ -2042,7 +2097,9 @@ ecore_x_mouse_in_send(Ecore_X_Window win,
2042 xev.xcrossing.same_screen = 1; 2097 xev.xcrossing.same_screen = 1;
2043 xev.xcrossing.focus = 0; 2098 xev.xcrossing.focus = 0;
2044 xev.xcrossing.state = 0; 2099 xev.xcrossing.state = 0;
2045 return XSendEvent(_ecore_x_disp, win, True, EnterWindowMask, &xev) ? EINA_TRUE : EINA_FALSE; 2100 ret = !!XSendEvent(_ecore_x_disp, win, True, EnterWindowMask, &xev);
2101 if (_ecore_xlib_sync) ecore_x_sync();
2102 return ret;
2046} 2103}
2047 2104
2048EAPI Eina_Bool 2105EAPI Eina_Bool
@@ -2054,6 +2111,7 @@ ecore_x_mouse_out_send(Ecore_X_Window win,
2054 XWindowAttributes att; 2111 XWindowAttributes att;
2055 Window tw; 2112 Window tw;
2056 int rx, ry; 2113 int rx, ry;
2114 Eina_Bool ret;
2057 2115
2058 LOGFN(__FILE__, __LINE__, __FUNCTION__); 2116 LOGFN(__FILE__, __LINE__, __FUNCTION__);
2059 XGetWindowAttributes(_ecore_x_disp, win, &att); 2117 XGetWindowAttributes(_ecore_x_disp, win, &att);
@@ -2072,7 +2130,9 @@ ecore_x_mouse_out_send(Ecore_X_Window win,
2072 xev.xcrossing.same_screen = 1; 2130 xev.xcrossing.same_screen = 1;
2073 xev.xcrossing.focus = 0; 2131 xev.xcrossing.focus = 0;
2074 xev.xcrossing.state = 0; 2132 xev.xcrossing.state = 0;
2075 return XSendEvent(_ecore_x_disp, win, True, LeaveWindowMask, &xev) ? EINA_TRUE : EINA_FALSE; 2133 ret = !!XSendEvent(_ecore_x_disp, win, True, LeaveWindowMask, &xev);
2134 if (_ecore_xlib_sync) ecore_x_sync();
2135 return ret;
2076} 2136}
2077 2137
2078EAPI void 2138EAPI void
@@ -2080,6 +2140,7 @@ ecore_x_focus_reset(void)
2080{ 2140{
2081 LOGFN(__FILE__, __LINE__, __FUNCTION__); 2141 LOGFN(__FILE__, __LINE__, __FUNCTION__);
2082 XSetInputFocus(_ecore_x_disp, PointerRoot, RevertToPointerRoot, CurrentTime); 2142 XSetInputFocus(_ecore_x_disp, PointerRoot, RevertToPointerRoot, CurrentTime);
2143 if (_ecore_xlib_sync) ecore_x_sync();
2083} 2144}
2084 2145
2085EAPI void 2146EAPI void
@@ -2087,6 +2148,7 @@ ecore_x_events_allow_all(void)
2087{ 2148{
2088 LOGFN(__FILE__, __LINE__, __FUNCTION__); 2149 LOGFN(__FILE__, __LINE__, __FUNCTION__);
2089 XAllowEvents(_ecore_x_disp, AsyncBoth, CurrentTime); 2150 XAllowEvents(_ecore_x_disp, AsyncBoth, CurrentTime);
2151 if (_ecore_xlib_sync) ecore_x_sync();
2090} 2152}
2091 2153
2092EAPI void 2154EAPI void
@@ -2117,6 +2179,7 @@ ecore_x_pointer_xy_get(Ecore_X_Window win,
2117 2179
2118 if (x) *x = wx; 2180 if (x) *x = wx;
2119 if (y) *y = wy; 2181 if (y) *y = wy;
2182 if (_ecore_xlib_sync) ecore_x_sync();
2120} 2183}
2121 2184
2122EAPI void 2185EAPI void
@@ -2134,6 +2197,7 @@ ecore_x_pointer_root_xy_get(int *x, int *y)
2134 { 2197 {
2135 ret = XQueryPointer(_ecore_x_disp, root[i], &rwin, &cwin, 2198 ret = XQueryPointer(_ecore_x_disp, root[i], &rwin, &cwin,
2136 &rx, &ry, &wx, &wy, &mask); 2199 &rx, &ry, &wx, &wy, &mask);
2200 if (_ecore_xlib_sync) ecore_x_sync();
2137 if (ret) break; 2201 if (ret) break;
2138 } 2202 }
2139 2203
@@ -2156,7 +2220,10 @@ ecore_x_pointer_root_xy_get(int *x, int *y)
2156EAPI unsigned int 2220EAPI unsigned int
2157ecore_x_visual_id_get(Ecore_X_Visual visual) 2221ecore_x_visual_id_get(Ecore_X_Visual visual)
2158{ 2222{
2159 return XVisualIDFromVisual(visual); 2223 unsigned int vis;
2224 vis = XVisualIDFromVisual(visual);
2225 if (_ecore_xlib_sync) ecore_x_sync();
2226 return vis;
2160} 2227}
2161 2228
2162/** 2229/**
@@ -2172,7 +2239,9 @@ EAPI Ecore_X_Visual
2172ecore_x_default_visual_get(Ecore_X_Display *disp, 2239ecore_x_default_visual_get(Ecore_X_Display *disp,
2173 Ecore_X_Screen *screen) 2240 Ecore_X_Screen *screen)
2174{ 2241{
2175 return DefaultVisual(disp, ecore_x_screen_index_get(screen)); 2242 Ecore_X_Visual vis = DefaultVisual(disp, ecore_x_screen_index_get(screen));
2243 if (_ecore_xlib_sync) ecore_x_sync();
2244 return vis;
2176} 2245}
2177 2246
2178/** 2247/**
@@ -2188,7 +2257,9 @@ EAPI Ecore_X_Colormap
2188ecore_x_default_colormap_get(Ecore_X_Display *disp, 2257ecore_x_default_colormap_get(Ecore_X_Display *disp,
2189 Ecore_X_Screen *screen) 2258 Ecore_X_Screen *screen)
2190{ 2259{
2191 return DefaultColormap(disp, ecore_x_screen_index_get(screen)); 2260 Ecore_X_Colormap col = DefaultColormap(disp, ecore_x_screen_index_get(screen));
2261 if (_ecore_xlib_sync) ecore_x_sync();
2262 return col;
2192} 2263}
2193 2264
2194/** 2265/**
@@ -2204,7 +2275,9 @@ EAPI int
2204ecore_x_default_depth_get(Ecore_X_Display *disp, 2275ecore_x_default_depth_get(Ecore_X_Display *disp,
2205 Ecore_X_Screen *screen) 2276 Ecore_X_Screen *screen)
2206{ 2277{
2207 return DefaultDepth(disp, ecore_x_screen_index_get(screen)); 2278 int depth = DefaultDepth(disp, ecore_x_screen_index_get(screen));
2279 if (_ecore_xlib_sync) ecore_x_sync();
2280 return depth;
2208} 2281}
2209 2282
2210EAPI void 2283EAPI void
@@ -2212,6 +2285,7 @@ ecore_x_xkb_select_group(int group)
2212{ 2285{
2213#ifdef ECORE_XKB 2286#ifdef ECORE_XKB
2214 XkbLockGroup(_ecore_x_disp, XkbUseCoreKbd, group); 2287 XkbLockGroup(_ecore_x_disp, XkbUseCoreKbd, group);
2288 if (_ecore_xlib_sync) ecore_x_sync();
2215#endif 2289#endif
2216} 2290}
2217 2291
diff --git a/src/lib/ecore_x/xlib/ecore_x_atoms.c b/src/lib/ecore_x/xlib/ecore_x_atoms.c
index 93cd9eb..6533f15 100644
--- a/src/lib/ecore_x/xlib/ecore_x_atoms.c
+++ b/src/lib/ecore_x/xlib/ecore_x_atoms.c
@@ -44,11 +44,14 @@ _ecore_x_atoms_init(void)
44EAPI Ecore_X_Atom 44EAPI Ecore_X_Atom
45ecore_x_atom_get(const char *name) 45ecore_x_atom_get(const char *name)
46{ 46{
47 Ecore_X_Atom atom;
47 if (!_ecore_x_disp) 48 if (!_ecore_x_disp)
48 return 0; 49 return 0;
49 50
50 LOGFN(__FILE__, __LINE__, __FUNCTION__); 51 LOGFN(__FILE__, __LINE__, __FUNCTION__);
51 return XInternAtom(_ecore_x_disp, name, False); 52 atom = XInternAtom(_ecore_x_disp, name, False);
53 if (_ecore_xlib_sync) ecore_x_sync();
54 return atom;
52} 55}
53 56
54EAPI void 57EAPI void
@@ -67,6 +70,7 @@ ecore_x_atoms_get(const char **names,
67 XInternAtoms(_ecore_x_disp, (char **)names, num, False, atoms_int); 70 XInternAtoms(_ecore_x_disp, (char **)names, num, False, atoms_int);
68 for (i = 0; i < num; i++) 71 for (i = 0; i < num; i++)
69 atoms[i] = atoms_int[i]; 72 atoms[i] = atoms_int[i];
73 if (_ecore_xlib_sync) ecore_x_sync();
70} 74}
71 75
72EAPI char * 76EAPI char *
@@ -81,6 +85,7 @@ ecore_x_atom_name_get(Ecore_X_Atom atom)
81 LOGFN(__FILE__, __LINE__, __FUNCTION__); 85 LOGFN(__FILE__, __LINE__, __FUNCTION__);
82 86
83 xname = XGetAtomName(_ecore_x_disp, atom); 87 xname = XGetAtomName(_ecore_x_disp, atom);
88 if (_ecore_xlib_sync) ecore_x_sync();
84 if (!xname) 89 if (!xname)
85 return NULL; 90 return NULL;
86 91
diff --git a/src/lib/ecore_x/xlib/ecore_x_composite.c b/src/lib/ecore_x/xlib/ecore_x_composite.c
index b919db9..913839f 100644
--- a/src/lib/ecore_x/xlib/ecore_x_composite.c
+++ b/src/lib/ecore_x/xlib/ecore_x_composite.c
@@ -17,12 +17,15 @@ _ecore_x_composite_init(void)
17 17
18 if (XCompositeQueryVersion(_ecore_x_disp, &major, &minor)) 18 if (XCompositeQueryVersion(_ecore_x_disp, &major, &minor))
19 { 19 {
20 if (_ecore_xlib_sync) ecore_x_sync();
20# ifdef ECORE_XRENDER 21# ifdef ECORE_XRENDER
21 if (XRenderQueryExtension(_ecore_x_disp, &major, &minor)) 22 if (XRenderQueryExtension(_ecore_x_disp, &major, &minor))
22 { 23 {
24 if (_ecore_xlib_sync) ecore_x_sync();
23# ifdef ECORE_XFIXES 25# ifdef ECORE_XFIXES
24 if (XFixesQueryVersion(_ecore_x_disp, &major, &minor)) 26 if (XFixesQueryVersion(_ecore_x_disp, &major, &minor))
25 { 27 {
28 if (_ecore_xlib_sync) ecore_x_sync();
26 _composite_available = EINA_TRUE; 29 _composite_available = EINA_TRUE;
27 } 30 }
28# endif 31# endif
@@ -58,6 +61,7 @@ ecore_x_composite_redirect_window(Ecore_X_Window win,
58 break; 61 break;
59 } 62 }
60 XCompositeRedirectWindow(_ecore_x_disp, win, update); 63 XCompositeRedirectWindow(_ecore_x_disp, win, update);
64 if (_ecore_xlib_sync) ecore_x_sync();
61#endif /* ifdef ECORE_XCOMPOSITE */ 65#endif /* ifdef ECORE_XCOMPOSITE */
62} 66}
63 67
@@ -80,6 +84,7 @@ ecore_x_composite_redirect_subwindows(Ecore_X_Window win,
80 break; 84 break;
81 } 85 }
82 XCompositeRedirectSubwindows(_ecore_x_disp, win, update); 86 XCompositeRedirectSubwindows(_ecore_x_disp, win, update);
87 if (_ecore_xlib_sync) ecore_x_sync();
83#endif /* ifdef ECORE_XCOMPOSITE */ 88#endif /* ifdef ECORE_XCOMPOSITE */
84} 89}
85 90
@@ -102,6 +107,7 @@ ecore_x_composite_unredirect_window(Ecore_X_Window win,
102 break; 107 break;
103 } 108 }
104 XCompositeUnredirectWindow(_ecore_x_disp, win, update); 109 XCompositeUnredirectWindow(_ecore_x_disp, win, update);
110 if (_ecore_xlib_sync) ecore_x_sync();
105#endif /* ifdef ECORE_XCOMPOSITE */ 111#endif /* ifdef ECORE_XCOMPOSITE */
106} 112}
107 113
@@ -124,6 +130,7 @@ ecore_x_composite_unredirect_subwindows(Ecore_X_Window win,
124 break; 130 break;
125 } 131 }
126 XCompositeUnredirectSubwindows(_ecore_x_disp, win, update); 132 XCompositeUnredirectSubwindows(_ecore_x_disp, win, update);
133 if (_ecore_xlib_sync) ecore_x_sync();
127#endif /* ifdef ECORE_XCOMPOSITE */ 134#endif /* ifdef ECORE_XCOMPOSITE */
128} 135}
129 136
@@ -134,6 +141,7 @@ ecore_x_composite_name_window_pixmap_get(Ecore_X_Window win)
134#ifdef ECORE_XCOMPOSITE 141#ifdef ECORE_XCOMPOSITE
135 LOGFN(__FILE__, __LINE__, __FUNCTION__); 142 LOGFN(__FILE__, __LINE__, __FUNCTION__);
136 pixmap = XCompositeNameWindowPixmap(_ecore_x_disp, win); 143 pixmap = XCompositeNameWindowPixmap(_ecore_x_disp, win);
144 if (_ecore_xlib_sync) ecore_x_sync();
137#endif /* ifdef ECORE_XCOMPOSITE */ 145#endif /* ifdef ECORE_XCOMPOSITE */
138 return pixmap; 146 return pixmap;
139} 147}
@@ -143,6 +151,7 @@ ecore_x_composite_window_events_disable(Ecore_X_Window win)
143{ 151{
144#ifdef ECORE_XCOMPOSITE 152#ifdef ECORE_XCOMPOSITE
145 ecore_x_window_shape_input_rectangle_set(win, -1, -1, 1, 1); 153 ecore_x_window_shape_input_rectangle_set(win, -1, -1, 1, 1);
154 if (_ecore_xlib_sync) ecore_x_sync();
146#endif /* ifdef ECORE_XCOMPOSITE */ 155#endif /* ifdef ECORE_XCOMPOSITE */
147} 156}
148 157
@@ -151,6 +160,7 @@ ecore_x_composite_window_events_enable(Ecore_X_Window win)
151{ 160{
152#ifdef ECORE_XCOMPOSITE 161#ifdef ECORE_XCOMPOSITE
153 ecore_x_window_shape_input_rectangle_set(win, 0, 0, 65535, 65535); 162 ecore_x_window_shape_input_rectangle_set(win, 0, 0, 65535, 65535);
163 if (_ecore_xlib_sync) ecore_x_sync();
154#endif /* ifdef ECORE_XCOMPOSITE */ 164#endif /* ifdef ECORE_XCOMPOSITE */
155} 165}
156 166
@@ -160,6 +170,7 @@ ecore_x_composite_render_window_enable(Ecore_X_Window root)
160 Ecore_X_Window win = 0; 170 Ecore_X_Window win = 0;
161#ifdef ECORE_XCOMPOSITE 171#ifdef ECORE_XCOMPOSITE
162 win = XCompositeGetOverlayWindow(_ecore_x_disp, root); 172 win = XCompositeGetOverlayWindow(_ecore_x_disp, root);
173 if (_ecore_xlib_sync) ecore_x_sync();
163 ecore_x_composite_window_events_disable(win); 174 ecore_x_composite_window_events_disable(win);
164#endif /* ifdef ECORE_XCOMPOSITE */ 175#endif /* ifdef ECORE_XCOMPOSITE */
165 return win; 176 return win;
@@ -171,6 +182,7 @@ ecore_x_composite_render_window_disable(Ecore_X_Window root)
171#ifdef ECORE_XCOMPOSITE 182#ifdef ECORE_XCOMPOSITE
172 LOGFN(__FILE__, __LINE__, __FUNCTION__); 183 LOGFN(__FILE__, __LINE__, __FUNCTION__);
173 XCompositeReleaseOverlayWindow(_ecore_x_disp, root); 184 XCompositeReleaseOverlayWindow(_ecore_x_disp, root);
185 if (_ecore_xlib_sync) ecore_x_sync();
174#endif /* ifdef ECORE_XCOMPOSITE */ 186#endif /* ifdef ECORE_XCOMPOSITE */
175} 187}
176 188
diff --git a/src/lib/ecore_x/xlib/ecore_x_cursor.c b/src/lib/ecore_x/xlib/ecore_x_cursor.c
index a968c56..22f2789 100644
--- a/src/lib/ecore_x/xlib/ecore_x_cursor.c
+++ b/src/lib/ecore_x/xlib/ecore_x_cursor.c
@@ -28,6 +28,7 @@ ecore_x_cursor_new(Ecore_X_Window win,
28 XcursorImage *xci; 28 XcursorImage *xci;
29 29
30 xci = XcursorImageCreate(w, h); 30 xci = XcursorImageCreate(w, h);
31 if (_ecore_xlib_sync) ecore_x_sync();
31 if (xci) 32 if (xci)
32 { 33 {
33 int i; 34 int i;
@@ -47,6 +48,7 @@ ecore_x_cursor_new(Ecore_X_Window win,
47// (a << 24) | (r << 16) | (g << 8) | (b); 48// (a << 24) | (r << 16) | (g << 8) | (b);
48 } 49 }
49 c = XcursorImageLoadCursor(_ecore_x_disp, xci); 50 c = XcursorImageLoadCursor(_ecore_x_disp, xci);
51 if (_ecore_xlib_sync) ecore_x_sync();
50 XcursorImageDestroy(xci); 52 XcursorImageDestroy(xci);
51 return c; 53 return c;
52 } 54 }
@@ -72,10 +74,13 @@ ecore_x_cursor_new(Ecore_X_Window win,
72 }; 74 };
73 75
74 pmap = XCreatePixmap(_ecore_x_disp, win, w, h, 1); 76 pmap = XCreatePixmap(_ecore_x_disp, win, w, h, 1);
77 if (_ecore_xlib_sync) ecore_x_sync();
75 mask = XCreatePixmap(_ecore_x_disp, win, w, h, 1); 78 mask = XCreatePixmap(_ecore_x_disp, win, w, h, 1);
79 if (_ecore_xlib_sync) ecore_x_sync();
76 xim = XCreateImage(_ecore_x_disp, 80 xim = XCreateImage(_ecore_x_disp,
77 DefaultVisual(_ecore_x_disp, 0), 81 DefaultVisual(_ecore_x_disp, 0),
78 1, ZPixmap, 0, NULL, w, h, 32, 0); 82 1, ZPixmap, 0, NULL, w, h, 32, 0);
83 if (_ecore_xlib_sync) ecore_x_sync();
79 xim->data = malloc(xim->bytes_per_line * xim->height); 84 xim->data = malloc(xim->bytes_per_line * xim->height);
80 85
81 fr = 0x00; fg = 0x00; fb = 0x00; 86 fr = 0x00; fg = 0x00; fb = 0x00;
@@ -146,11 +151,14 @@ ecore_x_cursor_new(Ecore_X_Window win,
146 v = 0; 151 v = 0;
147 152
148 XPutPixel(xim, x, y, v); 153 XPutPixel(xim, x, y, v);
154 if (_ecore_xlib_sync) ecore_x_sync();
149 pix++; 155 pix++;
150 } 156 }
151 } 157 }
152 gc = XCreateGC(_ecore_x_disp, pmap, 0, &gcv); 158 gc = XCreateGC(_ecore_x_disp, pmap, 0, &gcv);
159 if (_ecore_xlib_sync) ecore_x_sync();
153 XPutImage(_ecore_x_disp, pmap, gc, xim, 0, 0, 0, 0, w, h); 160 XPutImage(_ecore_x_disp, pmap, gc, xim, 0, 0, 0, 0, w, h);
161 if (_ecore_xlib_sync) ecore_x_sync();
154 XFreeGC(_ecore_x_disp, gc); 162 XFreeGC(_ecore_x_disp, gc);
155 163
156 pix = (unsigned int *)pixels; 164 pix = (unsigned int *)pixels;
@@ -171,7 +179,9 @@ ecore_x_cursor_new(Ecore_X_Window win,
171 } 179 }
172 } 180 }
173 gc = XCreateGC(_ecore_x_disp, mask, 0, &gcv); 181 gc = XCreateGC(_ecore_x_disp, mask, 0, &gcv);
182 if (_ecore_xlib_sync) ecore_x_sync();
174 XPutImage(_ecore_x_disp, mask, gc, xim, 0, 0, 0, 0, w, h); 183 XPutImage(_ecore_x_disp, mask, gc, xim, 0, 0, 0, 0, w, h);
184 if (_ecore_xlib_sync) ecore_x_sync();
175 XFreeGC(_ecore_x_disp, gc); 185 XFreeGC(_ecore_x_disp, gc);
176 186
177 free(xim->data); 187 free(xim->data);
@@ -194,6 +204,7 @@ ecore_x_cursor_new(Ecore_X_Window win,
194 pmap, mask, 204 pmap, mask,
195 &c1, &c2, 205 &c1, &c2,
196 hot_x, hot_y); 206 hot_x, hot_y);
207 if (_ecore_xlib_sync) ecore_x_sync();
197 XFreePixmap(_ecore_x_disp, pmap); 208 XFreePixmap(_ecore_x_disp, pmap);
198 XFreePixmap(_ecore_x_disp, mask); 209 XFreePixmap(_ecore_x_disp, mask);
199 return c; 210 return c;
@@ -207,6 +218,7 @@ ecore_x_cursor_free(Ecore_X_Cursor c)
207{ 218{
208 LOGFN(__FILE__, __LINE__, __FUNCTION__); 219 LOGFN(__FILE__, __LINE__, __FUNCTION__);
209 XFreeCursor(_ecore_x_disp, c); 220 XFreeCursor(_ecore_x_disp, c);
221 if (_ecore_xlib_sync) ecore_x_sync();
210} 222}
211 223
212/* 224/*
@@ -217,9 +229,12 @@ ecore_x_cursor_free(Ecore_X_Cursor c)
217EAPI Ecore_X_Cursor 229EAPI Ecore_X_Cursor
218ecore_x_cursor_shape_get(int shape) 230ecore_x_cursor_shape_get(int shape)
219{ 231{
232 Ecore_X_Cursor cur;
220 LOGFN(__FILE__, __LINE__, __FUNCTION__); 233 LOGFN(__FILE__, __LINE__, __FUNCTION__);
221 /* Shapes are defined in Ecore_X_Cursor.h */ 234 /* Shapes are defined in Ecore_X_Cursor.h */
222 return XCreateFontCursor(_ecore_x_disp, shape); 235 cur = XCreateFontCursor(_ecore_x_disp, shape);
236 if (_ecore_xlib_sync) ecore_x_sync();
237 return cur;
223} 238}
224 239
225EAPI void 240EAPI void
@@ -228,6 +243,7 @@ ecore_x_cursor_size_set(int size)
228#ifdef ECORE_XCURSOR 243#ifdef ECORE_XCURSOR
229 LOGFN(__FILE__, __LINE__, __FUNCTION__); 244 LOGFN(__FILE__, __LINE__, __FUNCTION__);
230 XcursorSetDefaultSize(_ecore_x_disp, size); 245 XcursorSetDefaultSize(_ecore_x_disp, size);
246 if (_ecore_xlib_sync) ecore_x_sync();
231#else /* ifdef ECORE_XCURSOR */ 247#else /* ifdef ECORE_XCURSOR */
232 size = 0; 248 size = 0;
233#endif /* ifdef ECORE_XCURSOR */ 249#endif /* ifdef ECORE_XCURSOR */
diff --git a/src/lib/ecore_x/xlib/ecore_x_damage.c b/src/lib/ecore_x/xlib/ecore_x_damage.c
index b094f85..1134fae 100644
--- a/src/lib/ecore_x/xlib/ecore_x_damage.c
+++ b/src/lib/ecore_x/xlib/ecore_x_damage.c
@@ -43,6 +43,7 @@ ecore_x_damage_new(Ecore_X_Drawable d,
43 43
44 LOGFN(__FILE__, __LINE__, __FUNCTION__); 44 LOGFN(__FILE__, __LINE__, __FUNCTION__);
45 damage = XDamageCreate(_ecore_x_disp, d, level); 45 damage = XDamageCreate(_ecore_x_disp, d, level);
46 if (_ecore_xlib_sync) ecore_x_sync();
46 return damage; 47 return damage;
47#else /* ifdef ECORE_XDAMAGE */ 48#else /* ifdef ECORE_XDAMAGE */
48 return 0; 49 return 0;
@@ -66,6 +67,7 @@ ecore_x_damage_subtract(Ecore_X_Damage damage,
66#ifdef ECORE_XDAMAGE 67#ifdef ECORE_XDAMAGE
67 LOGFN(__FILE__, __LINE__, __FUNCTION__); 68 LOGFN(__FILE__, __LINE__, __FUNCTION__);
68 XDamageSubtract(_ecore_x_disp, damage, repair, parts); 69 XDamageSubtract(_ecore_x_disp, damage, repair, parts);
70 if (_ecore_xlib_sync) ecore_x_sync();
69#endif /* ifdef ECORE_XDAMAGE */ 71#endif /* ifdef ECORE_XDAMAGE */
70} 72}
71 73
diff --git a/src/lib/ecore_x/xlib/ecore_x_dnd.c b/src/lib/ecore_x/xlib/ecore_x_dnd.c
index f31f09d..5a9c166 100644
--- a/src/lib/ecore_x/xlib/ecore_x_dnd.c
+++ b/src/lib/ecore_x/xlib/ecore_x_dnd.c
@@ -113,6 +113,7 @@ _ecore_x_dnd_converter_copy(char *target EINA_UNUSED,
113 &text_prop) == Success) 113 &text_prop) == Success)
114 { 114 {
115 int bufsize = strlen((char *)text_prop.value) + 1; 115 int bufsize = strlen((char *)text_prop.value) + 1;
116 if (_ecore_xlib_sync) ecore_x_sync();
116 *data_ret = malloc(bufsize); 117 *data_ret = malloc(bufsize);
117 if (!*data_ret) 118 if (!*data_ret)
118 { 119 {
@@ -127,6 +128,7 @@ _ecore_x_dnd_converter_copy(char *target EINA_UNUSED,
127 } 128 }
128 else 129 else
129 { 130 {
131 if (_ecore_xlib_sync) ecore_x_sync();
130 free(mystr); 132 free(mystr);
131 return EINA_FALSE; 133 return EINA_FALSE;
132 } 134 }
@@ -472,6 +474,7 @@ _ecore_x_dnd_drop(Eina_Bool self)
472 xev.xclient.data.l[1] = 0; 474 xev.xclient.data.l[1] = 0;
473 xev.xclient.data.l[2] = _source->time; 475 xev.xclient.data.l[2] = _source->time;
474 XSendEvent(_ecore_x_disp, _source->dest, False, 0, &xev); 476 XSendEvent(_ecore_x_disp, _source->dest, False, 0, &xev);
477 if (_ecore_xlib_sync) ecore_x_sync();
475 _source->state = ECORE_X_DND_SOURCE_DROPPED; 478 _source->state = ECORE_X_DND_SOURCE_DROPPED;
476 status = EINA_TRUE; 479 status = EINA_TRUE;
477 } 480 }
@@ -481,6 +484,7 @@ _ecore_x_dnd_drop(Eina_Bool self)
481 xev.xclient.data.l[0] = _source->win; 484 xev.xclient.data.l[0] = _source->win;
482 xev.xclient.data.l[1] = 0; 485 xev.xclient.data.l[1] = 0;
483 XSendEvent(_ecore_x_disp, _source->dest, False, 0, &xev); 486 XSendEvent(_ecore_x_disp, _source->dest, False, 0, &xev);
487 if (_ecore_xlib_sync) ecore_x_sync();
484 _source->state = ECORE_X_DND_SOURCE_IDLE; 488 _source->state = ECORE_X_DND_SOURCE_IDLE;
485 } 489 }
486 } 490 }
@@ -576,6 +580,7 @@ ecore_x_dnd_send_status(Eina_Bool will_accept,
576 } 580 }
577 581
578 XSendEvent(_ecore_x_disp, _target->source, False, 0, &xev); 582 XSendEvent(_ecore_x_disp, _target->source, False, 0, &xev);
583 if (_ecore_xlib_sync) ecore_x_sync();
579} 584}
580 585
581EAPI void 586EAPI void
@@ -603,6 +608,7 @@ ecore_x_dnd_send_finished(void)
603 } 608 }
604 609
605 XSendEvent(_ecore_x_disp, _target->source, False, 0, &xev); 610 XSendEvent(_ecore_x_disp, _target->source, False, 0, &xev);
611 if (_ecore_xlib_sync) ecore_x_sync();
606 612
607 _target->state = ECORE_X_DND_TARGET_IDLE; 613 _target->state = ECORE_X_DND_TARGET_IDLE;
608} 614}
@@ -663,6 +669,7 @@ _ecore_x_dnd_drag(Ecore_X_Window root,
663 xev.xclient.data.l[1] = 0; 669 xev.xclient.data.l[1] = 0;
664 670
665 XSendEvent(_ecore_x_disp, _source->dest, False, 0, &xev); 671 XSendEvent(_ecore_x_disp, _source->dest, False, 0, &xev);
672 if (_ecore_xlib_sync) ecore_x_sync();
666 _source->suppress = 0; 673 _source->suppress = 0;
667 } 674 }
668 675
@@ -704,6 +711,7 @@ _ecore_x_dnd_drag(Ecore_X_Window root,
704 xev.xclient.data.l[i + 2] = types[i]; 711 xev.xclient.data.l[i + 2] = types[i];
705 XFree(data); 712 XFree(data);
706 XSendEvent(_ecore_x_disp, win, False, 0, &xev); 713 XSendEvent(_ecore_x_disp, win, False, 0, &xev);
714 if (_ecore_xlib_sync) ecore_x_sync();
707 _source->await_status = 0; 715 _source->await_status = 0;
708 _source->will_accept = 0; 716 _source->will_accept = 0;
709 } 717 }
@@ -726,6 +734,7 @@ _ecore_x_dnd_drag(Ecore_X_Window root,
726 xev.xclient.data.l[3] = _source->time; /* Version 1 */ 734 xev.xclient.data.l[3] = _source->time; /* Version 1 */
727 xev.xclient.data.l[4] = _source->action; /* Version 2, Needs to be pre-set */ 735 xev.xclient.data.l[4] = _source->action; /* Version 2, Needs to be pre-set */
728 XSendEvent(_ecore_x_disp, win, False, 0, &xev); 736 XSendEvent(_ecore_x_disp, win, False, 0, &xev);
737 if (_ecore_xlib_sync) ecore_x_sync();
729 738
730 _source->await_status = 1; 739 _source->await_status = 1;
731 } 740 }
diff --git a/src/lib/ecore_x/xlib/ecore_x_drawable.c b/src/lib/ecore_x/xlib/ecore_x_drawable.c
index 81815c4..1742c5b 100644
--- a/src/lib/ecore_x/xlib/ecore_x_drawable.c
+++ b/src/lib/ecore_x/xlib/ecore_x_drawable.c
@@ -52,6 +52,7 @@ ecore_x_drawable_geometry_get(Ecore_X_Drawable d,
52 52
53 if (h) 53 if (h)
54 *h = (int)ret_h; 54 *h = (int)ret_h;
55 if (_ecore_xlib_sync) ecore_x_sync();
55} 56}
56 57
57/** 58/**
@@ -71,7 +72,7 @@ ecore_x_drawable_border_width_get(Ecore_X_Drawable d)
71 if (!XGetGeometry(_ecore_x_disp, d, &dummy_win, &dummy_x, &dummy_y, 72 if (!XGetGeometry(_ecore_x_disp, d, &dummy_win, &dummy_x, &dummy_y,
72 &dummy_w, &dummy_h, &border_ret, &dummy_depth)) 73 &dummy_w, &dummy_h, &border_ret, &dummy_depth))
73 border_ret = 0; 74 border_ret = 0;
74 75 if (_ecore_xlib_sync) ecore_x_sync();
75 return (int)border_ret; 76 return (int)border_ret;
76} 77}
77 78
@@ -92,7 +93,7 @@ ecore_x_drawable_depth_get(Ecore_X_Drawable d)
92 if (!XGetGeometry(_ecore_x_disp, d, &dummy_win, &dummy_x, &dummy_y, 93 if (!XGetGeometry(_ecore_x_disp, d, &dummy_win, &dummy_x, &dummy_y,
93 &dummy_w, &dummy_h, &dummy_border, &depth_ret)) 94 &dummy_w, &dummy_h, &dummy_border, &depth_ret))
94 depth_ret = 0; 95 depth_ret = 0;
95 96 if (_ecore_xlib_sync) ecore_x_sync();
96 return (int)depth_ret; 97 return (int)depth_ret;
97} 98}
98 99
@@ -115,5 +116,6 @@ ecore_x_drawable_rectangle_fill(Ecore_X_Drawable d,
115{ 116{
116 LOGFN(__FILE__, __LINE__, __FUNCTION__); 117 LOGFN(__FILE__, __LINE__, __FUNCTION__);
117 XFillRectangle(_ecore_x_disp, d, gc, x, y, width, height); 118 XFillRectangle(_ecore_x_disp, d, gc, x, y, width, height);
119 if (_ecore_xlib_sync) ecore_x_sync();
118} 120}
119 121
diff --git a/src/lib/ecore_x/xlib/ecore_x_e.c b/src/lib/ecore_x/xlib/ecore_x_e.c
index aa6764d..87e8d2f 100644
--- a/src/lib/ecore_x/xlib/ecore_x_e.c
+++ b/src/lib/ecore_x/xlib/ecore_x_e.c
@@ -1089,6 +1089,7 @@ ecore_x_e_comp_sync_draw_done_send(Ecore_X_Window root,
1089 XSendEvent(_ecore_x_disp, root, False, 1089 XSendEvent(_ecore_x_disp, root, False,
1090 SubstructureRedirectMask | SubstructureNotifyMask, 1090 SubstructureRedirectMask | SubstructureNotifyMask,
1091 &xev); 1091 &xev);
1092 if (_ecore_xlib_sync) ecore_x_sync();
1092} 1093}
1093 1094
1094EAPI void 1095EAPI void
@@ -1117,6 +1118,7 @@ ecore_x_e_comp_sync_draw_size_done_send(Ecore_X_Window root,
1117 XSendEvent(_ecore_x_disp, root, False, 1118 XSendEvent(_ecore_x_disp, root, False,
1118 SubstructureRedirectMask | SubstructureNotifyMask, 1119 SubstructureRedirectMask | SubstructureNotifyMask,
1119 &xev); 1120 &xev);
1121 if (_ecore_xlib_sync) ecore_x_sync();
1120} 1122}
1121 1123
1122/* 1124/*
@@ -1440,6 +1442,7 @@ ecore_x_e_window_profile_change_send(Ecore_X_Window root,
1440 XSendEvent(_ecore_x_disp, root, False, 1442 XSendEvent(_ecore_x_disp, root, False,
1441 SubstructureRedirectMask | SubstructureNotifyMask, 1443 SubstructureRedirectMask | SubstructureNotifyMask,
1442 &xev); 1444 &xev);
1445 if (_ecore_xlib_sync) ecore_x_sync();
1443} 1446}
1444 1447
1445EAPI void 1448EAPI void
@@ -1467,6 +1470,7 @@ ecore_x_e_window_profile_change_request_send(Ecore_X_Window win,
1467 xev.xclient.data.l[4] = 0; // later 1470 xev.xclient.data.l[4] = 0; // later
1468 1471
1469 XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev); 1472 XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev);
1473 if (_ecore_xlib_sync) ecore_x_sync();
1470} 1474}
1471 1475
1472 1476
@@ -1498,6 +1502,7 @@ ecore_x_e_window_profile_change_done_send(Ecore_X_Window root,
1498 XSendEvent(_ecore_x_disp, root, False, 1502 XSendEvent(_ecore_x_disp, root, False,
1499 SubstructureRedirectMask | SubstructureNotifyMask, 1503 SubstructureRedirectMask | SubstructureNotifyMask,
1500 &xev); 1504 &xev);
1505 if (_ecore_xlib_sync) ecore_x_sync();
1501} 1506}
1502 1507
1503EAPI void 1508EAPI void
@@ -1586,6 +1591,7 @@ ecore_x_e_comp_sync_begin_send(Ecore_X_Window win)
1586 XSendEvent(_ecore_x_disp, win, False, 1591 XSendEvent(_ecore_x_disp, win, False,
1587 NoEventMask, //SubstructureRedirectMask | SubstructureNotifyMask, 1592 NoEventMask, //SubstructureRedirectMask | SubstructureNotifyMask,
1588 &xev); 1593 &xev);
1594 if (_ecore_xlib_sync) ecore_x_sync();
1589} 1595}
1590 1596
1591EAPI void 1597EAPI void
@@ -1608,6 +1614,7 @@ ecore_x_e_comp_sync_end_send(Ecore_X_Window win)
1608 XSendEvent(_ecore_x_disp, win, False, 1614 XSendEvent(_ecore_x_disp, win, False,
1609 NoEventMask, //SubstructureRedirectMask | SubstructureNotifyMask, 1615 NoEventMask, //SubstructureRedirectMask | SubstructureNotifyMask,
1610 &xev); 1616 &xev);
1617 if (_ecore_xlib_sync) ecore_x_sync();
1611} 1618}
1612 1619
1613EAPI void 1620EAPI void
@@ -1630,6 +1637,7 @@ ecore_x_e_comp_sync_cancel_send(Ecore_X_Window win)
1630 XSendEvent(_ecore_x_disp, win, False, 1637 XSendEvent(_ecore_x_disp, win, False,
1631 NoEventMask, //SubstructureRedirectMask | SubstructureNotifyMask, 1638 NoEventMask, //SubstructureRedirectMask | SubstructureNotifyMask,
1632 &xev); 1639 &xev);
1640 if (_ecore_xlib_sync) ecore_x_sync();
1633} 1641}
1634 1642
1635EAPI void 1643EAPI void
@@ -1652,6 +1660,7 @@ ecore_x_e_comp_flush_send(Ecore_X_Window win)
1652 XSendEvent(_ecore_x_disp, win, False, 1660 XSendEvent(_ecore_x_disp, win, False,
1653 NoEventMask, //SubstructureRedirectMask | SubstructureNotifyMask, 1661 NoEventMask, //SubstructureRedirectMask | SubstructureNotifyMask,
1654 &xev); 1662 &xev);
1663 if (_ecore_xlib_sync) ecore_x_sync();
1655} 1664}
1656 1665
1657EAPI void 1666EAPI void
@@ -1674,6 +1683,7 @@ ecore_x_e_comp_dump_send(Ecore_X_Window win)
1674 XSendEvent(_ecore_x_disp, win, False, 1683 XSendEvent(_ecore_x_disp, win, False,
1675 NoEventMask, //SubstructureRedirectMask | SubstructureNotifyMask, 1684 NoEventMask, //SubstructureRedirectMask | SubstructureNotifyMask,
1676 &xev); 1685 &xev);
1686 if (_ecore_xlib_sync) ecore_x_sync();
1677} 1687}
1678 1688
1679EAPI void 1689EAPI void
diff --git a/src/lib/ecore_x/xlib/ecore_x_events.c b/src/lib/ecore_x/xlib/ecore_x_events.c
index 1d47442..f44f64f 100644
--- a/src/lib/ecore_x/xlib/ecore_x_events.c
+++ b/src/lib/ecore_x/xlib/ecore_x_events.c
@@ -115,8 +115,10 @@ ecore_x_event_mask_set(Ecore_X_Window w,
115 115
116 memset(&attr, 0, sizeof(XWindowAttributes)); 116 memset(&attr, 0, sizeof(XWindowAttributes));
117 XGetWindowAttributes(_ecore_x_disp, w, &attr); 117 XGetWindowAttributes(_ecore_x_disp, w, &attr);
118 if (_ecore_xlib_sync) ecore_x_sync();
118 s_attr.event_mask = mask | attr.your_event_mask; 119 s_attr.event_mask = mask | attr.your_event_mask;
119 XChangeWindowAttributes(_ecore_x_disp, w, CWEventMask, &s_attr); 120 XChangeWindowAttributes(_ecore_x_disp, w, CWEventMask, &s_attr);
121 if (_ecore_xlib_sync) ecore_x_sync();
120} 122}
121 123
122EAPI void 124EAPI void
@@ -132,8 +134,10 @@ ecore_x_event_mask_unset(Ecore_X_Window w,
132 134
133 memset(&attr, 0, sizeof(XWindowAttributes)); 135 memset(&attr, 0, sizeof(XWindowAttributes));
134 XGetWindowAttributes(_ecore_x_disp, w, &attr); 136 XGetWindowAttributes(_ecore_x_disp, w, &attr);
137 if (_ecore_xlib_sync) ecore_x_sync();
135 s_attr.event_mask = attr.your_event_mask & ~mask; 138 s_attr.event_mask = attr.your_event_mask & ~mask;
136 XChangeWindowAttributes(_ecore_x_disp, w, CWEventMask, &s_attr); 139 XChangeWindowAttributes(_ecore_x_disp, w, CWEventMask, &s_attr);
140 if (_ecore_xlib_sync) ecore_x_sync();
137} 141}
138 142
139static void 143static void
@@ -1889,6 +1893,7 @@ _ecore_x_event_handle_client_message(XEvent *xevent)
1889 XSendEvent(_ecore_x_disp, root, False, 1893 XSendEvent(_ecore_x_disp, root, False,
1890 SubstructureRedirectMask | SubstructureNotifyMask, 1894 SubstructureRedirectMask | SubstructureNotifyMask,
1891 xevent); 1895 xevent);
1896 if (_ecore_xlib_sync) ecore_x_sync();
1892 } 1897 }
1893 } 1898 }
1894 else if ((xevent->xclient.message_type == 1899 else if ((xevent->xclient.message_type ==
diff --git a/src/lib/ecore_x/xlib/ecore_x_fixes.c b/src/lib/ecore_x/xlib/ecore_x_fixes.c
index da0a6c3..b647a90 100644
--- a/src/lib/ecore_x/xlib/ecore_x_fixes.c
+++ b/src/lib/ecore_x/xlib/ecore_x_fixes.c
@@ -130,6 +130,7 @@ ecore_x_region_new_from_bitmap(Ecore_X_Pixmap bitmap)
130 130
131 LOGFN(__FILE__, __LINE__, __FUNCTION__); 131 LOGFN(__FILE__, __LINE__, __FUNCTION__);
132 region = XFixesCreateRegionFromBitmap(_ecore_x_disp, bitmap); 132 region = XFixesCreateRegionFromBitmap(_ecore_x_disp, bitmap);
133 if (_ecore_xlib_sync) ecore_x_sync();
133 return region; 134 return region;
134#else /* ifdef ECORE_XFIXES */ 135#else /* ifdef ECORE_XFIXES */
135 return 0; 136 return 0;
@@ -145,6 +146,7 @@ ecore_x_region_new_from_window(Ecore_X_Window win,
145 146
146 LOGFN(__FILE__, __LINE__, __FUNCTION__); 147 LOGFN(__FILE__, __LINE__, __FUNCTION__);
147 region = XFixesCreateRegionFromWindow(_ecore_x_disp, win, type); 148 region = XFixesCreateRegionFromWindow(_ecore_x_disp, win, type);
149 if (_ecore_xlib_sync) ecore_x_sync();
148 return region; 150 return region;
149#else /* ifdef ECORE_XFIXES */ 151#else /* ifdef ECORE_XFIXES */
150 return 0; 152 return 0;
@@ -159,6 +161,7 @@ ecore_x_region_new_from_gc(Ecore_X_GC gc)
159 161
160 LOGFN(__FILE__, __LINE__, __FUNCTION__); 162 LOGFN(__FILE__, __LINE__, __FUNCTION__);
161 region = XFixesCreateRegionFromGC(_ecore_x_disp, gc); 163 region = XFixesCreateRegionFromGC(_ecore_x_disp, gc);
164 if (_ecore_xlib_sync) ecore_x_sync();
162 return region; 165 return region;
163#else /* ifdef ECORE_XFIXES */ 166#else /* ifdef ECORE_XFIXES */
164 return 0; 167 return 0;
@@ -173,6 +176,7 @@ ecore_x_region_new_from_picture(Ecore_X_Picture picture)
173 176
174 LOGFN(__FILE__, __LINE__, __FUNCTION__); 177 LOGFN(__FILE__, __LINE__, __FUNCTION__);
175 region = XFixesCreateRegionFromPicture(_ecore_x_disp, picture); 178 region = XFixesCreateRegionFromPicture(_ecore_x_disp, picture);
179 if (_ecore_xlib_sync) ecore_x_sync();
176 return region; 180 return region;
177#else /* ifdef ECORE_XFIXES */ 181#else /* ifdef ECORE_XFIXES */
178 return 0; 182 return 0;
@@ -197,6 +201,7 @@ ecore_x_region_set(Ecore_X_Region region,
197 XRectangle *xrect = _ecore_x_rectangle_ecore_to_x(rects, num); 201 XRectangle *xrect = _ecore_x_rectangle_ecore_to_x(rects, num);
198 LOGFN(__FILE__, __LINE__, __FUNCTION__); 202 LOGFN(__FILE__, __LINE__, __FUNCTION__);
199 XFixesSetRegion(_ecore_x_disp, region, xrect, num); 203 XFixesSetRegion(_ecore_x_disp, region, xrect, num);
204 if (_ecore_xlib_sync) ecore_x_sync();
200#endif /* ifdef ECORE_XFIXES */ 205#endif /* ifdef ECORE_XFIXES */
201} 206}
202 207
@@ -207,6 +212,7 @@ ecore_x_region_copy(Ecore_X_Region dest,
207#ifdef ECORE_XFIXES 212#ifdef ECORE_XFIXES
208 LOGFN(__FILE__, __LINE__, __FUNCTION__); 213 LOGFN(__FILE__, __LINE__, __FUNCTION__);
209 XFixesCopyRegion(_ecore_x_disp, dest, source); 214 XFixesCopyRegion(_ecore_x_disp, dest, source);
215 if (_ecore_xlib_sync) ecore_x_sync();
210#endif /* ifdef ECORE_XFIXES */ 216#endif /* ifdef ECORE_XFIXES */
211} 217}
212 218
@@ -218,6 +224,7 @@ ecore_x_region_combine(Ecore_X_Region dest,
218#ifdef ECORE_XFIXES 224#ifdef ECORE_XFIXES
219 LOGFN(__FILE__, __LINE__, __FUNCTION__); 225 LOGFN(__FILE__, __LINE__, __FUNCTION__);
220 XFixesUnionRegion(_ecore_x_disp, dest, source1, source2); 226 XFixesUnionRegion(_ecore_x_disp, dest, source1, source2);
227 if (_ecore_xlib_sync) ecore_x_sync();
221#endif /* ifdef ECORE_XFIXES */ 228#endif /* ifdef ECORE_XFIXES */
222} 229}
223 230
@@ -229,6 +236,7 @@ ecore_x_region_intersect(Ecore_X_Region dest,
229#ifdef ECORE_XFIXES 236#ifdef ECORE_XFIXES
230 LOGFN(__FILE__, __LINE__, __FUNCTION__); 237 LOGFN(__FILE__, __LINE__, __FUNCTION__);
231 XFixesIntersectRegion(_ecore_x_disp, dest, source1, source2); 238 XFixesIntersectRegion(_ecore_x_disp, dest, source1, source2);
239 if (_ecore_xlib_sync) ecore_x_sync();
232#endif /* ifdef ECORE_XFIXES */ 240#endif /* ifdef ECORE_XFIXES */
233} 241}
234 242
@@ -240,6 +248,7 @@ ecore_x_region_subtract(Ecore_X_Region dest,
240#ifdef ECORE_XFIXES 248#ifdef ECORE_XFIXES
241 LOGFN(__FILE__, __LINE__, __FUNCTION__); 249 LOGFN(__FILE__, __LINE__, __FUNCTION__);
242 XFixesSubtractRegion(_ecore_x_disp, dest, source1, source2); 250 XFixesSubtractRegion(_ecore_x_disp, dest, source1, source2);
251 if (_ecore_xlib_sync) ecore_x_sync();
243#endif /* ifdef ECORE_XFIXES */ 252#endif /* ifdef ECORE_XFIXES */
244} 253}
245 254
@@ -258,6 +267,7 @@ ecore_x_region_invert(Ecore_X_Region dest,
258 xbound = _ecore_x_rectangle_ecore_to_x(bounds, num); 267 xbound = _ecore_x_rectangle_ecore_to_x(bounds, num);
259 268
260 XFixesInvertRegion(_ecore_x_disp, dest, xbound, source); 269 XFixesInvertRegion(_ecore_x_disp, dest, xbound, source);
270 if (_ecore_xlib_sync) ecore_x_sync();
261#endif /* ifdef ECORE_XFIXES */ 271#endif /* ifdef ECORE_XFIXES */
262} 272}
263 273
@@ -269,6 +279,7 @@ ecore_x_region_translate(Ecore_X_Region region,
269#ifdef ECORE_XFIXES 279#ifdef ECORE_XFIXES
270 LOGFN(__FILE__, __LINE__, __FUNCTION__); 280 LOGFN(__FILE__, __LINE__, __FUNCTION__);
271 XFixesTranslateRegion(_ecore_x_disp, region, dx, dy); 281 XFixesTranslateRegion(_ecore_x_disp, region, dx, dy);
282 if (_ecore_xlib_sync) ecore_x_sync();
272#endif /* ifdef ECORE_XFIXES */ 283#endif /* ifdef ECORE_XFIXES */
273} 284}
274 285
@@ -279,6 +290,7 @@ ecore_x_region_extents(Ecore_X_Region dest,
279#ifdef ECORE_XFIXES 290#ifdef ECORE_XFIXES
280 LOGFN(__FILE__, __LINE__, __FUNCTION__); 291 LOGFN(__FILE__, __LINE__, __FUNCTION__);
281 XFixesRegionExtents(_ecore_x_disp, dest, source); 292 XFixesRegionExtents(_ecore_x_disp, dest, source);
293 if (_ecore_xlib_sync) ecore_x_sync();
282#endif /* ifdef ECORE_XFIXES */ 294#endif /* ifdef ECORE_XFIXES */
283} 295}
284 296
@@ -292,6 +304,7 @@ ecore_x_region_fetch(Ecore_X_Region region,
292 304
293 LOGFN(__FILE__, __LINE__, __FUNCTION__); 305 LOGFN(__FILE__, __LINE__, __FUNCTION__);
294 xrect = XFixesFetchRegionAndBounds(_ecore_x_disp, region, num, &xbound); 306 xrect = XFixesFetchRegionAndBounds(_ecore_x_disp, region, num, &xbound);
307 if (_ecore_xlib_sync) ecore_x_sync();
295 rects = _ecore_x_rectangle_x_to_ecore(xrect, *num); 308 rects = _ecore_x_rectangle_x_to_ecore(xrect, *num);
296 (*bounds).x = xbound.x; 309 (*bounds).x = xbound.x;
297 (*bounds).y = xbound.y; 310 (*bounds).y = xbound.y;
@@ -314,6 +327,7 @@ ecore_x_region_expand(Ecore_X_Region dest,
314#ifdef ECORE_XFIXES 327#ifdef ECORE_XFIXES
315 LOGFN(__FILE__, __LINE__, __FUNCTION__); 328 LOGFN(__FILE__, __LINE__, __FUNCTION__);
316 XFixesExpandRegion(_ecore_x_disp, dest, source, left, right, top, bottom); 329 XFixesExpandRegion(_ecore_x_disp, dest, source, left, right, top, bottom);
330 if (_ecore_xlib_sync) ecore_x_sync();
317#endif /* ifdef ECORE_XFIXES */ 331#endif /* ifdef ECORE_XFIXES */
318} 332}
319 333
@@ -326,6 +340,7 @@ ecore_x_region_gc_clip_set(Ecore_X_Region region,
326#ifdef ECORE_XFIXES 340#ifdef ECORE_XFIXES
327 LOGFN(__FILE__, __LINE__, __FUNCTION__); 341 LOGFN(__FILE__, __LINE__, __FUNCTION__);
328 XFixesSetGCClipRegion(_ecore_x_disp, gc, x_origin, y_origin, region); 342 XFixesSetGCClipRegion(_ecore_x_disp, gc, x_origin, y_origin, region);
343 if (_ecore_xlib_sync) ecore_x_sync();
329#endif /* ifdef ECORE_XFIXES */ 344#endif /* ifdef ECORE_XFIXES */
330} 345}
331 346
@@ -344,6 +359,7 @@ ecore_x_region_window_shape_set(Ecore_X_Region region,
344 x_offset, 359 x_offset,
345 y_offset, 360 y_offset,
346 region); 361 region);
362 if (_ecore_xlib_sync) ecore_x_sync();
347#endif /* ifdef ECORE_XFIXES */ 363#endif /* ifdef ECORE_XFIXES */
348} 364}
349 365
@@ -360,6 +376,7 @@ ecore_x_region_picture_clip_set(Ecore_X_Region region,
360 x_origin, 376 x_origin,
361 y_origin, 377 y_origin,
362 region); 378 region);
379 if (_ecore_xlib_sync) ecore_x_sync();
363#endif /* ifdef ECORE_XFIXES */ 380#endif /* ifdef ECORE_XFIXES */
364} 381}
365 382
diff --git a/src/lib/ecore_x/xlib/ecore_x_gc.c b/src/lib/ecore_x/xlib/ecore_x_gc.c
index 5396366..6b8168b 100644
--- a/src/lib/ecore_x/xlib/ecore_x_gc.c
+++ b/src/lib/ecore_x/xlib/ecore_x_gc.c
@@ -23,6 +23,7 @@ ecore_x_gc_new(Ecore_X_Drawable draw,
23 Ecore_X_GC_Value_Mask value_mask, 23 Ecore_X_GC_Value_Mask value_mask,
24 const unsigned int *value_list) 24 const unsigned int *value_list)
25{ 25{
26 Ecore_X_GC gc;
26 XGCValues gcv; 27 XGCValues gcv;
27 int mask; 28 int mask;
28 int idx; 29 int idx;
@@ -155,7 +156,9 @@ ecore_x_gc_new(Ecore_X_Drawable draw,
155 } 156 }
156 } 157 }
157 158
158 return XCreateGC(_ecore_x_disp, draw, value_mask, &gcv); 159 gc = XCreateGC(_ecore_x_disp, draw, value_mask, &gcv);
160 if (_ecore_xlib_sync) ecore_x_sync();
161 return gc;
159} 162}
160 163
161/** 164/**
@@ -167,5 +170,6 @@ ecore_x_gc_free(Ecore_X_GC gc)
167{ 170{
168 LOGFN(__FILE__, __LINE__, __FUNCTION__); 171 LOGFN(__FILE__, __LINE__, __FUNCTION__);
169 XFreeGC(_ecore_x_disp, gc); 172 XFreeGC(_ecore_x_disp, gc);
173 if (_ecore_xlib_sync) ecore_x_sync();
170} 174}
171 175
diff --git a/src/lib/ecore_x/xlib/ecore_x_gesture.c b/src/lib/ecore_x/xlib/ecore_x_gesture.c
index dbde8b0..a8b2b72 100644
--- a/src/lib/ecore_x/xlib/ecore_x_gesture.c
+++ b/src/lib/ecore_x/xlib/ecore_x_gesture.c
@@ -53,6 +53,7 @@ ecore_x_gesture_events_select(Ecore_X_Window win,
53 53
54 LOGFN(__FILE__, __LINE__, __FUNCTION__); 54 LOGFN(__FILE__, __LINE__, __FUNCTION__);
55 XGestureSelectEvents(_ecore_x_disp, win, mask); 55 XGestureSelectEvents(_ecore_x_disp, win, mask);
56 if (_ecore_xlib_sync) ecore_x_sync();
56 57
57 return EINA_TRUE; 58 return EINA_TRUE;
58#else /* ifdef ECORE_XGESTURE */ 59#else /* ifdef ECORE_XGESTURE */
@@ -73,10 +74,8 @@ ecore_x_gesture_events_selected_get(Ecore_X_Window win)
73 74
74 LOGFN(__FILE__, __LINE__, __FUNCTION__); 75 LOGFN(__FILE__, __LINE__, __FUNCTION__);
75 if (GestureSuccess != XGestureGetSelectedEvents(_ecore_x_disp, win, &mask)) 76 if (GestureSuccess != XGestureGetSelectedEvents(_ecore_x_disp, win, &mask))
76 { 77 mask = ECORE_X_GESTURE_EVENT_MASK_NONE;
77 mask = ECORE_X_GESTURE_EVENT_MASK_NONE; 78 if (_ecore_xlib_sync) ecore_x_sync();
78 return mask;
79 }
80 79
81 return mask; 80 return mask;
82#else /* ifdef ECORE_XGESTURE */ 81#else /* ifdef ECORE_XGESTURE */
@@ -91,16 +90,14 @@ ecore_x_gesture_event_grab(Ecore_X_Window win,
91 int num_fingers) 90 int num_fingers)
92{ 91{
93#ifdef ECORE_XGESTURE 92#ifdef ECORE_XGESTURE
93 Eina_Bool ret;
94 if (!_gesture_available) 94 if (!_gesture_available)
95 return EINA_FALSE; 95 return EINA_FALSE;
96 96
97 LOGFN(__FILE__, __LINE__, __FUNCTION__); 97 LOGFN(__FILE__, __LINE__, __FUNCTION__);
98 if (GestureGrabSuccess != XGestureGrabEvent(_ecore_x_disp, win, type, num_fingers, CurrentTime)) 98 ret = (GestureGrabSuccess == XGestureGrabEvent(_ecore_x_disp, win, type, num_fingers, CurrentTime));
99 { 99 if (_ecore_xlib_sync) ecore_x_sync();
100 return EINA_FALSE; 100 return ret;
101 }
102
103 return EINA_TRUE;
104#else /* ifdef ECORE_XGESTURE */ 101#else /* ifdef ECORE_XGESTURE */
105 (void) win; 102 (void) win;
106 (void) type; 103 (void) type;
@@ -116,17 +113,15 @@ ecore_x_gesture_event_ungrab(Ecore_X_Window win,
116{ 113{
117#ifdef ECORE_XGESTURE 114#ifdef ECORE_XGESTURE
118 Ecore_X_Gesture_Event_Mask mask; 115 Ecore_X_Gesture_Event_Mask mask;
116 Eina_Bool ret;
119 117
120 if (!_gesture_available) 118 if (!_gesture_available)
121 return EINA_FALSE; 119 return EINA_FALSE;
122 120
123 LOGFN(__FILE__, __LINE__, __FUNCTION__); 121 LOGFN(__FILE__, __LINE__, __FUNCTION__);
124 if (GestureUngrabSuccess != XGestureUngrabEvent(_ecore_x_disp, win, type, num_fingers, CurrentTime)) 122 ret = (GestureUngrabSuccess == XGestureUngrabEvent(_ecore_x_disp, win, type, num_fingers, CurrentTime));
125 { 123 if (_ecore_xlib_sync) ecore_x_sync();
126 return EINA_FALSE; 124 return ret;
127 }
128
129 return EINA_TRUE;
130#else /* ifdef ECORE_XGESTURE */ 125#else /* ifdef ECORE_XGESTURE */
131 (void) win; 126 (void) win;
132 (void) type; 127 (void) type;
diff --git a/src/lib/ecore_x/xlib/ecore_x_icccm.c b/src/lib/ecore_x/xlib/ecore_x_icccm.c
index e8d34e5..3ca73fb 100644
--- a/src/lib/ecore_x/xlib/ecore_x_icccm.c
+++ b/src/lib/ecore_x/xlib/ecore_x_icccm.c
@@ -41,6 +41,7 @@ ecore_x_icccm_state_set(Ecore_X_Window win,
41 XChangeProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_STATE, 41 XChangeProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_STATE,
42 ECORE_X_ATOM_WM_STATE, 32, PropModeReplace, 42 ECORE_X_ATOM_WM_STATE, 32, PropModeReplace,
43 (unsigned char *)c, 2); 43 (unsigned char *)c, 2);
44 if (_ecore_xlib_sync) ecore_x_sync();
44} 45}
45 46
46EAPI Ecore_X_Window_State_Hint 47EAPI Ecore_X_Window_State_Hint
@@ -58,6 +59,7 @@ ecore_x_icccm_state_get(Ecore_X_Window win)
58 0, 0x7fffffff, False, ECORE_X_ATOM_WM_STATE, 59 0, 0x7fffffff, False, ECORE_X_ATOM_WM_STATE,
59 &type_ret, &format_ret, &num_ret, &bytes_after, 60 &type_ret, &format_ret, &num_ret, &bytes_after,
60 &prop_ret); 61 &prop_ret);
62 if (_ecore_xlib_sync) ecore_x_sync();
61 if ((prop_ret) && (num_ret == 2)) 63 if ((prop_ret) && (num_ret == 2))
62 { 64 {
63 if (prop_ret[0] == WithdrawnState) 65 if (prop_ret[0] == WithdrawnState)
@@ -129,6 +131,7 @@ ecore_x_icccm_move_resize_send(Ecore_X_Window win,
129 ev.xconfigure.above = None; 131 ev.xconfigure.above = None;
130 ev.xconfigure.override_redirect = False; 132 ev.xconfigure.override_redirect = False;
131 XSendEvent(_ecore_x_disp, win, False, StructureNotifyMask, &ev); 133 XSendEvent(_ecore_x_disp, win, False, StructureNotifyMask, &ev);
134 if (_ecore_xlib_sync) ecore_x_sync();
132} 135}
133 136
134EAPI void 137EAPI void
@@ -185,6 +188,7 @@ ecore_x_icccm_hints_set(Ecore_X_Window win,
185 hints->flags |= XUrgencyHint; 188 hints->flags |= XUrgencyHint;
186 189
187 XSetWMHints(_ecore_x_disp, win, hints); 190 XSetWMHints(_ecore_x_disp, win, hints);
191 if (_ecore_xlib_sync) ecore_x_sync();
188 XFree(hints); 192 XFree(hints);
189} 193}
190 194
@@ -223,6 +227,7 @@ ecore_x_icccm_hints_get(Ecore_X_Window win,
223 *is_urgent = EINA_FALSE; 227 *is_urgent = EINA_FALSE;
224 228
225 hints = XGetWMHints(_ecore_x_disp, win); 229 hints = XGetWMHints(_ecore_x_disp, win);
230 if (_ecore_xlib_sync) ecore_x_sync();
226 if (hints) 231 if (hints)
227 { 232 {
228 if ((hints->flags & InputHint) && (accepts_focus)) 233 if ((hints->flags & InputHint) && (accepts_focus))
@@ -286,6 +291,7 @@ ecore_x_icccm_size_pos_hints_set(Ecore_X_Window win,
286 LOGFN(__FILE__, __LINE__, __FUNCTION__); 291 LOGFN(__FILE__, __LINE__, __FUNCTION__);
287 if (!XGetWMNormalHints(_ecore_x_disp, win, &hint, &mask)) 292 if (!XGetWMNormalHints(_ecore_x_disp, win, &hint, &mask))
288 memset(&hint, 0, sizeof(XSizeHints)); 293 memset(&hint, 0, sizeof(XSizeHints));
294 if (_ecore_xlib_sync) ecore_x_sync();
289 295
290 hint.flags = 0; 296 hint.flags = 0;
291 if (request_pos) 297 if (request_pos)
@@ -335,6 +341,7 @@ ecore_x_icccm_size_pos_hints_set(Ecore_X_Window win,
335 } 341 }
336 342
337 XSetWMNormalHints(_ecore_x_disp, win, &hint); 343 XSetWMNormalHints(_ecore_x_disp, win, &hint);
344 if (_ecore_xlib_sync) ecore_x_sync();
338} 345}
339 346
340EAPI Eina_Bool 347EAPI Eina_Bool
@@ -363,7 +370,10 @@ ecore_x_icccm_size_pos_hints_get(Ecore_X_Window win,
363 370
364 LOGFN(__FILE__, __LINE__, __FUNCTION__); 371 LOGFN(__FILE__, __LINE__, __FUNCTION__);
365 if (!XGetWMNormalHints(_ecore_x_disp, win, &hint, &mask)) 372 if (!XGetWMNormalHints(_ecore_x_disp, win, &hint, &mask))
366 return EINA_FALSE; 373 {
374 if (_ecore_xlib_sync) ecore_x_sync();
375 return EINA_FALSE;
376 }
367 377
368 if ((hint.flags & USPosition) || ((hint.flags & PPosition))) 378 if ((hint.flags & USPosition) || ((hint.flags & PPosition)))
369 { 379 {
@@ -486,15 +496,18 @@ ecore_x_icccm_title_set(Ecore_X_Window win,
486 XmbTextListToTextProperty(_ecore_x_disp, list, 1, XStdICCTextStyle, 496 XmbTextListToTextProperty(_ecore_x_disp, list, 1, XStdICCTextStyle,
487 &xprop); 497 &xprop);
488#endif /* ifdef X_HAVE_UTF8_STRING */ 498#endif /* ifdef X_HAVE_UTF8_STRING */
499 if (_ecore_xlib_sync) ecore_x_sync();
489 if (ret >= Success) 500 if (ret >= Success)
490 { 501 {
491 XSetWMName(_ecore_x_disp, win, &xprop); 502 XSetWMName(_ecore_x_disp, win, &xprop);
503 if (_ecore_xlib_sync) ecore_x_sync();
492 if (xprop.value) 504 if (xprop.value)
493 XFree(xprop.value); 505 XFree(xprop.value);
494 } 506 }
495 else if (XStringListToTextProperty(list, 1, &xprop) >= Success) 507 else if (XStringListToTextProperty(list, 1, &xprop) >= Success)
496 { 508 {
497 XSetWMName(_ecore_x_disp, win, &xprop); 509 XSetWMName(_ecore_x_disp, win, &xprop);
510 if (_ecore_xlib_sync) ecore_x_sync();
498 if (xprop.value) 511 if (xprop.value)
499 XFree(xprop.value); 512 XFree(xprop.value);
500 } 513 }
@@ -511,6 +524,7 @@ ecore_x_icccm_title_get(Ecore_X_Window win)
511 xprop.value = NULL; 524 xprop.value = NULL;
512 if (XGetWMName(_ecore_x_disp, win, &xprop) >= Success) 525 if (XGetWMName(_ecore_x_disp, win, &xprop) >= Success)
513 { 526 {
527 if (_ecore_xlib_sync) ecore_x_sync();
514 if (xprop.value) 528 if (xprop.value)
515 { 529 {
516 char **list = NULL; 530 char **list = NULL;
@@ -530,6 +544,7 @@ ecore_x_icccm_title_get(Ecore_X_Window win)
530 ret = XmbTextPropertyToTextList(_ecore_x_disp, &xprop, 544 ret = XmbTextPropertyToTextList(_ecore_x_disp, &xprop,
531 &list, &num); 545 &list, &num);
532#endif /* ifdef X_HAVE_UTF8_STRING */ 546#endif /* ifdef X_HAVE_UTF8_STRING */
547 if (_ecore_xlib_sync) ecore_x_sync();
533 548
534 if ((ret == XLocaleNotSupported) || 549 if ((ret == XLocaleNotSupported) ||
535 (ret == XNoMemory) || (ret == XConverterNotFound)) 550 (ret == XNoMemory) || (ret == XConverterNotFound))
@@ -547,6 +562,10 @@ ecore_x_icccm_title_get(Ecore_X_Window win)
547 return t; 562 return t;
548 } 563 }
549 } 564 }
565 else
566 {
567 if (_ecore_xlib_sync) ecore_x_sync();
568 }
550 569
551 return NULL; 570 return NULL;
552} 571}
@@ -567,6 +586,7 @@ ecore_x_icccm_protocol_atoms_set(Ecore_X_Window win,
567 XSetWMProtocols(_ecore_x_disp, win, (Atom *)(protos), num); 586 XSetWMProtocols(_ecore_x_disp, win, (Atom *)(protos), num);
568 else 587 else
569 XDeleteProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_PROTOCOLS); 588 XDeleteProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_PROTOCOLS);
589 if (_ecore_xlib_sync) ecore_x_sync();
570} 590}
571 591
572/** 592/**
@@ -598,7 +618,7 @@ ecore_x_icccm_protocol_set(Ecore_X_Window win,
598 protos = NULL; 618 protos = NULL;
599 protos_count = 0; 619 protos_count = 0;
600 } 620 }
601 621 if (_ecore_xlib_sync) ecore_x_sync();
602 for (i = 0; i < protos_count; i++) 622 for (i = 0; i < protos_count; i++)
603 { 623 {
604 if (protos[i] == proto) 624 if (protos[i] == proto)
@@ -623,6 +643,7 @@ ecore_x_icccm_protocol_set(Ecore_X_Window win,
623 new_protos[i] = protos[i]; 643 new_protos[i] = protos[i];
624 new_protos[protos_count] = proto; 644 new_protos[protos_count] = proto;
625 XSetWMProtocols(_ecore_x_disp, win, new_protos, protos_count + 1); 645 XSetWMProtocols(_ecore_x_disp, win, new_protos, protos_count + 1);
646 if (_ecore_xlib_sync) ecore_x_sync();
626 free(new_protos); 647 free(new_protos);
627 } 648 }
628 else 649 else
@@ -644,6 +665,7 @@ ecore_x_icccm_protocol_set(Ecore_X_Window win,
644 else 665 else
645 XDeleteProperty(_ecore_x_disp, win, 666 XDeleteProperty(_ecore_x_disp, win,
646 ECORE_X_ATOM_WM_PROTOCOLS); 667 ECORE_X_ATOM_WM_PROTOCOLS);
668 if (_ecore_xlib_sync) ecore_x_sync();
647 669
648 goto leave; 670 goto leave;
649 } 671 }
@@ -678,6 +700,7 @@ ecore_x_icccm_protocol_isset(Ecore_X_Window win,
678 700
679 if (!XGetWMProtocols(_ecore_x_disp, win, &protos, &protos_count)) 701 if (!XGetWMProtocols(_ecore_x_disp, win, &protos, &protos_count))
680 return EINA_FALSE; 702 return EINA_FALSE;
703 if (_ecore_xlib_sync) ecore_x_sync();
681 704
682 for (i = 0; i < protos_count; i++) 705 for (i = 0; i < protos_count; i++)
683 if (protos[i] == proto) 706 if (protos[i] == proto)
@@ -715,6 +738,7 @@ ecore_x_icccm_name_class_set(Ecore_X_Window win,
715 xch->res_name = (char *)n; 738 xch->res_name = (char *)n;
716 xch->res_class = (char *)c; 739 xch->res_class = (char *)c;
717 XSetClassHint(_ecore_x_disp, win, xch); 740 XSetClassHint(_ecore_x_disp, win, xch);
741 if (_ecore_xlib_sync) ecore_x_sync();
718 XFree(xch); 742 XFree(xch);
719} 743}
720 744
@@ -755,6 +779,7 @@ ecore_x_icccm_name_class_get(Ecore_X_Window win,
755 XFree(xch.res_name); 779 XFree(xch.res_name);
756 XFree(xch.res_class); 780 XFree(xch.res_class);
757 } 781 }
782 if (_ecore_xlib_sync) ecore_x_sync();
758} 783}
759 784
760/** 785/**
@@ -788,6 +813,7 @@ ecore_x_icccm_command_set(Ecore_X_Window win,
788{ 813{
789 LOGFN(__FILE__, __LINE__, __FUNCTION__); 814 LOGFN(__FILE__, __LINE__, __FUNCTION__);
790 XSetCommand(_ecore_x_disp, win, argv, argc); 815 XSetCommand(_ecore_x_disp, win, argv, argc);
816 if (_ecore_xlib_sync) ecore_x_sync();
791} 817}
792 818
793/** 819/**
@@ -806,6 +832,7 @@ ecore_x_icccm_command_get(Ecore_X_Window win,
806{ 832{
807 int i, c; 833 int i, c;
808 char **v; 834 char **v;
835 Eina_Bool success;
809 836
810 if (argc) 837 if (argc)
811 *argc = 0; 838 *argc = 0;
@@ -814,8 +841,9 @@ ecore_x_icccm_command_get(Ecore_X_Window win,
814 *argv = NULL; 841 *argv = NULL;
815 842
816 LOGFN(__FILE__, __LINE__, __FUNCTION__); 843 LOGFN(__FILE__, __LINE__, __FUNCTION__);
817 if (!XGetCommand(_ecore_x_disp, win, &v, &c)) 844 success = XGetCommand(_ecore_x_disp, win, &v, &c);
818 return; 845 if (_ecore_xlib_sync) ecore_x_sync();
846 if (!success) return;
819 847
820 if (c < 1) 848 if (c < 1)
821 { 849 {
@@ -878,15 +906,18 @@ ecore_x_icccm_icon_name_set(Ecore_X_Window win,
878 ret = XmbTextListToTextProperty(_ecore_x_disp, list, 1, 906 ret = XmbTextListToTextProperty(_ecore_x_disp, list, 1,
879 XStdICCTextStyle, &xprop); 907 XStdICCTextStyle, &xprop);
880#endif /* ifdef X_HAVE_UTF8_STRING */ 908#endif /* ifdef X_HAVE_UTF8_STRING */
909 if (_ecore_xlib_sync) ecore_x_sync();
881 if (ret >= Success) 910 if (ret >= Success)
882 { 911 {
883 XSetWMIconName(_ecore_x_disp, win, &xprop); 912 XSetWMIconName(_ecore_x_disp, win, &xprop);
913 if (_ecore_xlib_sync) ecore_x_sync();
884 if (xprop.value) 914 if (xprop.value)
885 XFree(xprop.value); 915 XFree(xprop.value);
886 } 916 }
887 else if (XStringListToTextProperty(list, 1, &xprop) >= Success) 917 else if (XStringListToTextProperty(list, 1, &xprop) >= Success)
888 { 918 {
889 XSetWMIconName(_ecore_x_disp, win, &xprop); 919 XSetWMIconName(_ecore_x_disp, win, &xprop);
920 if (_ecore_xlib_sync) ecore_x_sync();
890 if (xprop.value) 921 if (xprop.value)
891 XFree(xprop.value); 922 XFree(xprop.value);
892 } 923 }
@@ -910,6 +941,7 @@ ecore_x_icccm_icon_name_get(Ecore_X_Window win)
910 xprop.value = NULL; 941 xprop.value = NULL;
911 if (XGetWMIconName(_ecore_x_disp, win, &xprop) >= Success) 942 if (XGetWMIconName(_ecore_x_disp, win, &xprop) >= Success)
912 { 943 {
944 if (_ecore_xlib_sync) ecore_x_sync();
913 if (xprop.value) 945 if (xprop.value)
914 { 946 {
915 char **list = NULL; 947 char **list = NULL;
@@ -929,6 +961,7 @@ ecore_x_icccm_icon_name_get(Ecore_X_Window win)
929 ret = XmbTextPropertyToTextList(_ecore_x_disp, &xprop, 961 ret = XmbTextPropertyToTextList(_ecore_x_disp, &xprop,
930 &list, &num); 962 &list, &num);
931#endif /* ifdef X_HAVE_UTF8_STRING */ 963#endif /* ifdef X_HAVE_UTF8_STRING */
964 if (_ecore_xlib_sync) ecore_x_sync();
932 965
933 if ((ret == XLocaleNotSupported) || 966 if ((ret == XLocaleNotSupported) ||
934 (ret == XNoMemory) || (ret == XConverterNotFound)) 967 (ret == XNoMemory) || (ret == XConverterNotFound))
@@ -949,6 +982,10 @@ ecore_x_icccm_icon_name_get(Ecore_X_Window win)
949 return t; 982 return t;
950 } 983 }
951 } 984 }
985 else
986 {
987 if (_ecore_xlib_sync) ecore_x_sync();
988 }
952 989
953 return NULL; 990 return NULL;
954} 991}
@@ -1056,6 +1093,7 @@ ecore_x_icccm_colormap_window_unset(Ecore_X_Window win,
1056 { 1093 {
1057 XDeleteProperty(_ecore_x_disp, 1094 XDeleteProperty(_ecore_x_disp,
1058 win, ECORE_X_ATOM_WM_COLORMAP_WINDOWS); 1095 win, ECORE_X_ATOM_WM_COLORMAP_WINDOWS);
1096 if (_ecore_xlib_sync) ecore_x_sync();
1059 if (old_data) 1097 if (old_data)
1060 XFree(old_data); 1098 XFree(old_data);
1061 1099
@@ -1102,6 +1140,7 @@ ecore_x_icccm_transient_for_set(Ecore_X_Window win,
1102{ 1140{
1103 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1141 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1104 XSetTransientForHint(_ecore_x_disp, win, forwin); 1142 XSetTransientForHint(_ecore_x_disp, win, forwin);
1143 if (_ecore_xlib_sync) ecore_x_sync();
1105} 1144}
1106 1145
1107/** 1146/**
@@ -1113,6 +1152,7 @@ ecore_x_icccm_transient_for_unset(Ecore_X_Window win)
1113{ 1152{
1114 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1153 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1115 XDeleteProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_TRANSIENT_FOR); 1154 XDeleteProperty(_ecore_x_disp, win, ECORE_X_ATOM_WM_TRANSIENT_FOR);
1155 if (_ecore_xlib_sync) ecore_x_sync();
1116} 1156}
1117 1157
1118/** 1158/**
@@ -1124,9 +1164,12 @@ EAPI Ecore_X_Window
1124ecore_x_icccm_transient_for_get(Ecore_X_Window win) 1164ecore_x_icccm_transient_for_get(Ecore_X_Window win)
1125{ 1165{
1126 Window forwin; 1166 Window forwin;
1167 Eina_Bool success;
1127 1168
1128 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1169 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1129 if (XGetTransientForHint(_ecore_x_disp, win, &forwin)) 1170 success = XGetTransientForHint(_ecore_x_disp, win, &forwin);
1171 if (_ecore_xlib_sync) ecore_x_sync();
1172 if (success)
1130 return (Ecore_X_Window)forwin; 1173 return (Ecore_X_Window)forwin;
1131 else 1174 else
1132 return 0; 1175 return 0;
@@ -1216,6 +1259,7 @@ ecore_x_icccm_iconic_request_send(Ecore_X_Window win,
1216 1259
1217 XSendEvent(_ecore_x_disp, root, False, 1260 XSendEvent(_ecore_x_disp, root, False,
1218 SubstructureNotifyMask | SubstructureRedirectMask, &xev); 1261 SubstructureNotifyMask | SubstructureRedirectMask, &xev);
1262 if (_ecore_xlib_sync) ecore_x_sync();
1219} 1263}
1220 1264
1221/* FIXME: there are older E hints, gnome hints and mwm hints and new netwm */ 1265/* FIXME: there are older E hints, gnome hints and mwm hints and new netwm */
diff --git a/src/lib/ecore_x/xlib/ecore_x_image.c b/src/lib/ecore_x/xlib/ecore_x_image.c
index af7417e..a408f16 100644
--- a/src/lib/ecore_x/xlib/ecore_x_image.c
+++ b/src/lib/ecore_x/xlib/ecore_x_image.c
@@ -106,6 +106,7 @@ _ecore_x_image_shm_check(void)
106 DefaultScreen(_ecore_x_disp)), 106 DefaultScreen(_ecore_x_disp)),
107 ZPixmap, NULL, 107 ZPixmap, NULL,
108 &shminfo, 1, 1); 108 &shminfo, 1, 1);
109 if (_ecore_xlib_sync) ecore_x_sync();
109 if (!xim) 110 if (!xim)
110 { 111 {
111 _ecore_x_image_shm_can = 0; 112 _ecore_x_image_shm_can = 0;
@@ -370,11 +371,15 @@ ecore_x_image_put(Ecore_X_Image *im,
370 memset(&gcv, 0, sizeof(gcv)); 371 memset(&gcv, 0, sizeof(gcv));
371 gcv.subwindow_mode = IncludeInferiors; 372 gcv.subwindow_mode = IncludeInferiors;
372 tgc = XCreateGC(_ecore_x_disp, draw, GCSubwindowMode, &gcv); 373 tgc = XCreateGC(_ecore_x_disp, draw, GCSubwindowMode, &gcv);
374 if (_ecore_xlib_sync) ecore_x_sync();
373 gc = tgc; 375 gc = tgc;
374 } 376 }
375 if (!im->xim) _ecore_x_image_shm_create(im); 377 if (!im->xim) _ecore_x_image_shm_create(im);
376 if (im->xim) 378 if (im->xim)
377 XShmPutImage(_ecore_x_disp, draw, gc, im->xim, sx, sy, x, y, w, h, False); 379 {
380 XShmPutImage(_ecore_x_disp, draw, gc, im->xim, sx, sy, x, y, w, h, False);
381 if (_ecore_xlib_sync) ecore_x_sync();
382 }
378 if (tgc) ecore_x_gc_free(tgc); 383 if (tgc) ecore_x_gc_free(tgc);
379} 384}
380 385
diff --git a/src/lib/ecore_x/xlib/ecore_x_netwm.c b/src/lib/ecore_x/xlib/ecore_x_netwm.c
index 40741a1..b15832d 100644
--- a/src/lib/ecore_x/xlib/ecore_x_netwm.c
+++ b/src/lib/ecore_x/xlib/ecore_x_netwm.c
@@ -214,6 +214,7 @@ ecore_x_netwm_desk_names_set(Ecore_X_Window root,
214 } 214 }
215 215
216 _ATOM_SET_UTF8_STRING_LIST(root, ECORE_X_ATOM_NET_DESKTOP_NAMES, buf, len); 216 _ATOM_SET_UTF8_STRING_LIST(root, ECORE_X_ATOM_NET_DESKTOP_NAMES, buf, len);
217 if (_ecore_xlib_sync) ecore_x_sync();
217 218
218 free(buf); 219 free(buf);
219} 220}
@@ -370,6 +371,7 @@ ecore_x_netwm_client_active_request(Ecore_X_Window root,
370 371
371 XSendEvent(_ecore_x_disp, root, False, 372 XSendEvent(_ecore_x_disp, root, False,
372 SubstructureRedirectMask | SubstructureNotifyMask, &xev); 373 SubstructureRedirectMask | SubstructureNotifyMask, &xev);
374 if (_ecore_xlib_sync) ecore_x_sync();
373} 375}
374 376
375EAPI void 377EAPI void
@@ -1517,6 +1519,7 @@ ecore_x_netwm_ping_send(Ecore_X_Window win)
1517 xev.xclient.data.l[4] = 0; 1519 xev.xclient.data.l[4] = 0;
1518 1520
1519 XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev); 1521 XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev);
1522 if (_ecore_xlib_sync) ecore_x_sync();
1520} 1523}
1521 1524
1522EAPI void 1525EAPI void
@@ -1544,6 +1547,7 @@ ecore_x_netwm_sync_request_send(Ecore_X_Window win,
1544 xev.xclient.data.l[4] = 0; 1547 xev.xclient.data.l[4] = 0;
1545 1548
1546 XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev); 1549 XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev);
1550 if (_ecore_xlib_sync) ecore_x_sync();
1547} 1551}
1548 1552
1549EAPI void 1553EAPI void
@@ -1579,6 +1583,7 @@ ecore_x_netwm_state_request_send(Ecore_X_Window win,
1579 1583
1580 XSendEvent(_ecore_x_disp, root, False, 1584 XSendEvent(_ecore_x_disp, root, False,
1581 SubstructureNotifyMask | SubstructureRedirectMask, &xev); 1585 SubstructureNotifyMask | SubstructureRedirectMask, &xev);
1586 if (_ecore_xlib_sync) ecore_x_sync();
1582} 1587}
1583 1588
1584EAPI void 1589EAPI void
@@ -1606,6 +1611,7 @@ ecore_x_netwm_desktop_request_send(Ecore_X_Window win,
1606 1611
1607 XSendEvent(_ecore_x_disp, root, False, 1612 XSendEvent(_ecore_x_disp, root, False,
1608 SubstructureNotifyMask | SubstructureRedirectMask, &xev); 1613 SubstructureNotifyMask | SubstructureRedirectMask, &xev);
1614 if (_ecore_xlib_sync) ecore_x_sync();
1609} 1615}
1610 1616
1611EAPI void 1617EAPI void
@@ -1633,6 +1639,7 @@ ecore_x_netwm_moveresize_request_send(Ecore_X_Window win,
1633 1639
1634 XSendEvent(_ecore_x_disp, win, False, 1640 XSendEvent(_ecore_x_disp, win, False,
1635 SubstructureNotifyMask | SubstructureRedirectMask, &xev); 1641 SubstructureNotifyMask | SubstructureRedirectMask, &xev);
1642 if (_ecore_xlib_sync) ecore_x_sync();
1636} 1643}
1637 1644
1638int 1645int
@@ -1733,6 +1740,7 @@ _ecore_x_window_prop_string_utf8_set(Ecore_X_Window win,
1733{ 1740{
1734 XChangeProperty(_ecore_x_disp, win, atom, ECORE_X_ATOM_UTF8_STRING, 8, 1741 XChangeProperty(_ecore_x_disp, win, atom, ECORE_X_ATOM_UTF8_STRING, 8,
1735 PropModeReplace, (unsigned char *)str, strlen(str)); 1742 PropModeReplace, (unsigned char *)str, strlen(str));
1743 if (_ecore_xlib_sync) ecore_x_sync();
1736} 1744}
1737 1745
1738/* 1746/*
@@ -1753,6 +1761,7 @@ _ecore_x_window_prop_string_utf8_get(Ecore_X_Window win,
1753 XGetWindowProperty(_ecore_x_disp, win, atom, 0, 0x7fffffff, False, 1761 XGetWindowProperty(_ecore_x_disp, win, atom, 0, 0x7fffffff, False,
1754 ECORE_X_ATOM_UTF8_STRING, &type_ret, 1762 ECORE_X_ATOM_UTF8_STRING, &type_ret,
1755 &format_ret, &num_ret, &bytes_after, &prop_ret); 1763 &format_ret, &num_ret, &bytes_after, &prop_ret);
1764 if (_ecore_xlib_sync) ecore_x_sync();
1756 if (prop_ret && num_ret > 0 && format_ret == 8) 1765 if (prop_ret && num_ret > 0 && format_ret == 8)
1757 { 1766 {
1758 str = malloc(num_ret + 1); 1767 str = malloc(num_ret + 1);
@@ -2058,6 +2067,7 @@ ecore_x_screen_is_composited(int screen)
2058 atom = XInternAtom(_ecore_x_disp, buf, True); 2067 atom = XInternAtom(_ecore_x_disp, buf, True);
2059 if (atom == None) return EINA_FALSE; 2068 if (atom == None) return EINA_FALSE;
2060 win = XGetSelectionOwner(_ecore_x_disp, atom); 2069 win = XGetSelectionOwner(_ecore_x_disp, atom);
2070 if (_ecore_xlib_sync) ecore_x_sync();
2061 return (win != None) ? EINA_TRUE : EINA_FALSE; 2071 return (win != None) ? EINA_TRUE : EINA_FALSE;
2062} 2072}
2063 2073
@@ -2073,5 +2083,6 @@ ecore_x_screen_is_composited_set(int screen,
2073 atom = XInternAtom(_ecore_x_disp, buf, False); 2083 atom = XInternAtom(_ecore_x_disp, buf, False);
2074 if (atom == None) return; 2084 if (atom == None) return;
2075 XSetSelectionOwner(_ecore_x_disp, atom, win, _ecore_x_event_last_time); 2085 XSetSelectionOwner(_ecore_x_disp, atom, win, _ecore_x_event_last_time);
2086 if (_ecore_xlib_sync) ecore_x_sync();
2076} 2087}
2077 2088
diff --git a/src/lib/ecore_x/xlib/ecore_x_pixmap.c b/src/lib/ecore_x/xlib/ecore_x_pixmap.c
index 72fd796..30903c1 100644
--- a/src/lib/ecore_x/xlib/ecore_x_pixmap.c
+++ b/src/lib/ecore_x/xlib/ecore_x_pixmap.c
@@ -31,6 +31,7 @@ ecore_x_pixmap_new(Ecore_X_Window win,
31 int h, 31 int h,
32 int dep) 32 int dep)
33{ 33{
34 Ecore_X_Pixmap pm;
34 LOGFN(__FILE__, __LINE__, __FUNCTION__); 35 LOGFN(__FILE__, __LINE__, __FUNCTION__);
35 if (win == 0) 36 if (win == 0)
36 win = DefaultRootWindow(_ecore_x_disp); 37 win = DefaultRootWindow(_ecore_x_disp);
@@ -38,7 +39,9 @@ ecore_x_pixmap_new(Ecore_X_Window win,
38 if (dep == 0) 39 if (dep == 0)
39 dep = DefaultDepth(_ecore_x_disp, DefaultScreen(_ecore_x_disp)); 40 dep = DefaultDepth(_ecore_x_disp, DefaultScreen(_ecore_x_disp));
40 41
41 return XCreatePixmap(_ecore_x_disp, win, w, h, dep); 42 pm = XCreatePixmap(_ecore_x_disp, win, w, h, dep);
43 if (_ecore_xlib_sync) ecore_x_sync();
44 return pm;
42} 45}
43 46
44/** 47/**
@@ -56,6 +59,7 @@ ecore_x_pixmap_free(Ecore_X_Pixmap pmap)
56 LOGFN(__FILE__, __LINE__, __FUNCTION__); 59 LOGFN(__FILE__, __LINE__, __FUNCTION__);
57 if (!pmap) return; 60 if (!pmap) return;
58 XFreePixmap(_ecore_x_disp, pmap); 61 XFreePixmap(_ecore_x_disp, pmap);
62 if (_ecore_xlib_sync) ecore_x_sync();
59} 63}
60 64
61/** 65/**
@@ -85,6 +89,7 @@ ecore_x_pixmap_paste(Ecore_X_Pixmap pmap,
85{ 89{
86 LOGFN(__FILE__, __LINE__, __FUNCTION__); 90 LOGFN(__FILE__, __LINE__, __FUNCTION__);
87 XCopyArea(_ecore_x_disp, pmap, dest, gc, sx, sy, w, h, dx, dy); 91 XCopyArea(_ecore_x_disp, pmap, dest, gc, sx, sy, w, h, dx, dy);
92 if (_ecore_xlib_sync) ecore_x_sync();
88} 93}
89 94
90/** 95/**
@@ -104,8 +109,9 @@ ecore_x_pixmap_geometry_get(Ecore_X_Pixmap pmap,
104 int *h) 109 int *h)
105{ 110{
106 LOGFN(__FILE__, __LINE__, __FUNCTION__); 111 LOGFN(__FILE__, __LINE__, __FUNCTION__);
107 if (pmap) 112 if (!pmap) return;
108 ecore_x_drawable_geometry_get(pmap, x, y, w, h); 113 ecore_x_drawable_geometry_get(pmap, x, y, w, h);
114 if (_ecore_xlib_sync) ecore_x_sync();
109} 115}
110 116
111/** 117/**
@@ -117,7 +123,10 @@ ecore_x_pixmap_geometry_get(Ecore_X_Pixmap pmap,
117EAPI int 123EAPI int
118ecore_x_pixmap_depth_get(Ecore_X_Pixmap pmap) 124ecore_x_pixmap_depth_get(Ecore_X_Pixmap pmap)
119{ 125{
126 int ret;
120 LOGFN(__FILE__, __LINE__, __FUNCTION__); 127 LOGFN(__FILE__, __LINE__, __FUNCTION__);
121 return ecore_x_drawable_depth_get(pmap); 128 ret = ecore_x_drawable_depth_get(pmap);
129 if (_ecore_xlib_sync) ecore_x_sync();
130 return ret;
122} 131}
123 132
diff --git a/src/lib/ecore_x/xlib/ecore_x_private.h b/src/lib/ecore_x/xlib/ecore_x_private.h
index f962ffb..63a8fbb 100644
--- a/src/lib/ecore_x/xlib/ecore_x_private.h
+++ b/src/lib/ecore_x/xlib/ecore_x_private.h
@@ -67,6 +67,7 @@
67#include "Ecore_Input.h" 67#include "Ecore_Input.h"
68 68
69extern int _ecore_xlib_log_dom; 69extern int _ecore_xlib_log_dom;
70extern Eina_Bool _ecore_xlib_sync;
70#ifdef ECORE_XLIB_DEFAULT_LOG_COLOR 71#ifdef ECORE_XLIB_DEFAULT_LOG_COLOR
71# undef ECORE_XLIB_DEFAULT_LOG_COLOR 72# undef ECORE_XLIB_DEFAULT_LOG_COLOR
72#endif /* ifdef ECORE_XLIB_DEFAULT_LOG_COLOR */ 73#endif /* ifdef ECORE_XLIB_DEFAULT_LOG_COLOR */
@@ -367,7 +368,7 @@ Ecore_Event_Mouse_Button *_ecore_mouse_button(int event,
367void _ecore_x_modifiers_get(void); 368void _ecore_x_modifiers_get(void);
368KeySym _ecore_x_XKeycodeToKeysym(Display *display, KeyCode keycode, int index); 369KeySym _ecore_x_XKeycodeToKeysym(Display *display, KeyCode keycode, int index);
369 370
370//#define LOGFNS 1 371#define LOGFNS 0
371 372
372#ifdef LOGFNS 373#ifdef LOGFNS
373#include <stdio.h> 374#include <stdio.h>
diff --git a/src/lib/ecore_x/xlib/ecore_x_region.c b/src/lib/ecore_x/xlib/ecore_x_region.c
index 81d7eea..01f1fa7 100644
--- a/src/lib/ecore_x/xlib/ecore_x_region.c
+++ b/src/lib/ecore_x/xlib/ecore_x_region.c
@@ -48,8 +48,11 @@ EAPI Eina_Bool
48ecore_x_xregion_set(Ecore_X_XRegion *region, 48ecore_x_xregion_set(Ecore_X_XRegion *region,
49 Ecore_X_GC gc) 49 Ecore_X_GC gc)
50{ 50{
51 Eina_Bool ret;
51 LOGFN(__FILE__, __LINE__, __FUNCTION__); 52 LOGFN(__FILE__, __LINE__, __FUNCTION__);
52 return XSetRegion(_ecore_x_disp, gc, (Region)region) ? EINA_TRUE : EINA_FALSE; 53 ret = !!XSetRegion(_ecore_x_disp, gc, (Region)region);
54 if (_ecore_xlib_sync) ecore_x_sync();
55 return ret;
53} 56}
54 57
55EAPI void 58EAPI void
diff --git a/src/lib/ecore_x/xlib/ecore_x_selection.c b/src/lib/ecore_x/xlib/ecore_x_selection.c
index 8e2efa4..e11cf90 100644
--- a/src/lib/ecore_x/xlib/ecore_x_selection.c
+++ b/src/lib/ecore_x/xlib/ecore_x_selection.c
@@ -400,6 +400,7 @@ ecore_x_selection_xdnd_request(Ecore_X_Window w,
400 XConvertSelection(_ecore_x_disp, ECORE_X_ATOM_SELECTION_XDND, atom, 400 XConvertSelection(_ecore_x_disp, ECORE_X_ATOM_SELECTION_XDND, atom,
401 ECORE_X_ATOM_SELECTION_PROP_XDND, w, 401 ECORE_X_ATOM_SELECTION_PROP_XDND, w,
402 _target->time); 402 _target->time);
403 if (_ecore_xlib_sync) ecore_x_sync();
403} 404}
404 405
405EAPI void 406EAPI void
diff --git a/src/lib/ecore_x/xlib/ecore_x_window.c b/src/lib/ecore_x/xlib/ecore_x_window.c
index fbea732..860e2bf 100644
--- a/src/lib/ecore_x/xlib/ecore_x_window.c
+++ b/src/lib/ecore_x/xlib/ecore_x_window.c
@@ -83,7 +83,7 @@ ecore_x_window_new(Ecore_X_Window parent,
83 CWBitGravity | 83 CWBitGravity |
84 CWWinGravity, 84 CWWinGravity,
85 &attr); 85 &attr);
86 86 if (_ecore_xlib_sync) ecore_x_sync();
87 if (parent == DefaultRootWindow(_ecore_x_disp)) 87 if (parent == DefaultRootWindow(_ecore_x_disp))
88 ecore_x_window_defaults_set(win); 88 ecore_x_window_defaults_set(win);
89 89
@@ -152,6 +152,7 @@ ecore_x_window_override_new(Ecore_X_Window parent,
152 CWBitGravity | 152 CWBitGravity |
153 CWWinGravity, 153 CWWinGravity,
154 &attr); 154 &attr);
155 if (_ecore_xlib_sync) ecore_x_sync();
155 return win; 156 return win;
156} 157}
157 158
@@ -204,7 +205,7 @@ ecore_x_window_input_new(Ecore_X_Window parent,
204 CWDontPropagate | 205 CWDontPropagate |
205 CWEventMask, 206 CWEventMask,
206 &attr); 207 &attr);
207 208 if (_ecore_xlib_sync) ecore_x_sync();
208 if (parent == DefaultRootWindow(_ecore_x_disp)) 209 if (parent == DefaultRootWindow(_ecore_x_disp))
209 { 210 {
210 } 211 }
@@ -253,8 +254,9 @@ ecore_x_window_defaults_set(Ecore_X_Window win)
253 { 254 {
254 XSetWMClientMachine(_ecore_x_disp, win, &xprop); 255 XSetWMClientMachine(_ecore_x_disp, win, &xprop);
255 XFree(xprop.value); 256 XFree(xprop.value);
257 if (_ecore_xlib_sync) ecore_x_sync();
256 } 258 }
257 259 if (_ecore_xlib_sync) ecore_x_sync();
258 /* 260 /*
259 * Set _NET_WM_PID 261 * Set _NET_WM_PID
260 */ 262 */
@@ -294,6 +296,7 @@ ecore_x_window_configure(Ecore_X_Window win,
294 xwc.stack_mode = stack_mode; 296 xwc.stack_mode = stack_mode;
295 297
296 XConfigureWindow(_ecore_x_disp, win, mask, &xwc); 298 XConfigureWindow(_ecore_x_disp, win, mask, &xwc);
299 if (_ecore_xlib_sync) ecore_x_sync();
297} 300}
298 301
299/** 302/**
@@ -315,8 +318,9 @@ ecore_x_window_free(Ecore_X_Window win)
315 * a smart idea. 318 * a smart idea.
316 */ 319 */
317 LOGFN(__FILE__, __LINE__, __FUNCTION__); 320 LOGFN(__FILE__, __LINE__, __FUNCTION__);
318 if (win) 321 if (!win) return;
319 XDestroyWindow(_ecore_x_disp, win); 322 XDestroyWindow(_ecore_x_disp, win);
323 if (_ecore_xlib_sync) ecore_x_sync();
320} 324}
321 325
322/** 326/**
@@ -418,6 +422,7 @@ ecore_x_window_delete_request_send(Ecore_X_Window win)
418 xev.xclient.data.l[1] = CurrentTime; 422 xev.xclient.data.l[1] = CurrentTime;
419 423
420 XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev); 424 XSendEvent(_ecore_x_disp, win, False, NoEventMask, &xev);
425 if (_ecore_xlib_sync) ecore_x_sync();
421} 426}
422 427
423/** 428/**
@@ -440,6 +445,7 @@ ecore_x_window_show(Ecore_X_Window win)
440{ 445{
441 LOGFN(__FILE__, __LINE__, __FUNCTION__); 446 LOGFN(__FILE__, __LINE__, __FUNCTION__);
442 XMapWindow(_ecore_x_disp, win); 447 XMapWindow(_ecore_x_disp, win);
448 if (_ecore_xlib_sync) ecore_x_sync();
443} 449}
444 450
445/** 451/**
@@ -484,6 +490,7 @@ ecore_x_window_hide(Ecore_X_Window win)
484 xev.xunmap.from_configure = False; 490 xev.xunmap.from_configure = False;
485 XSendEvent(_ecore_x_disp, xev.xunmap.event, False, 491 XSendEvent(_ecore_x_disp, xev.xunmap.event, False,
486 SubstructureRedirectMask | SubstructureNotifyMask, &xev); 492 SubstructureRedirectMask | SubstructureNotifyMask, &xev);
493 if (_ecore_xlib_sync) ecore_x_sync();
487} 494}
488 495
489/** 496/**
@@ -511,6 +518,7 @@ ecore_x_window_move(Ecore_X_Window win,
511{ 518{
512 LOGFN(__FILE__, __LINE__, __FUNCTION__); 519 LOGFN(__FILE__, __LINE__, __FUNCTION__);
513 XMoveWindow(_ecore_x_disp, win, x, y); 520 XMoveWindow(_ecore_x_disp, win, x, y);
521 if (_ecore_xlib_sync) ecore_x_sync();
514} 522}
515 523
516/** 524/**
@@ -533,6 +541,7 @@ ecore_x_window_resize(Ecore_X_Window win,
533 h = 1; 541 h = 1;
534 542
535 XResizeWindow(_ecore_x_disp, win, w, h); 543 XResizeWindow(_ecore_x_disp, win, w, h);
544 if (_ecore_xlib_sync) ecore_x_sync();
536} 545}
537 546
538/** 547/**
@@ -559,6 +568,7 @@ ecore_x_window_move_resize(Ecore_X_Window win,
559 h = 1; 568 h = 1;
560 569
561 XMoveResizeWindow(_ecore_x_disp, win, x, y, w, h); 570 XMoveResizeWindow(_ecore_x_disp, win, x, y, w, h);
571 if (_ecore_xlib_sync) ecore_x_sync();
562} 572}
563 573
564/** 574/**
@@ -582,6 +592,7 @@ ecore_x_window_focus(Ecore_X_Window win)
582 592
583// XSetInputFocus(_ecore_x_disp, win, RevertToPointerRoot, CurrentTime); 593// XSetInputFocus(_ecore_x_disp, win, RevertToPointerRoot, CurrentTime);
584 XSetInputFocus(_ecore_x_disp, win, RevertToParent, CurrentTime); 594 XSetInputFocus(_ecore_x_disp, win, RevertToParent, CurrentTime);
595 if (_ecore_xlib_sync) ecore_x_sync();
585} 596}
586 597
587/** 598/**
@@ -600,6 +611,7 @@ ecore_x_window_focus_at_time(Ecore_X_Window win,
600 611
601// XSetInputFocus(_ecore_x_disp, win, PointerRoot, t); 612// XSetInputFocus(_ecore_x_disp, win, PointerRoot, t);
602 XSetInputFocus(_ecore_x_disp, win, RevertToParent, t); 613 XSetInputFocus(_ecore_x_disp, win, RevertToParent, t);
614 if (_ecore_xlib_sync) ecore_x_sync();
603} 615}
604 616
605/** 617/**
@@ -636,6 +648,7 @@ ecore_x_window_raise(Ecore_X_Window win)
636{ 648{
637 LOGFN(__FILE__, __LINE__, __FUNCTION__); 649 LOGFN(__FILE__, __LINE__, __FUNCTION__);
638 XRaiseWindow(_ecore_x_disp, win); 650 XRaiseWindow(_ecore_x_disp, win);
651 if (_ecore_xlib_sync) ecore_x_sync();
639} 652}
640 653
641/** 654/**
@@ -648,6 +661,7 @@ ecore_x_window_lower(Ecore_X_Window win)
648{ 661{
649 LOGFN(__FILE__, __LINE__, __FUNCTION__); 662 LOGFN(__FILE__, __LINE__, __FUNCTION__);
650 XLowerWindow(_ecore_x_disp, win); 663 XLowerWindow(_ecore_x_disp, win);
664 if (_ecore_xlib_sync) ecore_x_sync();
651} 665}
652 666
653/** 667/**
@@ -676,6 +690,7 @@ ecore_x_window_reparent(Ecore_X_Window win,
676 new_parent = DefaultRootWindow(_ecore_x_disp); 690 new_parent = DefaultRootWindow(_ecore_x_disp);
677 691
678 XReparentWindow(_ecore_x_disp, win, new_parent, x, y); 692 XReparentWindow(_ecore_x_disp, win, new_parent, x, y);
693 if (_ecore_xlib_sync) ecore_x_sync();
679} 694}
680 695
681/** 696/**
@@ -697,6 +712,7 @@ ecore_x_window_size_get(Ecore_X_Window win,
697 win = DefaultRootWindow(_ecore_x_disp); 712 win = DefaultRootWindow(_ecore_x_disp);
698 713
699 ecore_x_drawable_geometry_get(win, &dummy_x, &dummy_y, w, h); 714 ecore_x_drawable_geometry_get(win, &dummy_x, &dummy_y, w, h);
715 if (_ecore_xlib_sync) ecore_x_sync();
700} 716}
701 717
702/** 718/**
@@ -727,6 +743,7 @@ ecore_x_window_geometry_get(Ecore_X_Window win,
727 win = DefaultRootWindow(_ecore_x_disp); 743 win = DefaultRootWindow(_ecore_x_disp);
728 744
729 ecore_x_drawable_geometry_get(win, x, y, w, h); 745 ecore_x_drawable_geometry_get(win, x, y, w, h);
746 if (_ecore_xlib_sync) ecore_x_sync();
730} 747}
731 748
732/** 749/**
@@ -738,12 +755,15 @@ ecore_x_window_geometry_get(Ecore_X_Window win,
738EAPI int 755EAPI int
739ecore_x_window_border_width_get(Ecore_X_Window win) 756ecore_x_window_border_width_get(Ecore_X_Window win)
740{ 757{
758 int w;
741 LOGFN(__FILE__, __LINE__, __FUNCTION__); 759 LOGFN(__FILE__, __LINE__, __FUNCTION__);
742 /* doesn't make sense to call this on a root window */ 760 /* doesn't make sense to call this on a root window */
743 if (!win) 761 if (!win)
744 return 0; 762 return 0;
745 763
746 return ecore_x_drawable_border_width_get(win); 764 w = ecore_x_drawable_border_width_get(win);
765 if (_ecore_xlib_sync) ecore_x_sync();
766 return w;
747} 767}
748 768
749/** 769/**
@@ -762,6 +782,7 @@ ecore_x_window_border_width_set(Ecore_X_Window win,
762 return; 782 return;
763 783
764 XSetWindowBorderWidth (_ecore_x_disp, win, width); 784 XSetWindowBorderWidth (_ecore_x_disp, win, width);
785 if (_ecore_xlib_sync) ecore_x_sync();
765} 786}
766 787
767/** 788/**
@@ -772,8 +793,11 @@ ecore_x_window_border_width_set(Ecore_X_Window win,
772EAPI int 793EAPI int
773ecore_x_window_depth_get(Ecore_X_Window win) 794ecore_x_window_depth_get(Ecore_X_Window win)
774{ 795{
796 int d;
775 LOGFN(__FILE__, __LINE__, __FUNCTION__); 797 LOGFN(__FILE__, __LINE__, __FUNCTION__);
776 return ecore_x_drawable_depth_get(win); 798 d = ecore_x_drawable_depth_get(win);
799 if (_ecore_xlib_sync) ecore_x_sync();
800 return d;
777} 801}
778 802
779/** 803/**
@@ -798,19 +822,26 @@ ecore_x_window_cursor_show(Ecore_X_Window win,
798 XGCValues gcv; 822 XGCValues gcv;
799 823
800 p = XCreatePixmap(_ecore_x_disp, win, 1, 1, 1); 824 p = XCreatePixmap(_ecore_x_disp, win, 1, 1, 1);
825 if (_ecore_xlib_sync) ecore_x_sync();
801 m = XCreatePixmap(_ecore_x_disp, win, 1, 1, 1); 826 m = XCreatePixmap(_ecore_x_disp, win, 1, 1, 1);
827 if (_ecore_xlib_sync) ecore_x_sync();
802 gc = XCreateGC(_ecore_x_disp, m, 0, &gcv); 828 gc = XCreateGC(_ecore_x_disp, m, 0, &gcv);
829 if (_ecore_xlib_sync) ecore_x_sync();
803 XSetForeground(_ecore_x_disp, gc, 0); 830 XSetForeground(_ecore_x_disp, gc, 0);
831 if (_ecore_xlib_sync) ecore_x_sync();
804 XDrawPoint(_ecore_x_disp, m, gc, 0, 0); 832 XDrawPoint(_ecore_x_disp, m, gc, 0, 0);
833 if (_ecore_xlib_sync) ecore_x_sync();
805 XFreeGC(_ecore_x_disp, gc); 834 XFreeGC(_ecore_x_disp, gc);
806 c = XCreatePixmapCursor(_ecore_x_disp, p, m, &cl, &cl, 0, 0); 835 c = XCreatePixmapCursor(_ecore_x_disp, p, m, &cl, &cl, 0, 0);
836 if (_ecore_xlib_sync) ecore_x_sync();
807 XDefineCursor(_ecore_x_disp, win, c); 837 XDefineCursor(_ecore_x_disp, win, c);
808 XFreeCursor(_ecore_x_disp, c); 838 XFreeCursor(_ecore_x_disp, c);
809 XFreePixmap(_ecore_x_disp, p); 839 XFreePixmap(_ecore_x_disp, p);
810 XFreePixmap(_ecore_x_disp, m); 840 XFreePixmap(_ecore_x_disp, m);
811 } 841}
812 else 842 else
813 XDefineCursor(_ecore_x_disp, win, 0); 843 XDefineCursor(_ecore_x_disp, win, 0);
844 if (_ecore_xlib_sync) ecore_x_sync();
814} 845}
815 846
816EAPI void 847EAPI void
@@ -822,6 +853,7 @@ ecore_x_window_cursor_set(Ecore_X_Window win,
822 XUndefineCursor(_ecore_x_disp, win); 853 XUndefineCursor(_ecore_x_disp, win);
823 else 854 else
824 XDefineCursor(_ecore_x_disp, win, c); 855 XDefineCursor(_ecore_x_disp, win, c);
856 if (_ecore_xlib_sync) ecore_x_sync();
825} 857}
826 858
827/** 859/**
@@ -833,11 +865,14 @@ ecore_x_window_cursor_set(Ecore_X_Window win,
833EAPI int 865EAPI int
834ecore_x_window_visible_get(Ecore_X_Window win) 866ecore_x_window_visible_get(Ecore_X_Window win)
835{ 867{
868 Eina_Bool ret;
836 XWindowAttributes attr; 869 XWindowAttributes attr;
837 870
838 LOGFN(__FILE__, __LINE__, __FUNCTION__); 871 LOGFN(__FILE__, __LINE__, __FUNCTION__);
839 return XGetWindowAttributes(_ecore_x_disp, win, &attr) && 872 ret = (XGetWindowAttributes(_ecore_x_disp, win, &attr) &&
840 (attr.map_state == IsViewable); 873 (attr.map_state == IsViewable));
874 if (_ecore_xlib_sync) ecore_x_sync();
875 return ret;
841} 876}
842 877
843typedef struct _Shadow Shadow; 878typedef struct _Shadow Shadow;
@@ -862,12 +897,11 @@ _ecore_x_window_tree_walk(Window win)
862 unsigned int num; 897 unsigned int num;
863 Shadow *s, **sl; 898 Shadow *s, **sl;
864 XWindowAttributes att; 899 XWindowAttributes att;
900 Eina_Bool ret;
865 901
866 if (!XGetWindowAttributes(_ecore_x_disp, win, &att)) 902 ret = (XGetWindowAttributes(_ecore_x_disp, win, &att) && (att.map_state == IsViewable));
867 return NULL; // if (att.class == InputOnly) return NULL; 903 if (_ecore_xlib_sync) ecore_x_sync();
868 904 if (!ret) return NULL; // if (att.class == InputOnly) return NULL;
869 if (att.map_state != IsViewable)
870 return NULL;
871 905
872 s = calloc(1, sizeof(Shadow)); 906 s = calloc(1, sizeof(Shadow));
873 if (!s) 907 if (!s)
@@ -881,6 +915,7 @@ _ecore_x_window_tree_walk(Window win)
881 if (XQueryTree(_ecore_x_disp, s->win, &root_win, &parent_win, 915 if (XQueryTree(_ecore_x_disp, s->win, &root_win, &parent_win,
882 &list, &num)) 916 &list, &num))
883 { 917 {
918 if (_ecore_xlib_sync) ecore_x_sync();
884 s->children = calloc(1, sizeof(Shadow *) * num); 919 s->children = calloc(1, sizeof(Shadow *) * num);
885 if (s->children) 920 if (s->children)
886 { 921 {
@@ -1417,10 +1452,12 @@ ecore_x_window_parent_get(Ecore_X_Window win)
1417{ 1452{
1418 Window root, parent, *children = NULL; 1453 Window root, parent, *children = NULL;
1419 unsigned int num; 1454 unsigned int num;
1455 Eina_Bool success;
1420 1456
1421 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1457 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1422 if (!XQueryTree(_ecore_x_disp, win, &root, &parent, &children, &num)) 1458 success = XQueryTree(_ecore_x_disp, win, &root, &parent, &children, &num);
1423 return 0; 1459 if (_ecore_xlib_sync) ecore_x_sync();
1460 if (!success) return 0;
1424 1461
1425 if (children) 1462 if (children)
1426 XFree(children); 1463 XFree(children);
@@ -1455,6 +1492,7 @@ ecore_x_window_background_color_set(Ecore_X_Window win,
1455 1492
1456 attr.background_pixel = col.pixel; 1493 attr.background_pixel = col.pixel;
1457 XChangeWindowAttributes(_ecore_x_disp, win, CWBackPixel, &attr); 1494 XChangeWindowAttributes(_ecore_x_disp, win, CWBackPixel, &attr);
1495 if (_ecore_xlib_sync) ecore_x_sync();
1458} 1496}
1459 1497
1460EAPI void 1498EAPI void
@@ -1466,6 +1504,7 @@ ecore_x_window_gravity_set(Ecore_X_Window win,
1466 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1504 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1467 att.win_gravity = grav; 1505 att.win_gravity = grav;
1468 XChangeWindowAttributes(_ecore_x_disp, win, CWWinGravity, &att); 1506 XChangeWindowAttributes(_ecore_x_disp, win, CWWinGravity, &att);
1507 if (_ecore_xlib_sync) ecore_x_sync();
1469} 1508}
1470 1509
1471EAPI void 1510EAPI void
@@ -1477,6 +1516,7 @@ ecore_x_window_pixel_gravity_set(Ecore_X_Window win,
1477 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1516 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1478 att.bit_gravity = grav; 1517 att.bit_gravity = grav;
1479 XChangeWindowAttributes(_ecore_x_disp, win, CWBitGravity, &att); 1518 XChangeWindowAttributes(_ecore_x_disp, win, CWBitGravity, &att);
1519 if (_ecore_xlib_sync) ecore_x_sync();
1480} 1520}
1481 1521
1482EAPI void 1522EAPI void
@@ -1485,6 +1525,7 @@ ecore_x_window_pixmap_set(Ecore_X_Window win,
1485{ 1525{
1486 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1526 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1487 XSetWindowBackgroundPixmap(_ecore_x_disp, win, pmap); 1527 XSetWindowBackgroundPixmap(_ecore_x_disp, win, pmap);
1528 if (_ecore_xlib_sync) ecore_x_sync();
1488} 1529}
1489 1530
1490EAPI void 1531EAPI void
@@ -1496,6 +1537,7 @@ ecore_x_window_area_clear(Ecore_X_Window win,
1496{ 1537{
1497 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1538 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1498 XClearArea(_ecore_x_disp, win, x, y, w, h, False); 1539 XClearArea(_ecore_x_disp, win, x, y, w, h, False);
1540 if (_ecore_xlib_sync) ecore_x_sync();
1499} 1541}
1500 1542
1501EAPI void 1543EAPI void
@@ -1507,6 +1549,7 @@ ecore_x_window_area_expose(Ecore_X_Window win,
1507{ 1549{
1508 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1550 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1509 XClearArea(_ecore_x_disp, win, x, y, w, h, True); 1551 XClearArea(_ecore_x_disp, win, x, y, w, h, True);
1552 if (_ecore_xlib_sync) ecore_x_sync();
1510} 1553}
1511 1554
1512EAPI void 1555EAPI void
@@ -1518,6 +1561,7 @@ ecore_x_window_override_set(Ecore_X_Window win,
1518 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1561 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1519 att.override_redirect = override; 1562 att.override_redirect = override;
1520 XChangeWindowAttributes(_ecore_x_disp, win, CWOverrideRedirect, &att); 1563 XChangeWindowAttributes(_ecore_x_disp, win, CWOverrideRedirect, &att);
1564 if (_ecore_xlib_sync) ecore_x_sync();
1521} 1565}
1522 1566
1523#ifdef ECORE_XRENDER 1567#ifdef ECORE_XRENDER
@@ -1548,6 +1592,7 @@ _ecore_x_window_argb_internal_new(Ecore_X_Window parent,
1548 { 1592 {
1549 /* ewww - round trip */ 1593 /* ewww - round trip */
1550 XGetWindowAttributes(_ecore_x_disp, parent, &att); 1594 XGetWindowAttributes(_ecore_x_disp, parent, &att);
1595 if (_ecore_xlib_sync) ecore_x_sync();
1551 for (i = 0; i < ScreenCount(_ecore_x_disp); i++) 1596 for (i = 0; i < ScreenCount(_ecore_x_disp); i++)
1552 { 1597 {
1553 if (att.screen == ScreenOfDisplay(_ecore_x_disp, i)) 1598 if (att.screen == ScreenOfDisplay(_ecore_x_disp, i))
@@ -1567,6 +1612,7 @@ _ecore_x_window_argb_internal_new(Ecore_X_Window parent,
1567 VisualClassMask, 1612 VisualClassMask,
1568 &vi_in, 1613 &vi_in,
1569 &nvi); 1614 &nvi);
1615 if (_ecore_xlib_sync) ecore_x_sync();
1570 if (!xvi) 1616 if (!xvi)
1571 return 0; 1617 return 0;
1572 1618
@@ -1574,6 +1620,7 @@ _ecore_x_window_argb_internal_new(Ecore_X_Window parent,
1574 for (i = 0; i < nvi; i++) 1620 for (i = 0; i < nvi; i++)
1575 { 1621 {
1576 fmt = XRenderFindVisualFormat(_ecore_x_disp, xvi[i].visual); 1622 fmt = XRenderFindVisualFormat(_ecore_x_disp, xvi[i].visual);
1623 if (_ecore_xlib_sync) ecore_x_sync();
1577 if ((fmt->type == PictTypeDirect) && (fmt->direct.alphaMask)) 1624 if ((fmt->type == PictTypeDirect) && (fmt->direct.alphaMask))
1578 { 1625 {
1579 vis = xvi[i].visual; 1626 vis = xvi[i].visual;
@@ -1621,6 +1668,7 @@ _ecore_x_window_argb_internal_new(Ecore_X_Window parent,
1621 CWBitGravity | 1668 CWBitGravity |
1622 CWWinGravity, 1669 CWWinGravity,
1623 &attr); 1670 &attr);
1671 if (_ecore_xlib_sync) ecore_x_sync();
1624 XFreeColormap(_ecore_x_disp, attr.colormap); 1672 XFreeColormap(_ecore_x_disp, attr.colormap);
1625 1673
1626 if (parent == DefaultRootWindow(_ecore_x_disp)) 1674 if (parent == DefaultRootWindow(_ecore_x_disp))
@@ -1637,12 +1685,15 @@ ecore_x_window_argb_get(Ecore_X_Window win)
1637#ifdef ECORE_XRENDER 1685#ifdef ECORE_XRENDER
1638 XWindowAttributes att; 1686 XWindowAttributes att;
1639 XRenderPictFormat *fmt; 1687 XRenderPictFormat *fmt;
1688 Eina_Bool ret;
1640 1689
1641 att.visual = 0; 1690 att.visual = 0;
1642 if (!XGetWindowAttributes(_ecore_x_disp, win, &att)) 1691 ret = XGetWindowAttributes(_ecore_x_disp, win, &att);
1643 return 0; 1692 if (_ecore_xlib_sync) ecore_x_sync();
1693 if (!ret) return 0;
1644 1694
1645 fmt = XRenderFindVisualFormat(_ecore_x_disp, att.visual); 1695 fmt = XRenderFindVisualFormat(_ecore_x_disp, att.visual);
1696 if (_ecore_xlib_sync) ecore_x_sync();
1646 if (!fmt) 1697 if (!fmt)
1647 return 0; 1698 return 0;
1648 1699
diff --git a/src/lib/ecore_x/xlib/ecore_x_window_prop.c b/src/lib/ecore_x/xlib/ecore_x_window_prop.c
index 286cdfc..465a48c 100644
--- a/src/lib/ecore_x/xlib/ecore_x_window_prop.c
+++ b/src/lib/ecore_x/xlib/ecore_x_window_prop.c
@@ -41,6 +41,7 @@ ecore_x_window_prop_card32_set(Ecore_X_Window win,
41 _ATOM_SET_CARD32(win, atom, v2, num); 41 _ATOM_SET_CARD32(win, atom, v2, num);
42 free(v2); 42 free(v2);
43#endif /* if SIZEOF_INT == SIZEOF_LONG */ 43#endif /* if SIZEOF_INT == SIZEOF_LONG */
44 if (_ecore_xlib_sync) ecore_x_sync();
44} 45}
45 46
46/* 47/*
@@ -85,9 +86,9 @@ ecore_x_window_prop_card32_get(Ecore_X_Window win,
85 num = len; 86 num = len;
86 } 87 }
87 88
89 if (_ecore_xlib_sync) ecore_x_sync();
88 if (prop_ret) 90 if (prop_ret)
89 XFree(prop_ret); 91 XFree(prop_ret);
90
91 return num; 92 return num;
92} 93}
93 94
@@ -136,9 +137,9 @@ ecore_x_window_prop_card32_list_get(Ecore_X_Window win,
136 *plst = val; 137 *plst = val;
137 } 138 }
138 139
140 if (_ecore_xlib_sync) ecore_x_sync();
139 if (prop_ret) 141 if (prop_ret)
140 XFree(prop_ret); 142 XFree(prop_ret);
141
142 return num; 143 return num;
143} 144}
144 145
@@ -170,6 +171,7 @@ ecore_x_window_prop_xid_set(Ecore_X_Window win,
170 (unsigned char *)pl, num); 171 (unsigned char *)pl, num);
171 free(pl); 172 free(pl);
172#endif /* if SIZEOF_INT == SIZEOF_LONG */ 173#endif /* if SIZEOF_INT == SIZEOF_LONG */
174 if (_ecore_xlib_sync) ecore_x_sync();
173} 175}
174 176
175/* 177/*
@@ -193,13 +195,15 @@ ecore_x_window_prop_xid_get(Ecore_X_Window win,
193 int format_ret; 195 int format_ret;
194 int num; 196 int num;
195 unsigned i; 197 unsigned i;
198 Eina_Bool success;
196 199
197 LOGFN(__FILE__, __LINE__, __FUNCTION__); 200 LOGFN(__FILE__, __LINE__, __FUNCTION__);
198 prop_ret = NULL; 201 prop_ret = NULL;
199 if (XGetWindowProperty(_ecore_x_disp, win, atom, 0, 0x7fffffff, False, 202 success = (XGetWindowProperty(_ecore_x_disp, win, atom, 0, 0x7fffffff, False,
200 type, &type_ret, &format_ret, &num_ret, 203 type, &type_ret, &format_ret, &num_ret,
201 &bytes_after, &prop_ret) != Success) 204 &bytes_after, &prop_ret) == Success);
202 return -1; 205 if (_ecore_xlib_sync) ecore_x_sync();
206 if (!success) return -1;
203 207
204 if (type_ret != type || format_ret != 32) 208 if (type_ret != type || format_ret != 32)
205 num = -1; 209 num = -1;
@@ -242,14 +246,16 @@ ecore_x_window_prop_xid_list_get(Ecore_X_Window win,
242 Ecore_X_Atom *alst; 246 Ecore_X_Atom *alst;
243 int num; 247 int num;
244 unsigned i; 248 unsigned i;
249 Eina_Bool success;
245 250
246 LOGFN(__FILE__, __LINE__, __FUNCTION__); 251 LOGFN(__FILE__, __LINE__, __FUNCTION__);
247 *val = NULL; 252 *val = NULL;
248 prop_ret = NULL; 253 prop_ret = NULL;
249 if (XGetWindowProperty(_ecore_x_disp, win, atom, 0, 0x7fffffff, False, 254 success = (XGetWindowProperty(_ecore_x_disp, win, atom, 0, 0x7fffffff, False,
250 type, &type_ret, &format_ret, &num_ret, 255 type, &type_ret, &format_ret, &num_ret,
251 &bytes_after, &prop_ret) != Success) 256 &bytes_after, &prop_ret) == Success);
252 return -1; 257 if (_ecore_xlib_sync) ecore_x_sync();
258 if (!success) return -1;
253 259
254 if (type_ret != type || format_ret != 32) 260 if (type_ret != type || format_ret != 32)
255 num = -1; 261 num = -1;
@@ -266,7 +272,6 @@ ecore_x_window_prop_xid_list_get(Ecore_X_Window win,
266 272
267 if (prop_ret) 273 if (prop_ret)
268 XFree(prop_ret); 274 XFree(prop_ret);
269
270 return num; 275 return num;
271} 276}
272 277
@@ -352,8 +357,10 @@ ecore_x_window_prop_atom_get(Ecore_X_Window win,
352 Ecore_X_Atom *lst, 357 Ecore_X_Atom *lst,
353 unsigned int len) 358 unsigned int len)
354{ 359{
360 int ret;
355 LOGFN(__FILE__, __LINE__, __FUNCTION__); 361 LOGFN(__FILE__, __LINE__, __FUNCTION__);
356 return ecore_x_window_prop_xid_get(win, atom, XA_ATOM, lst, len); 362 ret = ecore_x_window_prop_xid_get(win, atom, XA_ATOM, lst, len);
363 return ret;
357} 364}
358 365
359/* 366/*
@@ -369,8 +376,10 @@ ecore_x_window_prop_atom_list_get(Ecore_X_Window win,
369 Ecore_X_Atom atom, 376 Ecore_X_Atom atom,
370 Ecore_X_Atom **plst) 377 Ecore_X_Atom **plst)
371{ 378{
379 int ret;
372 LOGFN(__FILE__, __LINE__, __FUNCTION__); 380 LOGFN(__FILE__, __LINE__, __FUNCTION__);
373 return ecore_x_window_prop_xid_list_get(win, atom, XA_ATOM, plst); 381 ret = ecore_x_window_prop_xid_list_get(win, atom, XA_ATOM, plst);
382 return ret;
374} 383}
375 384
376/* 385/*
@@ -413,8 +422,10 @@ ecore_x_window_prop_window_get(Ecore_X_Window win,
413 Ecore_X_Window *lst, 422 Ecore_X_Window *lst,
414 unsigned int len) 423 unsigned int len)
415{ 424{
425 int ret;
416 LOGFN(__FILE__, __LINE__, __FUNCTION__); 426 LOGFN(__FILE__, __LINE__, __FUNCTION__);
417 return ecore_x_window_prop_xid_get(win, atom, XA_WINDOW, lst, len); 427 ret = ecore_x_window_prop_xid_get(win, atom, XA_WINDOW, lst, len);
428 return ret;
418} 429}
419 430
420/* 431/*
@@ -430,8 +441,10 @@ ecore_x_window_prop_window_list_get(Ecore_X_Window win,
430 Ecore_X_Atom atom, 441 Ecore_X_Atom atom,
431 Ecore_X_Window **plst) 442 Ecore_X_Window **plst)
432{ 443{
444 int ret;
433 LOGFN(__FILE__, __LINE__, __FUNCTION__); 445 LOGFN(__FILE__, __LINE__, __FUNCTION__);
434 return ecore_x_window_prop_xid_list_get(win, atom, XA_WINDOW, plst); 446 ret = ecore_x_window_prop_xid_list_get(win, atom, XA_WINDOW, plst);
447 return ret;
435} 448}
436 449
437EAPI Ecore_X_Atom 450EAPI Ecore_X_Atom
@@ -485,6 +498,7 @@ ecore_x_window_prop_property_set(Ecore_X_Window win,
485 free(dat); 498 free(dat);
486 } 499 }
487 } 500 }
501 if (_ecore_xlib_sync) ecore_x_sync();
488} 502}
489 503
490/** 504/**
@@ -528,10 +542,9 @@ ecore_x_window_prop_property_get(Ecore_X_Window win,
528 ret = XGetWindowProperty(_ecore_x_disp, win, property, 0, LONG_MAX, 542 ret = XGetWindowProperty(_ecore_x_disp, win, property, 0, LONG_MAX,
529 False, type, &type_ret, &size_ret, 543 False, type, &type_ret, &size_ret,
530 &num_ret, &bytes, &prop_ret); 544 &num_ret, &bytes, &prop_ret);
531 545 if (_ecore_xlib_sync) ecore_x_sync();
532 if (ret != Success) 546 if (ret != Success)
533 return 0; 547 return 0;
534
535 if (!num_ret) 548 if (!num_ret)
536 { 549 {
537 XFree(prop_ret); 550 XFree(prop_ret);
@@ -575,6 +588,7 @@ ecore_x_window_prop_property_del(Ecore_X_Window win,
575{ 588{
576 LOGFN(__FILE__, __LINE__, __FUNCTION__); 589 LOGFN(__FILE__, __LINE__, __FUNCTION__);
577 XDeleteProperty(_ecore_x_disp, win, property); 590 XDeleteProperty(_ecore_x_disp, win, property);
591 if (_ecore_xlib_sync) ecore_x_sync();
578} 592}
579 593
580EAPI Ecore_X_Atom * 594EAPI Ecore_X_Atom *
@@ -590,6 +604,7 @@ ecore_x_window_prop_list(Ecore_X_Window win,
590 *num_ret = 0; 604 *num_ret = 0;
591 605
592 atom_ret = XListProperties(_ecore_x_disp, win, &num); 606 atom_ret = XListProperties(_ecore_x_disp, win, &num);
607 if (_ecore_xlib_sync) ecore_x_sync();
593 if (!atom_ret) 608 if (!atom_ret)
594 return NULL; 609 return NULL;
595 610
@@ -630,6 +645,7 @@ ecore_x_window_prop_string_set(Ecore_X_Window win,
630 xtp.encoding = ECORE_X_ATOM_UTF8_STRING; 645 xtp.encoding = ECORE_X_ATOM_UTF8_STRING;
631 xtp.nitems = strlen(str); 646 xtp.nitems = strlen(str);
632 XSetTextProperty(_ecore_x_disp, win, &xtp, type); 647 XSetTextProperty(_ecore_x_disp, win, &xtp, type);
648 if (_ecore_xlib_sync) ecore_x_sync();
633} 649}
634 650
635/** 651/**
@@ -655,6 +671,7 @@ ecore_x_window_prop_string_get(Ecore_X_Window win,
655 char **list = NULL; 671 char **list = NULL;
656 Status s; 672 Status s;
657 673
674 if (_ecore_xlib_sync) ecore_x_sync();
658 if (xtp.encoding == ECORE_X_ATOM_UTF8_STRING) 675 if (xtp.encoding == ECORE_X_ATOM_UTF8_STRING)
659 str = strdup((char *)xtp.value); 676 str = strdup((char *)xtp.value);
660 else 677 else
@@ -666,6 +683,7 @@ ecore_x_window_prop_string_get(Ecore_X_Window win,
666 s = XmbTextPropertyToTextList(_ecore_x_disp, &xtp, 683 s = XmbTextPropertyToTextList(_ecore_x_disp, &xtp,
667 &list, &items); 684 &list, &items);
668#endif /* ifdef X_HAVE_UTF8_STRING */ 685#endif /* ifdef X_HAVE_UTF8_STRING */
686 if (_ecore_xlib_sync) ecore_x_sync();
669 if ((s == XLocaleNotSupported) || 687 if ((s == XLocaleNotSupported) ||
670 (s == XNoMemory) || (s == XConverterNotFound)) 688 (s == XNoMemory) || (s == XConverterNotFound))
671 str = strdup((char *)xtp.value); 689 str = strdup((char *)xtp.value);
@@ -678,7 +696,6 @@ ecore_x_window_prop_string_get(Ecore_X_Window win,
678 696
679 XFree(xtp.value); 697 XFree(xtp.value);
680 } 698 }
681
682 return str; 699 return str;
683} 700}
684 701
@@ -697,7 +714,9 @@ ecore_x_window_prop_protocol_isset(Ecore_X_Window win,
697 LOGFN(__FILE__, __LINE__, __FUNCTION__); 714 LOGFN(__FILE__, __LINE__, __FUNCTION__);
698 proto = _ecore_x_atoms_wm_protocols[protocol]; 715 proto = _ecore_x_atoms_wm_protocols[protocol];
699 716
700 if (!XGetWMProtocols(_ecore_x_disp, win, &protos, &protos_count)) 717 ret = XGetWMProtocols(_ecore_x_disp, win, &protos, &protos_count);
718 if (_ecore_xlib_sync) ecore_x_sync();
719 if (!ret)
701 return ret; 720 return ret;
702 721
703 for (i = 0; i < protos_count; i++) 722 for (i = 0; i < protos_count; i++)
@@ -708,7 +727,6 @@ ecore_x_window_prop_protocol_isset(Ecore_X_Window win,
708 } 727 }
709 728
710 XFree(protos); 729 XFree(protos);
711
712 return ret; 730 return ret;
713} 731}
714 732
@@ -727,9 +745,12 @@ ecore_x_window_prop_protocol_list_get(Ecore_X_Window win,
727 Atom *protos = NULL; 745 Atom *protos = NULL;
728 int i, protos_count = 0; 746 int i, protos_count = 0;
729 Ecore_X_WM_Protocol *prot_ret = NULL; 747 Ecore_X_WM_Protocol *prot_ret = NULL;
748 Eina_Bool success;
730 749
731 LOGFN(__FILE__, __LINE__, __FUNCTION__); 750 LOGFN(__FILE__, __LINE__, __FUNCTION__);
732 if (!XGetWMProtocols(_ecore_x_disp, win, &protos, &protos_count)) 751 success = XGetWMProtocols(_ecore_x_disp, win, &protos, &protos_count);
752 if (_ecore_xlib_sync) ecore_x_sync();
753 if (!success)
733 return NULL; 754 return NULL;
734 755
735 if ((!protos) || (protos_count <= 0)) 756 if ((!protos) || (protos_count <= 0))
diff --git a/src/lib/ecore_x/xlib/ecore_x_window_shape.c b/src/lib/ecore_x/xlib/ecore_x_window_shape.c
index df3e76b..987aa07 100644
--- a/src/lib/ecore_x/xlib/ecore_x_window_shape.c
+++ b/src/lib/ecore_x/xlib/ecore_x_window_shape.c
@@ -29,6 +29,7 @@ ecore_x_window_shape_mask_set(Ecore_X_Window win,
29{ 29{
30 LOGFN(__FILE__, __LINE__, __FUNCTION__); 30 LOGFN(__FILE__, __LINE__, __FUNCTION__);
31 XShapeCombineMask(_ecore_x_disp, win, ShapeBounding, 0, 0, mask, ShapeSet); 31 XShapeCombineMask(_ecore_x_disp, win, ShapeBounding, 0, 0, mask, ShapeSet);
32 if (_ecore_xlib_sync) ecore_x_sync();
32} 33}
33 34
34/** 35/**
@@ -45,6 +46,7 @@ ecore_x_window_shape_input_mask_set(Ecore_X_Window win,
45 LOGFN(__FILE__, __LINE__, __FUNCTION__); 46 LOGFN(__FILE__, __LINE__, __FUNCTION__);
46#ifdef ShapeInput 47#ifdef ShapeInput
47 XShapeCombineMask(_ecore_x_disp, win, ShapeInput, 0, 0, mask, ShapeSet); 48 XShapeCombineMask(_ecore_x_disp, win, ShapeInput, 0, 0, mask, ShapeSet);
49 if (_ecore_xlib_sync) ecore_x_sync();
48#else /* ifdef ShapeInput */ 50#else /* ifdef ShapeInput */
49 return; 51 return;
50 win = mask = 0; 52 win = mask = 0;
@@ -64,6 +66,7 @@ ecore_x_window_shape_window_set(Ecore_X_Window win,
64 shape_win, 66 shape_win,
65 ShapeBounding, 67 ShapeBounding,
66 ShapeSet); 68 ShapeSet);
69 if (_ecore_xlib_sync) ecore_x_sync();
67} 70}
68 71
69EAPI void 72EAPI void
@@ -80,6 +83,7 @@ ecore_x_window_shape_input_window_set(Ecore_X_Window win,
80 shape_win, 83 shape_win,
81 ShapeInput, 84 ShapeInput,
82 ShapeSet); 85 ShapeSet);
86 if (_ecore_xlib_sync) ecore_x_sync();
83#else 87#else
84 return; 88 return;
85 win = shape_win = 0; 89 win = shape_win = 0;
@@ -101,6 +105,7 @@ ecore_x_window_shape_window_set_xy(Ecore_X_Window win,
101 shape_win, 105 shape_win,
102 ShapeBounding, 106 ShapeBounding,
103 ShapeSet); 107 ShapeSet);
108 if (_ecore_xlib_sync) ecore_x_sync();
104} 109}
105 110
106EAPI void 111EAPI void
@@ -119,6 +124,7 @@ ecore_x_window_shape_input_window_set_xy(Ecore_X_Window win,
119 shape_win, 124 shape_win,
120 ShapeInput, 125 ShapeInput,
121 ShapeSet); 126 ShapeSet);
127 if (_ecore_xlib_sync) ecore_x_sync();
122#else 128#else
123 return; 129 return;
124 win = shape_win = x = y = 0; 130 win = shape_win = x = y = 0;
@@ -148,6 +154,7 @@ ecore_x_window_shape_rectangle_set(Ecore_X_Window win,
148 1, 154 1,
149 ShapeSet, 155 ShapeSet,
150 Unsorted); 156 Unsorted);
157 if (_ecore_xlib_sync) ecore_x_sync();
151} 158}
152 159
153EAPI void 160EAPI void
@@ -174,6 +181,7 @@ ecore_x_window_shape_input_rectangle_set(Ecore_X_Window win,
174 1, 181 1,
175 ShapeSet, 182 ShapeSet,
176 Unsorted); 183 Unsorted);
184 if (_ecore_xlib_sync) ecore_x_sync();
177#else 185#else
178 return; 186 return;
179 win = x = y = w = h = 0; 187 win = x = y = w = h = 0;
@@ -212,6 +220,7 @@ ecore_x_window_shape_rectangles_set(Ecore_X_Window win,
212 num, 220 num,
213 ShapeSet, 221 ShapeSet,
214 Unsorted); 222 Unsorted);
223 if (_ecore_xlib_sync) ecore_x_sync();
215 if (rect) free(rect); 224 if (rect) free(rect);
216#else 225#else
217 return; 226 return;
@@ -251,6 +260,7 @@ ecore_x_window_shape_input_rectangles_set(Ecore_X_Window win,
251 num, 260 num,
252 ShapeSet, 261 ShapeSet,
253 Unsorted); 262 Unsorted);
263 if (_ecore_xlib_sync) ecore_x_sync();
254 if (rect) free(rect); 264 if (rect) free(rect);
255#else 265#else
256 return; 266 return;
@@ -281,6 +291,7 @@ ecore_x_window_shape_rectangle_subtract(Ecore_X_Window win,
281 1, 291 1,
282 ShapeSubtract, 292 ShapeSubtract,
283 Unsorted); 293 Unsorted);
294 if (_ecore_xlib_sync) ecore_x_sync();
284} 295}
285 296
286EAPI void 297EAPI void
@@ -307,6 +318,7 @@ ecore_x_window_shape_input_rectangle_subtract(Ecore_X_Window win,
307 1, 318 1,
308 ShapeSubtract, 319 ShapeSubtract,
309 Unsorted); 320 Unsorted);
321 if (_ecore_xlib_sync) ecore_x_sync();
310#else 322#else
311 return; 323 return;
312 win = x = y = w = h = 0; 324 win = x = y = w = h = 0;
@@ -326,6 +338,7 @@ ecore_x_window_shape_window_add(Ecore_X_Window win,
326 shape_win, 338 shape_win,
327 ShapeBounding, 339 ShapeBounding,
328 ShapeUnion); 340 ShapeUnion);
341 if (_ecore_xlib_sync) ecore_x_sync();
329} 342}
330 343
331EAPI void 344EAPI void
@@ -343,6 +356,7 @@ ecore_x_window_shape_window_add_xy(Ecore_X_Window win,
343 shape_win, 356 shape_win,
344 ShapeBounding, 357 ShapeBounding,
345 ShapeUnion); 358 ShapeUnion);
359 if (_ecore_xlib_sync) ecore_x_sync();
346} 360}
347 361
348EAPI void 362EAPI void
@@ -361,6 +375,7 @@ ecore_x_window_shape_input_window_add_xy(Ecore_X_Window win,
361 shape_win, 375 shape_win,
362 ShapeInput, 376 ShapeInput,
363 ShapeUnion); 377 ShapeUnion);
378 if (_ecore_xlib_sync) ecore_x_sync();
364#else 379#else
365 return; 380 return;
366 win = shape_win = x = y = 0; 381 win = shape_win = x = y = 0;
@@ -390,6 +405,7 @@ ecore_x_window_shape_rectangle_add(Ecore_X_Window win,
390 1, 405 1,
391 ShapeUnion, 406 ShapeUnion,
392 Unsorted); 407 Unsorted);
408 if (_ecore_xlib_sync) ecore_x_sync();
393} 409}
394 410
395EAPI void 411EAPI void
@@ -416,6 +432,7 @@ ecore_x_window_shape_input_rectangle_add(Ecore_X_Window win,
416 1, 432 1,
417 ShapeUnion, 433 ShapeUnion,
418 Unsorted); 434 Unsorted);
435 if (_ecore_xlib_sync) ecore_x_sync();
419#else 436#else
420 return; 437 return;
421 win = x = y = w = h = 0; 438 win = x = y = w = h = 0;
@@ -445,6 +462,7 @@ ecore_x_window_shape_rectangle_clip(Ecore_X_Window win,
445 1, 462 1,
446 ShapeIntersect, 463 ShapeIntersect,
447 Unsorted); 464 Unsorted);
465 if (_ecore_xlib_sync) ecore_x_sync();
448} 466}
449 467
450EAPI void 468EAPI void
@@ -471,6 +489,7 @@ ecore_x_window_shape_input_rectangle_clip(Ecore_X_Window win,
471 1, 489 1,
472 ShapeIntersect, 490 ShapeIntersect,
473 Unsorted); 491 Unsorted);
492 if (_ecore_xlib_sync) ecore_x_sync();
474#else 493#else
475 return; 494 return;
476 win = x = y = w = h = 0; 495 win = x = y = w = h = 0;
@@ -508,6 +527,7 @@ ecore_x_window_shape_rectangles_add(Ecore_X_Window win,
508 num, 527 num,
509 ShapeUnion, 528 ShapeUnion,
510 Unsorted); 529 Unsorted);
530 if (_ecore_xlib_sync) ecore_x_sync();
511 if (rect) free(rect); 531 if (rect) free(rect);
512} 532}
513 533
@@ -543,6 +563,7 @@ ecore_x_window_shape_input_rectangles_add(Ecore_X_Window win,
543 num, 563 num,
544 ShapeUnion, 564 ShapeUnion,
545 Unsorted); 565 Unsorted);
566 if (_ecore_xlib_sync) ecore_x_sync();
546 if (rect) free(rect); 567 if (rect) free(rect);
547#else 568#else
548 return; 569 return;
@@ -560,6 +581,7 @@ ecore_x_window_shape_rectangles_get(Ecore_X_Window win,
560 581
561 LOGFN(__FILE__, __LINE__, __FUNCTION__); 582 LOGFN(__FILE__, __LINE__, __FUNCTION__);
562 rect = XShapeGetRectangles(_ecore_x_disp, win, ShapeBounding, &num, &ord); 583 rect = XShapeGetRectangles(_ecore_x_disp, win, ShapeBounding, &num, &ord);
584 if (_ecore_xlib_sync) ecore_x_sync();
563 if (rect) 585 if (rect)
564 { 586 {
565 if (num < 1) 587 if (num < 1)
@@ -599,6 +621,7 @@ ecore_x_window_shape_input_rectangles_get(Ecore_X_Window win,
599 621
600 LOGFN(__FILE__, __LINE__, __FUNCTION__); 622 LOGFN(__FILE__, __LINE__, __FUNCTION__);
601 rect = XShapeGetRectangles(_ecore_x_disp, win, ShapeInput, &num, &ord); 623 rect = XShapeGetRectangles(_ecore_x_disp, win, ShapeInput, &num, &ord);
624 if (_ecore_xlib_sync) ecore_x_sync();
602 if (rect) 625 if (rect)
603 { 626 {
604 if (num < 1) 627 if (num < 1)
@@ -638,9 +661,11 @@ ecore_x_window_shape_input_rectangles_get(Ecore_X_Window win,
638 &(rects[0].width), &(rects[0].height), 661 &(rects[0].width), &(rects[0].height),
639 &di, &di)) 662 &di, &di))
640 { 663 {
664 if (_ecore_xlib_sync) ecore_x_sync();
641 free(rects); 665 free(rects);
642 return NULL; 666 return NULL;
643 } 667 }
668 if (_ecore_xlib_sync) ecore_x_sync();
644 if (num_ret) *num_ret = 1; 669 if (num_ret) *num_ret = 1;
645 return rects; 670 return rects;
646#endif 671#endif
@@ -655,5 +680,6 @@ ecore_x_window_shape_events_select(Ecore_X_Window win,
655 XShapeSelectInput(_ecore_x_disp, win, ShapeNotifyMask); 680 XShapeSelectInput(_ecore_x_disp, win, ShapeNotifyMask);
656 else 681 else
657 XShapeSelectInput(_ecore_x_disp, win, 0); 682 XShapeSelectInput(_ecore_x_disp, win, 0);
683 if (_ecore_xlib_sync) ecore_x_sync();
658} 684}
659 685
diff --git a/src/lib/ecore_x/xlib/ecore_x_xi2.c b/src/lib/ecore_x/xlib/ecore_x_xi2.c
index 8289688..2a49d0c 100644
--- a/src/lib/ecore_x/xlib/ecore_x_xi2.c
+++ b/src/lib/ecore_x/xlib/ecore_x_xi2.c
@@ -434,6 +434,7 @@ ecore_x_input_multi_select(Ecore_X_Window win)
434 XISetMask(mask, XI_ButtonRelease); 434 XISetMask(mask, XI_ButtonRelease);
435 XISetMask(mask, XI_Motion); 435 XISetMask(mask, XI_Motion);
436 XISelectEvents(_ecore_x_disp, win, &eventmask, 1); 436 XISelectEvents(_ecore_x_disp, win, &eventmask, 1);
437 if (_ecore_xlib_sync) ecore_x_sync();
437 find = EINA_TRUE; 438 find = EINA_TRUE;
438 } 439 }
439 else if (dev->use == XISlavePointer) 440 else if (dev->use == XISlavePointer)
@@ -485,6 +486,7 @@ ecore_x_input_multi_select(Ecore_X_Window win)
485#endif /* #ifdef ECORE_XI2_2 */ 486#endif /* #ifdef ECORE_XI2_2 */
486 487
487 XISelectEvents(_ecore_x_disp, win, &eventmask, 1); 488 XISelectEvents(_ecore_x_disp, win, &eventmask, 1);
489 if (_ecore_xlib_sync) ecore_x_sync();
488 find = EINA_TRUE; 490 find = EINA_TRUE;
489 } 491 }
490#ifdef ECORE_XI2_2 492#ifdef ECORE_XI2_2
@@ -507,6 +509,7 @@ ecore_x_input_multi_select(Ecore_X_Window win)
507 XISetMask(mask, XI_TouchBegin); 509 XISetMask(mask, XI_TouchBegin);
508 XISetMask(mask, XI_TouchEnd); 510 XISetMask(mask, XI_TouchEnd);
509 XISelectEvents(_ecore_x_disp, win, &eventmask, 1); 511 XISelectEvents(_ecore_x_disp, win, &eventmask, 1);
512 if (_ecore_xlib_sync) ecore_x_sync();
510 513
511 l = eina_inlist_append(l, (Eina_Inlist *)info); 514 l = eina_inlist_append(l, (Eina_Inlist *)info);
512 _ecore_x_xi2_touch_info_list = l; 515 _ecore_x_xi2_touch_info_list = l;
@@ -549,6 +552,7 @@ ecore_x_input_raw_select(Ecore_X_Window win)
549#endif 552#endif
550 553
551 XISelectEvents(_ecore_x_disp, win, &emask, 1); 554 XISelectEvents(_ecore_x_disp, win, &emask, 1);
555 if (_ecore_xlib_sync) ecore_x_sync();
552 556
553 return EINA_TRUE; 557 return EINA_TRUE;
554#else 558#else
diff --git a/src/lib/ecore_x/xlib/ecore_x_xinerama.c b/src/lib/ecore_x/xlib/ecore_x_xinerama.c
index f49a4d3..4a591f9 100644
--- a/src/lib/ecore_x/xlib/ecore_x_xinerama.c
+++ b/src/lib/ecore_x/xlib/ecore_x_xinerama.c
@@ -29,10 +29,13 @@ ecore_x_xinerama_screen_count_get(void)
29 _xin_info = NULL; 29 _xin_info = NULL;
30 if (XineramaQueryExtension(_ecore_x_disp, &event_base, &error_base)) 30 if (XineramaQueryExtension(_ecore_x_disp, &event_base, &error_base))
31 { 31 {
32 if (_ecore_xlib_sync) ecore_x_sync();
32 _xin_info = XineramaQueryScreens(_ecore_x_disp, &_xin_scr_num); 33 _xin_info = XineramaQueryScreens(_ecore_x_disp, &_xin_scr_num);
34 if (_ecore_xlib_sync) ecore_x_sync();
33 if (_xin_info) 35 if (_xin_info)
34 return _xin_scr_num; 36 return _xin_scr_num;
35 } 37 }
38 if (_ecore_xlib_sync) ecore_x_sync();
36 39
37#endif /* ifdef ECORE_XINERAMA */ 40#endif /* ifdef ECORE_XINERAMA */
38 return 0; 41 return 0;