summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2018-01-17 17:33:57 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2018-01-17 17:06:13 -0500
commitb48781aa6c85c72f620c57cebff96580ddd67899 (patch)
treea069725dce222985af8e714b36c28f59e5a18b51
parent4fb807dd20aecbb29f8616b41451068a0b6d1c65 (diff)
wayland: always flush client display when protocol sends are pending
in the case where a connection was not actively rendering, there was nothing which would trigger a display flush, leading to applications potentially deadlocking @fix
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_display.c13
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_input.c3
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_output.c1
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_subsurf.c5
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_window.c20
-rw-r--r--src/lib/elementary/efl_ui_win.c4
6 files changed, 40 insertions, 6 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_display.c b/src/lib/ecore_wl2/ecore_wl2_display.c
index 740090c23a..4ee8cd6d59 100644
--- a/src/lib/ecore_wl2/ecore_wl2_display.c
+++ b/src/lib/ecore_wl2/ecore_wl2_display.c
@@ -59,9 +59,10 @@ static const struct zwp_linux_dmabuf_v1_listener _dmabuf_listener =
59}; 59};
60 60
61static void 61static void
62_xdg_shell_cb_ping(void *data EINA_UNUSED, struct xdg_wm_base *shell, uint32_t serial) 62_xdg_shell_cb_ping(void *data, struct xdg_wm_base *shell, uint32_t serial)
63{ 63{
64 xdg_wm_base_pong(shell, serial); 64 xdg_wm_base_pong(shell, serial);
65 ecore_wl2_display_flush(data);
65} 66}
66 67
67static const struct xdg_wm_base_listener _xdg_shell_listener = 68static const struct xdg_wm_base_listener _xdg_shell_listener =
@@ -70,9 +71,10 @@ static const struct xdg_wm_base_listener _xdg_shell_listener =
70}; 71};
71 72
72static void 73static void
73_zxdg_shell_cb_ping(void *data EINA_UNUSED, struct zxdg_shell_v6 *shell, uint32_t serial) 74_zxdg_shell_cb_ping(void *data, struct zxdg_shell_v6 *shell, uint32_t serial)
74{ 75{
75 zxdg_shell_v6_pong(shell, serial); 76 zxdg_shell_v6_pong(shell, serial);
77 ecore_wl2_display_flush(data);
76} 78}
77 79
78static const struct zxdg_shell_v6_listener _zxdg_shell_listener = 80static const struct zxdg_shell_v6_listener _zxdg_shell_listener =
@@ -357,6 +359,7 @@ _cb_global_add(void *data, struct wl_registry *registry, unsigned int id, const
357 window->xdg_surface, window->weight.w, window->weight.h); 359 window->xdg_surface, window->weight.w, window->weight.h);
358 } 360 }
359 } 361 }
362 ecore_wl2_display_flush(ewd);
360 363
361event: 364event:
362 /* allocate space for event structure */ 365 /* allocate space for event structure */
@@ -648,7 +651,7 @@ _ecore_wl2_shell_bind(Ecore_Wl2_Display *ewd)
648 wl_registry_bind(ewd->wl.registry, global->id, 651 wl_registry_bind(ewd->wl.registry, global->id,
649 &xdg_wm_base_interface, 1); 652 &xdg_wm_base_interface, 1);
650 xdg_wm_base_add_listener(ewd->wl.xdg_wm_base, 653 xdg_wm_base_add_listener(ewd->wl.xdg_wm_base,
651 &_xdg_shell_listener, NULL); 654 &_xdg_shell_listener, ewd);
652 ewd->shell_done = EINA_TRUE; 655 ewd->shell_done = EINA_TRUE;
653 } 656 }
654 else if (!strcmp(global->interface, "zxdg_shell_v6")) 657 else if (!strcmp(global->interface, "zxdg_shell_v6"))
@@ -657,9 +660,10 @@ _ecore_wl2_shell_bind(Ecore_Wl2_Display *ewd)
657 wl_registry_bind(ewd->wl.registry, global->id, 660 wl_registry_bind(ewd->wl.registry, global->id,
658 &zxdg_shell_v6_interface, 1); 661 &zxdg_shell_v6_interface, 1);
659 zxdg_shell_v6_add_listener(ewd->wl.zxdg_shell, 662 zxdg_shell_v6_add_listener(ewd->wl.zxdg_shell,
660 &_zxdg_shell_listener, NULL); 663 &_zxdg_shell_listener, ewd);
661 ewd->shell_done = EINA_TRUE; 664 ewd->shell_done = EINA_TRUE;
662 } 665 }
666 ecore_wl2_display_flush(ewd);
663} 667}
664 668
665static void 669static void
@@ -744,7 +748,6 @@ _ecore_wl2_display_connect(Ecore_Wl2_Display *ewd, Eina_Bool sync)
744 ewd->idle_enterer = ecore_idle_enterer_add(_cb_connect_idle, ewd); 748 ewd->idle_enterer = ecore_idle_enterer_add(_cb_connect_idle, ewd);
745 749
746 _ecore_wl2_display_event(ewd, ECORE_WL2_EVENT_CONNECT); 750 _ecore_wl2_display_event(ewd, ECORE_WL2_EVENT_CONNECT);
747 ecore_wl2_display_flush(ewd);
748 return EINA_TRUE; 751 return EINA_TRUE;
749} 752}
750 753
diff --git a/src/lib/ecore_wl2/ecore_wl2_input.c b/src/lib/ecore_wl2/ecore_wl2_input.c
index 6f751fb9b2..aa87fde651 100644
--- a/src/lib/ecore_wl2/ecore_wl2_input.c
+++ b/src/lib/ecore_wl2/ecore_wl2_input.c
@@ -1433,6 +1433,7 @@ _seat_cb_capabilities(void *data, struct wl_seat *seat, enum wl_seat_capability
1433 wl_touch_destroy(input->wl.touch); 1433 wl_touch_destroy(input->wl.touch);
1434 input->wl.touch = NULL; 1434 input->wl.touch = NULL;
1435 } 1435 }
1436 ecore_wl2_display_flush(input->display);
1436 1437
1437 ev = calloc(1, sizeof(Ecore_Wl2_Event_Seat_Capabilities)); 1438 ev = calloc(1, sizeof(Ecore_Wl2_Event_Seat_Capabilities));
1438 EINA_SAFETY_ON_NULL_RETURN(ev); 1439 EINA_SAFETY_ON_NULL_RETURN(ev);
@@ -1511,6 +1512,7 @@ _ecore_wl2_input_cursor_update(void *data)
1511 wl_pointer_set_cursor(input->wl.pointer, input->pointer.enter_serial, 1512 wl_pointer_set_cursor(input->wl.pointer, input->pointer.enter_serial,
1512 input->cursor.surface, 1513 input->cursor.surface,
1513 input->cursor.hot_x, input->cursor.hot_y); 1514 input->cursor.hot_x, input->cursor.hot_y);
1515 ecore_wl2_display_flush(input->display);
1514 1516
1515 return ECORE_CALLBACK_RENEW; 1517 return ECORE_CALLBACK_RENEW;
1516} 1518}
@@ -1650,6 +1652,7 @@ _ecore_wl2_input_add(Ecore_Wl2_Display *display, unsigned int id, unsigned int v
1650 wl_data_device_manager_get_data_device(display->wl.data_device_manager, 1652 wl_data_device_manager_get_data_device(display->wl.data_device_manager,
1651 input->wl.seat); 1653 input->wl.seat);
1652 wl_data_device_add_listener(input->data.device, &_data_listener, input); 1654 wl_data_device_add_listener(input->data.device, &_data_listener, input);
1655 ecore_wl2_display_flush(input->display);
1653} 1656}
1654 1657
1655void 1658void
diff --git a/src/lib/ecore_wl2/ecore_wl2_output.c b/src/lib/ecore_wl2/ecore_wl2_output.c
index ba1d7cea8f..c58667131e 100644
--- a/src/lib/ecore_wl2/ecore_wl2_output.c
+++ b/src/lib/ecore_wl2/ecore_wl2_output.c
@@ -96,6 +96,7 @@ _ecore_wl2_output_add(Ecore_Wl2_Display *display, unsigned int id)
96 eina_inlist_append(display->outputs, EINA_INLIST_GET(output)); 96 eina_inlist_append(display->outputs, EINA_INLIST_GET(output));
97 97
98 wl_output_add_listener(output->wl_output, &_output_listener, output); 98 wl_output_add_listener(output->wl_output, &_output_listener, output);
99 ecore_wl2_display_flush(display);
99} 100}
100 101
101void 102void
diff --git a/src/lib/ecore_wl2/ecore_wl2_subsurf.c b/src/lib/ecore_wl2/ecore_wl2_subsurf.c
index 980c2eed47..c5ecf99e19 100644
--- a/src/lib/ecore_wl2/ecore_wl2_subsurf.c
+++ b/src/lib/ecore_wl2/ecore_wl2_subsurf.c
@@ -106,6 +106,7 @@ ecore_wl2_subsurface_position_set(Ecore_Wl2_Subsurface *subsurface, int x, int y
106 subsurface->y = y; 106 subsurface->y = y;
107 107
108 wl_subsurface_set_position(subsurface->wl.subsurface, x, y); 108 wl_subsurface_set_position(subsurface->wl.subsurface, x, y);
109 ecore_wl2_display_flush(subsurface->parent->display);
109} 110}
110 111
111EAPI void 112EAPI void
@@ -124,6 +125,7 @@ ecore_wl2_subsurface_place_above(Ecore_Wl2_Subsurface *subsurface, struct wl_sur
124 EINA_SAFETY_ON_NULL_RETURN(surface); 125 EINA_SAFETY_ON_NULL_RETURN(surface);
125 126
126 wl_subsurface_place_above(subsurface->wl.subsurface, surface); 127 wl_subsurface_place_above(subsurface->wl.subsurface, surface);
128 ecore_wl2_display_flush(subsurface->parent->display);
127} 129}
128 130
129EAPI void 131EAPI void
@@ -133,6 +135,7 @@ ecore_wl2_subsurface_place_below(Ecore_Wl2_Subsurface *subsurface, struct wl_sur
133 EINA_SAFETY_ON_NULL_RETURN(surface); 135 EINA_SAFETY_ON_NULL_RETURN(surface);
134 136
135 wl_subsurface_place_below(subsurface->wl.subsurface, surface); 137 wl_subsurface_place_below(subsurface->wl.subsurface, surface);
138 ecore_wl2_display_flush(subsurface->parent->display);
136} 139}
137 140
138EAPI void 141EAPI void
@@ -150,6 +153,7 @@ ecore_wl2_subsurface_sync_set(Ecore_Wl2_Subsurface *subsurface, Eina_Bool sync)
150 wl_subsurface_set_sync(subsurface->wl.subsurface); 153 wl_subsurface_set_sync(subsurface->wl.subsurface);
151 else 154 else
152 wl_subsurface_set_desync(subsurface->wl.subsurface); 155 wl_subsurface_set_desync(subsurface->wl.subsurface);
156 ecore_wl2_display_flush(subsurface->parent->display);
153} 157}
154 158
155EAPI void 159EAPI void
@@ -182,4 +186,5 @@ ecore_wl2_subsurface_opaque_region_set(Ecore_Wl2_Subsurface *subsurface, int x,
182 } 186 }
183 else 187 else
184 wl_surface_set_opaque_region(subsurface->wl.surface, NULL); 188 wl_surface_set_opaque_region(subsurface->wl.surface, NULL);
189 ecore_wl2_display_flush(subsurface->parent->display);
185} 190}
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c
index a765d14f87..71d3478e2b 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -414,6 +414,7 @@ _ecore_wl2_window_shell_surface_init(Ecore_Wl2_Window *window)
414 } 414 }
415 else 415 else
416 zwp_e_session_recovery_get_uuid(window->display->wl.session_recovery, window->surface); 416 zwp_e_session_recovery_get_uuid(window->display->wl.session_recovery, window->surface);
417 ecore_wl2_display_flush(window->display);
417 } 418 }
418} 419}
419 420
@@ -561,6 +562,7 @@ ecore_wl2_window_show(Ecore_Wl2_Window *window)
561 } 562 }
562 else 563 else
563 _configure_complete(window); 564 _configure_complete(window);
565 ecore_wl2_display_flush(window->display);
564} 566}
565 567
566EAPI void 568EAPI void
@@ -668,6 +670,7 @@ ecore_wl2_window_move(Ecore_Wl2_Window *window, Ecore_Wl2_Input *input)
668 if (window->zxdg_toplevel) 670 if (window->zxdg_toplevel)
669 zxdg_toplevel_v6_move(window->zxdg_toplevel, input->wl.seat, 671 zxdg_toplevel_v6_move(window->zxdg_toplevel, input->wl.seat,
670 window->display->serial); 672 window->display->serial);
673 ecore_wl2_display_flush(window->display);
671} 674}
672 675
673EAPI void 676EAPI void
@@ -685,6 +688,7 @@ ecore_wl2_window_resize(Ecore_Wl2_Window *window, Ecore_Wl2_Input *input, int lo
685 if (window->zxdg_toplevel) 688 if (window->zxdg_toplevel)
686 zxdg_toplevel_v6_resize(window->zxdg_toplevel, input->wl.seat, 689 zxdg_toplevel_v6_resize(window->zxdg_toplevel, input->wl.seat,
687 window->display->serial, location); 690 window->display->serial, location);
691 ecore_wl2_display_flush(window->display);
688} 692}
689 693
690EAPI void 694EAPI void
@@ -704,6 +708,7 @@ ecore_wl2_window_raise(Ecore_Wl2_Window *window)
704 window->set_config.geometry.w, 708 window->set_config.geometry.w,
705 window->set_config.geometry.h, &states); 709 window->set_config.geometry.h, &states);
706 wl_array_release(&states); 710 wl_array_release(&states);
711 ecore_wl2_display_flush(window->display);
707 } 712 }
708} 713}
709 714
@@ -730,6 +735,7 @@ ecore_wl2_window_alpha_set(Ecore_Wl2_Window *window, Eina_Bool alpha)
730 window->opaque.h); 735 window->opaque.h);
731 else 736 else
732 ecore_wl2_window_opaque_region_set(window, 0, 0, 0, 0); 737 ecore_wl2_window_opaque_region_set(window, 0, 0, 0, 0);
738 ecore_wl2_display_flush(window->display);
733} 739}
734 740
735EAPI void 741EAPI void
@@ -747,6 +753,7 @@ ecore_wl2_window_transparent_set(Ecore_Wl2_Window *window, Eina_Bool transparent
747 window->opaque.h); 753 window->opaque.h);
748 else 754 else
749 ecore_wl2_window_opaque_region_set(window, 0, 0, 0, 0); 755 ecore_wl2_window_opaque_region_set(window, 0, 0, 0, 0);
756 ecore_wl2_display_flush(window->display);
750} 757}
751 758
752EAPI void 759EAPI void
@@ -967,6 +974,7 @@ ecore_wl2_window_title_set(Ecore_Wl2_Window *window, const char *title)
967 xdg_toplevel_set_title(window->xdg_toplevel, window->title); 974 xdg_toplevel_set_title(window->xdg_toplevel, window->title);
968 if (window->zxdg_toplevel) 975 if (window->zxdg_toplevel)
969 zxdg_toplevel_v6_set_title(window->zxdg_toplevel, window->title); 976 zxdg_toplevel_v6_set_title(window->zxdg_toplevel, window->title);
977 ecore_wl2_display_flush(window->display);
970} 978}
971 979
972EAPI void 980EAPI void
@@ -981,6 +989,7 @@ ecore_wl2_window_class_set(Ecore_Wl2_Window *window, const char *clas)
981 xdg_toplevel_set_app_id(window->xdg_toplevel, window->class); 989 xdg_toplevel_set_app_id(window->xdg_toplevel, window->class);
982 if (window->zxdg_toplevel) 990 if (window->zxdg_toplevel)
983 zxdg_toplevel_v6_set_app_id(window->zxdg_toplevel, window->class); 991 zxdg_toplevel_v6_set_app_id(window->zxdg_toplevel, window->class);
992 ecore_wl2_display_flush(window->display);
984} 993}
985 994
986EAPI void 995EAPI void
@@ -1069,6 +1078,7 @@ ecore_wl2_window_iconified_set(Ecore_Wl2_Window *window, Eina_Bool iconified)
1069 wl_array_release(&states); 1078 wl_array_release(&states);
1070 } 1079 }
1071 } 1080 }
1081 ecore_wl2_display_flush(window->display);
1072} 1082}
1073 1083
1074EAPI void 1084EAPI void
@@ -1159,6 +1169,7 @@ ecore_wl2_window_buffer_transform_set(Ecore_Wl2_Window *window, int transform)
1159 EINA_SAFETY_ON_NULL_RETURN(window); 1169 EINA_SAFETY_ON_NULL_RETURN(window);
1160 1170
1161 wl_surface_set_buffer_transform(window->surface, transform); 1171 wl_surface_set_buffer_transform(window->surface, transform);
1172 ecore_wl2_display_flush(window->display);
1162} 1173}
1163 1174
1164EAPI void 1175EAPI void
@@ -1341,6 +1352,7 @@ ecore_wl2_window_aux_hint_add(Ecore_Wl2_Window *win, int id, const char *hint, c
1341 if (!win) return; 1352 if (!win) return;
1342 if ((win->surface) && (win->display->wl.efl_aux_hints)) 1353 if ((win->surface) && (win->display->wl.efl_aux_hints))
1343 efl_aux_hints_add_aux_hint(win->display->wl.efl_aux_hints, win->surface, id, hint, val); 1354 efl_aux_hints_add_aux_hint(win->display->wl.efl_aux_hints, win->surface, id, hint, val);
1355 ecore_wl2_display_flush(win->display);
1344} 1356}
1345 1357
1346EAPI void 1358EAPI void
@@ -1349,6 +1361,7 @@ ecore_wl2_window_aux_hint_change(Ecore_Wl2_Window *win, int id, const char *val)
1349 if (!win) return; 1361 if (!win) return;
1350 if ((win->surface) && (win->display->wl.efl_aux_hints)) 1362 if ((win->surface) && (win->display->wl.efl_aux_hints))
1351 efl_aux_hints_change_aux_hint(win->display->wl.efl_aux_hints, win->surface, id, val); 1363 efl_aux_hints_change_aux_hint(win->display->wl.efl_aux_hints, win->surface, id, val);
1364 ecore_wl2_display_flush(win->display);
1352} 1365}
1353 1366
1354EAPI void 1367EAPI void
@@ -1357,6 +1370,7 @@ ecore_wl2_window_aux_hint_del(Ecore_Wl2_Window *win, int id)
1357 if (!win) return; 1370 if (!win) return;
1358 if ((win->surface) && (win->display->wl.efl_aux_hints)) 1371 if ((win->surface) && (win->display->wl.efl_aux_hints))
1359 efl_aux_hints_del_aux_hint(win->display->wl.efl_aux_hints, win->surface, id); 1372 efl_aux_hints_del_aux_hint(win->display->wl.efl_aux_hints, win->surface, id);
1373 ecore_wl2_display_flush(win->display);
1360} 1374}
1361 1375
1362EAPI void 1376EAPI void
@@ -1413,6 +1427,7 @@ ecore_wl2_window_aspect_set(Ecore_Wl2_Window *window, int w, int h, unsigned int
1413 if (window->xdg_surface) 1427 if (window->xdg_surface)
1414 efl_hints_set_aspect(window->display->wl.efl_hints, 1428 efl_hints_set_aspect(window->display->wl.efl_hints,
1415 window->xdg_surface, w, h, aspect); 1429 window->xdg_surface, w, h, aspect);
1430 ecore_wl2_display_flush(window->display);
1416} 1431}
1417 1432
1418EAPI void 1433EAPI void
@@ -1434,6 +1449,7 @@ ecore_wl2_window_weight_set(Ecore_Wl2_Window *window, double w, double h)
1434 if (window->xdg_surface) 1449 if (window->xdg_surface)
1435 efl_hints_set_weight(window->display->wl.efl_hints, 1450 efl_hints_set_weight(window->display->wl.efl_hints,
1436 window->xdg_surface, ww, hh); 1451 window->xdg_surface, ww, hh);
1452 ecore_wl2_display_flush(window->display);
1437} 1453}
1438 1454
1439static void 1455static void
@@ -1476,6 +1492,7 @@ _maximized_set(Ecore_Wl2_Window *window)
1476 if (window->zxdg_toplevel) 1492 if (window->zxdg_toplevel)
1477 zxdg_toplevel_v6_unset_maximized(window->zxdg_toplevel); 1493 zxdg_toplevel_v6_unset_maximized(window->zxdg_toplevel);
1478 } 1494 }
1495 ecore_wl2_display_flush(window->display);
1479} 1496}
1480 1497
1481static void 1498static void
@@ -1498,6 +1515,7 @@ _fullscreen_set(Ecore_Wl2_Window *window)
1498 if (window->zxdg_toplevel) 1515 if (window->zxdg_toplevel)
1499 zxdg_toplevel_v6_unset_fullscreen(window->zxdg_toplevel); 1516 zxdg_toplevel_v6_unset_fullscreen(window->zxdg_toplevel);
1500 } 1517 }
1518 ecore_wl2_display_flush(window->display);
1501} 1519}
1502 1520
1503static void 1521static void
@@ -1524,6 +1542,7 @@ _input_set(Ecore_Wl2_Window *window)
1524 window->input_rect.w, window->input_rect.h); 1542 window->input_rect.w, window->input_rect.h);
1525 wl_surface_set_input_region(window->surface, region); 1543 wl_surface_set_input_region(window->surface, region);
1526 wl_region_destroy(region); 1544 wl_region_destroy(region);
1545 ecore_wl2_display_flush(window->display);
1527} 1546}
1528 1547
1529static void 1548static void
@@ -1548,6 +1567,7 @@ _opaque_set(Ecore_Wl2_Window *window)
1548 window->opaque.w, window->opaque.h); 1567 window->opaque.w, window->opaque.h);
1549 wl_surface_set_opaque_region(window->surface, region); 1568 wl_surface_set_opaque_region(window->surface, region);
1550 wl_region_destroy(region); 1569 wl_region_destroy(region);
1570 ecore_wl2_display_flush(window->display);
1551} 1571}
1552 1572
1553EAPI void 1573EAPI void
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 5c3696cca6..67bdafeb23 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -4172,7 +4172,9 @@ _elm_win_frame_cb_menu(void *data,
4172 4172
4173 { 4173 {
4174 Eina_Iterator *it; 4174 Eina_Iterator *it;
4175 it = ecore_wl2_display_inputs_get(ecore_wl2_window_display_get(sd->wl.win)); 4175 Ecore_Wl2_Display *display = ecore_wl2_window_display_get(sd->wl.win);
4176 it = ecore_wl2_display_inputs_get(display);
4177 ecore_wl2_display_flush(input->display);
4176 EINA_ITERATOR_FOREACH(it, input) break; 4178 EINA_ITERATOR_FOREACH(it, input) break;
4177 eina_iterator_free(it); 4179 eina_iterator_free(it);
4178 } 4180 }