From 547cadf3758bcf24f824ac41bc6e41f939a53295 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Tue, 12 Apr 2011 22:23:30 -0400 Subject: [PATCH] Move more switcher details to switcher.c --- compositor/compositor.c | 8 +++----- compositor/compositor.h | 7 +------ compositor/switcher.c | 8 ++++++++ 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/compositor/compositor.c b/compositor/compositor.c index c361be6..ed3069d 100644 --- a/compositor/compositor.c +++ b/compositor/compositor.c @@ -544,8 +544,7 @@ wlsc_output_repaint(struct wlsc_output *output) glClear(GL_COLOR_BUFFER_BIT); wl_list_for_each_reverse(es, &ec->surface_list, link) { - if (ec->switcher && - ec->switcher->current == es) + if (ec->overlay == es) continue; if (es->visual == &ec->compositor.rgb_visual) { @@ -560,9 +559,8 @@ wlsc_output_repaint(struct wlsc_output *output) } } - if (ec->switcher) - wlsc_surface_draw(ec->switcher->current, - output, &total_damage); + if (ec->overlay) + wlsc_surface_draw(ec->overlay, output, &total_damage); if (ec->focus) wl_list_for_each(eid, &ec->input_device_list, link) diff --git a/compositor/compositor.h b/compositor/compositor.h index e1f4b6f..e48c2b2 100644 --- a/compositor/compositor.h +++ b/compositor/compositor.h @@ -112,6 +112,7 @@ struct wlsc_compositor { pixman_region32_t damage_region; struct wl_array vertices, indices; + struct wlsc_surface *overlay; struct wlsc_switcher *switcher; uint32_t focus; @@ -254,12 +255,6 @@ wlsc_shm_init(struct wlsc_compositor *ec); int wlsc_shell_init(struct wlsc_compositor *ec); -struct wlsc_switcher { - struct wlsc_compositor *compositor; - struct wlsc_surface *current; - struct wl_listener listener; -}; - void wlsc_switcher_init(struct wlsc_compositor *compositor); diff --git a/compositor/switcher.c b/compositor/switcher.c index b389e13..fecd9a2 100644 --- a/compositor/switcher.c +++ b/compositor/switcher.c @@ -26,6 +26,12 @@ #include "compositor.h" +struct wlsc_switcher { + struct wlsc_compositor *compositor; + struct wlsc_surface *current; + struct wl_listener listener; +}; + static void wlsc_switcher_next(struct wlsc_switcher *switcher) { @@ -39,6 +45,7 @@ wlsc_switcher_next(struct wlsc_switcher *switcher) wl_list_remove(&switcher->listener.link); wl_list_insert(switcher->current->surface.destroy_listener_list.prev, &switcher->listener.link); + switcher->compositor->overlay = switcher->current; wlsc_surface_damage(switcher->current); } @@ -103,6 +110,7 @@ switcher_terminate_binding(struct wl_input_device *device, wlsc_surface_activate(compositor->switcher->current, wd, time); wlsc_switcher_destroy(compositor->switcher); compositor->switcher = NULL; + compositor->overlay = NULL; } } -- 2.7.4