summaryrefslogtreecommitdiff
path: root/src/lib/ecore_x
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2017-08-01 18:12:21 +0200
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2017-08-01 18:16:23 +0200
commitaca00f85021204bf18a536e271f7525781ff956b (patch)
tree530dcebb470764e2d43bde9aee842bd9b1f61bc2 /src/lib/ecore_x
parentae443173ec2a7941200943c09fa7dbddc2e605e1 (diff)
ecore_x: init XEvents before passing to x
it turns out that xlib is going to copy the complete struct into something internal. This might lead to the condition that a uninitalized value might be part of the struct, and when later the struct is read again the code might do wrong stuff since that value could be set now to a randomly other meaningfull value. This turned out on me in e as i could not write any letters like ßöäü, since that lead to a not returning call to _XReply internal of xlib. Dugging that showed that xlib was waiting on a reply of a call that never got executed, and the XEvent it is waiting on just contians a randomly correct value. @fix
Diffstat (limited to 'src/lib/ecore_x')
-rw-r--r--src/lib/ecore_x/ecore_x.c16
-rw-r--r--src/lib/ecore_x/ecore_x_dnd.c8
-rw-r--r--src/lib/ecore_x/ecore_x_e.c24
-rw-r--r--src/lib/ecore_x/ecore_x_icccm.c2
-rw-r--r--src/lib/ecore_x/ecore_x_netwm.c12
-rw-r--r--src/lib/ecore_x/ecore_x_selection.c2
-rw-r--r--src/lib/ecore_x/ecore_x_window.c4
7 files changed, 34 insertions, 34 deletions
diff --git a/src/lib/ecore_x/ecore_x.c b/src/lib/ecore_x/ecore_x.c
index 8ca8e61f45..f54f3c30be 100644
--- a/src/lib/ecore_x/ecore_x.c
+++ b/src/lib/ecore_x/ecore_x.c
@@ -1770,7 +1770,7 @@ ecore_x_window_button_grab(Ecore_X_Window win,
1770static void 1770static void
1771_ecore_x_sync_magic_send(int val, Ecore_X_Window swin, int b, int mod, int anymod) 1771_ecore_x_sync_magic_send(int val, Ecore_X_Window swin, int b, int mod, int anymod)
1772{ 1772{
1773 XEvent xev; 1773 XEvent xev = { 0 };
1774 1774
1775 xev.xclient.type = ClientMessage; 1775 xev.xclient.type = ClientMessage;
1776 xev.xclient.serial = 0; 1776 xev.xclient.serial = 0;
@@ -2138,7 +2138,7 @@ ecore_x_client_message32_send(Ecore_X_Window win,
2138 long d3, 2138 long d3,
2139 long d4) 2139 long d4)
2140{ 2140{
2141 XEvent xev; 2141 XEvent xev = { 0 };
2142 Eina_Bool ret; 2142 Eina_Bool ret;
2143 2143
2144 LOGFN(__FILE__, __LINE__, __FUNCTION__); 2144 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -2174,7 +2174,7 @@ ecore_x_client_message8_send(Ecore_X_Window win,
2174 const void *data, 2174 const void *data,
2175 int len) 2175 int len)
2176{ 2176{
2177 XEvent xev; 2177 XEvent xev = { 0 };
2178 Eina_Bool ret; 2178 Eina_Bool ret;
2179 2179
2180 LOGFN(__FILE__, __LINE__, __FUNCTION__); 2180 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -2201,7 +2201,7 @@ ecore_x_mouse_move_send(Ecore_X_Window win,
2201 int x, 2201 int x,
2202 int y) 2202 int y)
2203{ 2203{
2204 XEvent xev; 2204 XEvent xev = { 0 };
2205 XWindowAttributes att; 2205 XWindowAttributes att;
2206 Window tw; 2206 Window tw;
2207 int rx, ry; 2207 int rx, ry;
@@ -2234,7 +2234,7 @@ ecore_x_mouse_down_send(Ecore_X_Window win,
2234 int y, 2234 int y,
2235 int b) 2235 int b)
2236{ 2236{
2237 XEvent xev; 2237 XEvent xev = { 0 };
2238 XWindowAttributes att; 2238 XWindowAttributes att;
2239 Window tw; 2239 Window tw;
2240 int rx, ry; 2240 int rx, ry;
@@ -2267,7 +2267,7 @@ ecore_x_mouse_up_send(Ecore_X_Window win,
2267 int y, 2267 int y,
2268 int b) 2268 int b)
2269{ 2269{
2270 XEvent xev; 2270 XEvent xev = { 0 };
2271 XWindowAttributes att; 2271 XWindowAttributes att;
2272 Window tw; 2272 Window tw;
2273 int rx, ry; 2273 int rx, ry;
@@ -2299,7 +2299,7 @@ ecore_x_mouse_in_send(Ecore_X_Window win,
2299 int x, 2299 int x,
2300 int y) 2300 int y)
2301{ 2301{
2302 XEvent xev; 2302 XEvent xev = { 0 };
2303 XWindowAttributes att; 2303 XWindowAttributes att;
2304 Window tw; 2304 Window tw;
2305 int rx, ry; 2305 int rx, ry;
@@ -2333,7 +2333,7 @@ ecore_x_mouse_out_send(Ecore_X_Window win,
2333 int x, 2333 int x,
2334 int y) 2334 int y)
2335{ 2335{
2336 XEvent xev; 2336 XEvent xev = { 0 };
2337 XWindowAttributes att; 2337 XWindowAttributes att;
2338 Window tw; 2338 Window tw;
2339 int rx, ry; 2339 int rx, ry;
diff --git a/src/lib/ecore_x/ecore_x_dnd.c b/src/lib/ecore_x/ecore_x_dnd.c
index 4398754fa9..59607b8f7c 100644
--- a/src/lib/ecore_x/ecore_x_dnd.c
+++ b/src/lib/ecore_x/ecore_x_dnd.c
@@ -469,7 +469,7 @@ _ecore_x_dnd_begin(Ecore_X_Window source,
469static Eina_Bool 469static Eina_Bool
470_ecore_x_dnd_drop(Eina_Bool self) 470_ecore_x_dnd_drop(Eina_Bool self)
471{ 471{
472 XEvent xev; 472 XEvent xev = { 0 };
473 int status = EINA_FALSE; 473 int status = EINA_FALSE;
474 474
475 LOGFN(__FILE__, __LINE__, __FUNCTION__); 475 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -549,7 +549,7 @@ ecore_x_dnd_send_status(Eina_Bool will_accept,
549 Ecore_X_Rectangle rectangle, 549 Ecore_X_Rectangle rectangle,
550 Ecore_X_Atom action) 550 Ecore_X_Atom action)
551{ 551{
552 XEvent xev; 552 XEvent xev = { 0 };
553 553
554 EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp); 554 EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
555 555
@@ -601,7 +601,7 @@ ecore_x_dnd_send_status(Eina_Bool will_accept,
601EAPI void 601EAPI void
602ecore_x_dnd_send_finished(void) 602ecore_x_dnd_send_finished(void)
603{ 603{
604 XEvent xev; 604 XEvent xev = { 0 };
605 605
606 EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp); 606 EINA_SAFETY_ON_NULL_RETURN(_ecore_x_disp);
607 607
@@ -649,7 +649,7 @@ _ecore_x_dnd_drag(Ecore_X_Window root,
649 int x, 649 int x,
650 int y) 650 int y)
651{ 651{
652 XEvent xev; 652 XEvent xev = { 0 };
653 Ecore_X_Window win; 653 Ecore_X_Window win;
654 Ecore_X_Window *skip; 654 Ecore_X_Window *skip;
655 Ecore_X_Xdnd_Position pos; 655 Ecore_X_Xdnd_Position pos;
diff --git a/src/lib/ecore_x/ecore_x_e.c b/src/lib/ecore_x/ecore_x_e.c
index c6ca7545a8..9999af1065 100644
--- a/src/lib/ecore_x/ecore_x_e.c
+++ b/src/lib/ecore_x/ecore_x_e.c
@@ -1100,7 +1100,7 @@ EAPI void
1100ecore_x_e_comp_sync_draw_done_send(Ecore_X_Window root, 1100ecore_x_e_comp_sync_draw_done_send(Ecore_X_Window root,
1101 Ecore_X_Window win) 1101 Ecore_X_Window win)
1102{ 1102{
1103 XEvent xev; 1103 XEvent xev = { 0 };
1104 1104
1105 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1105 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1106 1106
@@ -1132,7 +1132,7 @@ ecore_x_e_comp_sync_draw_size_done_send(Ecore_X_Window root,
1132 int w, 1132 int w,
1133 int h) 1133 int h)
1134{ 1134{
1135 XEvent xev; 1135 XEvent xev = { 0 };
1136 1136
1137 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1137 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1138 1138
@@ -1457,7 +1457,7 @@ ecore_x_e_window_profile_change_send(Ecore_X_Window root,
1457 Ecore_X_Window win, 1457 Ecore_X_Window win,
1458 const char *profile) 1458 const char *profile)
1459{ 1459{
1460 XEvent xev; 1460 XEvent xev = { 0 };
1461 Ecore_X_Atom atom; 1461 Ecore_X_Atom atom;
1462 1462
1463 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1463 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -1493,7 +1493,7 @@ EAPI void
1493ecore_x_e_window_profile_change_request_send(Ecore_X_Window win, 1493ecore_x_e_window_profile_change_request_send(Ecore_X_Window win,
1494 const char *profile) 1494 const char *profile)
1495{ 1495{
1496 XEvent xev; 1496 XEvent xev = { 0 };
1497 Ecore_X_Atom atom; 1497 Ecore_X_Atom atom;
1498 1498
1499 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1499 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -1526,7 +1526,7 @@ ecore_x_e_window_profile_change_done_send(Ecore_X_Window root,
1526 Ecore_X_Window win, 1526 Ecore_X_Window win,
1527 const char *profile) 1527 const char *profile)
1528{ 1528{
1529 XEvent xev; 1529 XEvent xev = { 0 };
1530 Ecore_X_Atom atom; 1530 Ecore_X_Atom atom;
1531 1531
1532 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1532 LOGFN(__FILE__, __LINE__, __FUNCTION__);
@@ -1629,7 +1629,7 @@ ecore_x_e_comp_sync_supported_get(Ecore_X_Window root)
1629EAPI void 1629EAPI void
1630ecore_x_e_comp_sync_begin_send(Ecore_X_Window win) 1630ecore_x_e_comp_sync_begin_send(Ecore_X_Window win)
1631{ 1631{
1632 XEvent xev; 1632 XEvent xev = { 0 };
1633 1633
1634 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1634 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1635 1635
@@ -1655,7 +1655,7 @@ ecore_x_e_comp_sync_begin_send(Ecore_X_Window win)
1655EAPI void 1655EAPI void
1656ecore_x_e_comp_sync_end_send(Ecore_X_Window win) 1656ecore_x_e_comp_sync_end_send(Ecore_X_Window win)
1657{ 1657{
1658 XEvent xev; 1658 XEvent xev = { 0 };
1659 1659
1660 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1660 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1661 1661
@@ -1681,7 +1681,7 @@ ecore_x_e_comp_sync_end_send(Ecore_X_Window win)
1681EAPI void 1681EAPI void
1682ecore_x_e_comp_sync_cancel_send(Ecore_X_Window win) 1682ecore_x_e_comp_sync_cancel_send(Ecore_X_Window win)
1683{ 1683{
1684 XEvent xev; 1684 XEvent xev = { 0 };
1685 1685
1686 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1686 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1687 1687
@@ -1707,7 +1707,7 @@ ecore_x_e_comp_sync_cancel_send(Ecore_X_Window win)
1707EAPI void 1707EAPI void
1708ecore_x_e_comp_flush_send(Ecore_X_Window win) 1708ecore_x_e_comp_flush_send(Ecore_X_Window win)
1709{ 1709{
1710 XEvent xev; 1710 XEvent xev = { 0 };
1711 1711
1712 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1712 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1713 1713
@@ -1733,7 +1733,7 @@ ecore_x_e_comp_flush_send(Ecore_X_Window win)
1733EAPI void 1733EAPI void
1734ecore_x_e_comp_dump_send(Ecore_X_Window win) 1734ecore_x_e_comp_dump_send(Ecore_X_Window win)
1735{ 1735{
1736 XEvent xev; 1736 XEvent xev = { 0 };
1737 1737
1738 LOGFN(__FILE__, __LINE__, __FUNCTION__); 1738 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1739 1739
@@ -2288,7 +2288,7 @@ ecore_x_e_window_rotation_change_prepare_done_send(Ecore_X_Window root,
2288 Ecore_X_Window win, 2288 Ecore_X_Window win,
2289 int rot) 2289 int rot)
2290{ 2290{
2291 XEvent xev; 2291 XEvent xev = { 0 };
2292 2292
2293 LOGFN(__FILE__, __LINE__, __FUNCTION__); 2293 LOGFN(__FILE__, __LINE__, __FUNCTION__);
2294 2294
@@ -2331,7 +2331,7 @@ ecore_x_e_window_rotation_change_done_send(Ecore_X_Window root,
2331 int w, 2331 int w,
2332 int h) 2332 int h)
2333{ 2333{
2334 XEvent xev; 2334 XEvent xev = { 0 };
2335 2335
2336 LOGFN(__FILE__, __LINE__, __FUNCTION__); 2336 LOGFN(__FILE__, __LINE__, __FUNCTION__);
2337 2337
diff --git a/src/lib/ecore_x/ecore_x_icccm.c b/src/lib/ecore_x/ecore_x_icccm.c
index d335fd2dea..4bf81da5ac 100644
--- a/src/lib/ecore_x/ecore_x_icccm.c
+++ b/src/lib/ecore_x/ecore_x_icccm.c
@@ -1235,7 +1235,7 @@ EAPI void
1235ecore_x_icccm_iconic_request_send(Ecore_X_Window win, 1235ecore_x_icccm_iconic_request_send(Ecore_X_Window win,
1236 Ecore_X_Window root) 1236 Ecore_X_Window root)
1237{ 1237{
1238 XEvent xev; 1238 XEvent xev = { 0 };
1239 1239
1240 if (!win) 1240 if (!win)
1241 return; 1241 return;
diff --git a/src/lib/ecore_x/ecore_x_netwm.c b/src/lib/ecore_x/ecore_x_netwm.c
index 83615e7419..182021aad1 100644
--- a/src/lib/ecore_x/ecore_x_netwm.c
+++ b/src/lib/ecore_x/ecore_x_netwm.c
@@ -351,7 +351,7 @@ ecore_x_netwm_client_active_request(Ecore_X_Window root,
351 int type, 351 int type,
352 Ecore_X_Window current_win) 352 Ecore_X_Window current_win)
353{ 353{
354 XEvent xev; 354 XEvent xev = { 0 };
355 355
356 LOGFN(__FILE__, __LINE__, __FUNCTION__); 356 LOGFN(__FILE__, __LINE__, __FUNCTION__);
357 if (!root) 357 if (!root)
@@ -1500,7 +1500,7 @@ ecore_x_netwm_sync_counter_get(Ecore_X_Window win,
1500EAPI void 1500EAPI void
1501ecore_x_netwm_ping_send(Ecore_X_Window win) 1501ecore_x_netwm_ping_send(Ecore_X_Window win)
1502{ 1502{
1503 XEvent xev; 1503 XEvent xev = { 0 };
1504 1504
1505 if (!win) 1505 if (!win)
1506 return; 1506 return;
@@ -1526,7 +1526,7 @@ ecore_x_netwm_sync_request_send(Ecore_X_Window win,
1526 unsigned int serial) 1526 unsigned int serial)
1527{ 1527{
1528 XSyncValue value; 1528 XSyncValue value;
1529 XEvent xev; 1529 XEvent xev = { 0 };
1530 1530
1531 if (!win) 1531 if (!win)
1532 return; 1532 return;
@@ -1556,7 +1556,7 @@ ecore_x_netwm_state_request_send(Ecore_X_Window win,
1556 Ecore_X_Window_State s2, 1556 Ecore_X_Window_State s2,
1557 Eina_Bool set) 1557 Eina_Bool set)
1558{ 1558{
1559 XEvent xev; 1559 XEvent xev = { 0 };
1560 1560
1561 if (!win) 1561 if (!win)
1562 return; 1562 return;
@@ -1590,7 +1590,7 @@ ecore_x_netwm_desktop_request_send(Ecore_X_Window win,
1590 Ecore_X_Window root, 1590 Ecore_X_Window root,
1591 unsigned int desktop) 1591 unsigned int desktop)
1592{ 1592{
1593 XEvent xev; 1593 XEvent xev = { 0 };
1594 1594
1595 if (!win) 1595 if (!win)
1596 return; 1596 return;
@@ -1620,7 +1620,7 @@ ecore_x_netwm_moveresize_request_send(Ecore_X_Window win,
1620 Ecore_X_Netwm_Direction direction, 1620 Ecore_X_Netwm_Direction direction,
1621 unsigned int button) 1621 unsigned int button)
1622{ 1622{
1623 XEvent xev; 1623 XEvent xev = { 0 };
1624 1624
1625 if (!win) 1625 if (!win)
1626 return; 1626 return;
diff --git a/src/lib/ecore_x/ecore_x_selection.c b/src/lib/ecore_x/ecore_x_selection.c
index ff0480d041..22cd5c8c7f 100644
--- a/src/lib/ecore_x/ecore_x_selection.c
+++ b/src/lib/ecore_x/ecore_x_selection.c
@@ -491,7 +491,7 @@ ecore_x_selection_notify_send(Ecore_X_Window requestor,
491 Ecore_X_Atom property, 491 Ecore_X_Atom property,
492 Ecore_X_Time tim) 492 Ecore_X_Time tim)
493{ 493{
494 XEvent xev; 494 XEvent xev = { 0 };
495 XSelectionEvent xnotify; 495 XSelectionEvent xnotify;
496 496
497 LOGFN(__FILE__, __LINE__, __FUNCTION__); 497 LOGFN(__FILE__, __LINE__, __FUNCTION__);
diff --git a/src/lib/ecore_x/ecore_x_window.c b/src/lib/ecore_x/ecore_x_window.c
index 444538a1c4..5600956605 100644
--- a/src/lib/ecore_x/ecore_x_window.c
+++ b/src/lib/ecore_x/ecore_x_window.c
@@ -467,7 +467,7 @@ ecore_x_window_ignore_list(int *num)
467EAPI void 467EAPI void
468ecore_x_window_delete_request_send(Ecore_X_Window win) 468ecore_x_window_delete_request_send(Ecore_X_Window win)
469{ 469{
470 XEvent xev; 470 XEvent xev = { 0 };
471 471
472 /* sorry sir, deleting the root window doesn't sound like 472 /* sorry sir, deleting the root window doesn't sound like
473 * a smart idea. 473 * a smart idea.
@@ -522,7 +522,7 @@ ecore_x_window_show(Ecore_X_Window win)
522EAPI void 522EAPI void
523ecore_x_window_hide(Ecore_X_Window win) 523ecore_x_window_hide(Ecore_X_Window win)
524{ 524{
525 XEvent xev; 525 XEvent xev = { 0 };
526 Window root; 526 Window root;
527 int idum; 527 int idum;
528 unsigned int uidum; 528 unsigned int uidum;