summaryrefslogtreecommitdiff
path: root/clients
diff options
context:
space:
mode:
authorPekka Paalanen <ppaalanen@gmail.com>2013-04-25 13:57:52 +0300
committerKristian Høgsberg <krh@bitplanet.net>2013-05-10 14:35:54 -0400
commiteebff54c03ad1f93156e05070fb54e9c9bf06635 (patch)
tree72eb258a7a5f8e033d1dbd677a5d08fcfa190f34 /clients
parente9297f8e7ee09fa39b1d4293fad6e97705ccff21 (diff)
window: throttle resizing to the main surface
In case a toytoolkit application manages to schedule resizes constantly, throttle them to the main surface display. When resizing, all surfaces are updated synchronously, so it also makes sense to synchronize on the main surface's frame callback particularly. Rendering any faster will not make sense. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Diffstat (limited to 'clients')
-rw-r--r--clients/window.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/clients/window.c b/clients/window.c
index ab9a36e..b72c2ca 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -3561,16 +3561,21 @@ idle_redraw(struct task *task, uint32_t events)
struct window *window = container_of(task, struct window, redraw_task);
struct surface *surface;
- if (window->resize_needed)
+ wl_list_init(&window->redraw_task.link);
+ window->redraw_task_scheduled = 0;
+
+ if (window->resize_needed) {
+ /* throttle resizing to the main surface display */
+ if (window->main_surface->frame_cb)
+ return;
+
idle_resize(window);
+ }
wl_list_for_each(surface, &window->subsurface_list, link)
surface_redraw(surface);
window->redraw_needed = 0;
- wl_list_init(&window->redraw_task.link);
- window->redraw_task_scheduled = 0;
-
window_flush(window);
wl_list_for_each(surface, &window->subsurface_list, link)