summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2018-04-06 12:13:45 -0500
committerDerek Foreman <derekf@osg.samsung.com>2018-04-20 13:00:28 -0500
commit8bd47cf83c88bb5f333cd4c4996a61d76b9b0d1d (patch)
tree2c7f07444a9196aee200367a2280dda1bc8c8447 /src
parent4837f3244307f45a812342e114e2a98bc5436743 (diff)
ecore_wl2: reduce wayland display flushes
Clean up various places where we do flushes that we don't need to because some immediately following action is going to cause a flush. Also fix places where we flush without actually doing anything.
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_display.c3
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_window.c18
2 files changed, 12 insertions, 9 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_display.c b/src/lib/ecore_wl2/ecore_wl2_display.c
index 4ee8cd6d59..a216df108a 100644
--- a/src/lib/ecore_wl2/ecore_wl2_display.c
+++ b/src/lib/ecore_wl2/ecore_wl2_display.c
@@ -359,7 +359,6 @@ _cb_global_add(void *data, struct wl_registry *registry, unsigned int id, const
359 window->xdg_surface, window->weight.w, window->weight.h); 359 window->xdg_surface, window->weight.w, window->weight.h);
360 } 360 }
361 } 361 }
362 ecore_wl2_display_flush(ewd);
363 362
364event: 363event:
365 /* allocate space for event structure */ 364 /* allocate space for event structure */
@@ -663,7 +662,6 @@ _ecore_wl2_shell_bind(Ecore_Wl2_Display *ewd)
663 &_zxdg_shell_listener, ewd); 662 &_zxdg_shell_listener, ewd);
664 ewd->shell_done = EINA_TRUE; 663 ewd->shell_done = EINA_TRUE;
665 } 664 }
666 ecore_wl2_display_flush(ewd);
667} 665}
668 666
669static void 667static void
@@ -681,6 +679,7 @@ _cb_sync_done(void *data, struct wl_callback *cb, uint32_t serial EINA_UNUSED)
681 _ecore_wl2_shell_bind(ewd); 679 _ecore_wl2_shell_bind(ewd);
682 680
683 wl_callback_destroy(cb); 681 wl_callback_destroy(cb);
682 ecore_wl2_display_flush(ewd);
684 683
685 ev = calloc(1, sizeof(Ecore_Wl2_Event_Sync_Done)); 684 ev = calloc(1, sizeof(Ecore_Wl2_Event_Sync_Done));
686 if (!ev) return; 685 if (!ev) return;
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c
index dee8b0a972..7010938c40 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -621,7 +621,6 @@ ecore_wl2_window_show(Ecore_Wl2_Window *window)
621 } 621 }
622 else 622 else
623 _configure_complete(window); 623 _configure_complete(window);
624 ecore_wl2_display_flush(window->display);
625} 624}
626 625
627EAPI void 626EAPI void
@@ -1022,6 +1021,7 @@ ecore_wl2_window_title_set(Ecore_Wl2_Window *window, const char *title)
1022 1021
1023 eina_stringshare_replace(&window->title, title); 1022 eina_stringshare_replace(&window->title, title);
1024 if (!window->title) return; 1023 if (!window->title) return;
1024 if (!window->xdg_toplevel && !window->xdg_toplevel) return;
1025 1025
1026 if (window->xdg_toplevel) 1026 if (window->xdg_toplevel)
1027 xdg_toplevel_set_title(window->xdg_toplevel, window->title); 1027 xdg_toplevel_set_title(window->xdg_toplevel, window->title);
@@ -1037,6 +1037,7 @@ ecore_wl2_window_class_set(Ecore_Wl2_Window *window, const char *clas)
1037 1037
1038 eina_stringshare_replace(&window->class, clas); 1038 eina_stringshare_replace(&window->class, clas);
1039 if (!window->class) return; 1039 if (!window->class) return;
1040 if (!window->xdg_toplevel && !window->xdg_toplevel) return;
1040 1041
1041 if (window->xdg_toplevel) 1042 if (window->xdg_toplevel)
1042 xdg_toplevel_set_app_id(window->xdg_toplevel, window->class); 1043 xdg_toplevel_set_app_id(window->xdg_toplevel, window->class);
@@ -1361,8 +1362,9 @@ EAPI void
1361ecore_wl2_window_aux_hint_add(Ecore_Wl2_Window *win, int id, const char *hint, const char *val) 1362ecore_wl2_window_aux_hint_add(Ecore_Wl2_Window *win, int id, const char *hint, const char *val)
1362{ 1363{
1363 if (!win) return; 1364 if (!win) return;
1364 if ((win->surface) && (win->display->wl.efl_aux_hints)) 1365 if ((!win->surface) || (!win->display->wl.efl_aux_hints)) return;
1365 efl_aux_hints_add_aux_hint(win->display->wl.efl_aux_hints, win->surface, id, hint, val); 1366
1367 efl_aux_hints_add_aux_hint(win->display->wl.efl_aux_hints, win->surface, id, hint, val);
1366 ecore_wl2_display_flush(win->display); 1368 ecore_wl2_display_flush(win->display);
1367} 1369}
1368 1370
@@ -1370,8 +1372,9 @@ EAPI void
1370ecore_wl2_window_aux_hint_change(Ecore_Wl2_Window *win, int id, const char *val) 1372ecore_wl2_window_aux_hint_change(Ecore_Wl2_Window *win, int id, const char *val)
1371{ 1373{
1372 if (!win) return; 1374 if (!win) return;
1373 if ((win->surface) && (win->display->wl.efl_aux_hints)) 1375 if ((!win->surface) && (!win->display->wl.efl_aux_hints)) return;
1374 efl_aux_hints_change_aux_hint(win->display->wl.efl_aux_hints, win->surface, id, val); 1376
1377 efl_aux_hints_change_aux_hint(win->display->wl.efl_aux_hints, win->surface, id, val);
1375 ecore_wl2_display_flush(win->display); 1378 ecore_wl2_display_flush(win->display);
1376} 1379}
1377 1380
@@ -1379,8 +1382,9 @@ EAPI void
1379ecore_wl2_window_aux_hint_del(Ecore_Wl2_Window *win, int id) 1382ecore_wl2_window_aux_hint_del(Ecore_Wl2_Window *win, int id)
1380{ 1383{
1381 if (!win) return; 1384 if (!win) return;
1382 if ((win->surface) && (win->display->wl.efl_aux_hints)) 1385 if ((!win->surface) || (!win->display->wl.efl_aux_hints)) return;
1383 efl_aux_hints_del_aux_hint(win->display->wl.efl_aux_hints, win->surface, id); 1386
1387 efl_aux_hints_del_aux_hint(win->display->wl.efl_aux_hints, win->surface, id);
1384 ecore_wl2_display_flush(win->display); 1388 ecore_wl2_display_flush(win->display);
1385} 1389}
1386 1390