Move more switcher details to switcher.c
authorKristian Høgsberg <krh@bitplanet.net>
Wed, 13 Apr 2011 02:23:30 +0000 (22:23 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Wed, 13 Apr 2011 02:23:30 +0000 (22:23 -0400)
compositor/compositor.c
compositor/compositor.h
compositor/switcher.c

index c361be6..ed3069d 100644 (file)
@@ -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)
index e1f4b6f..e48c2b2 100644 (file)
@@ -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);
 
index b389e13..fecd9a2 100644 (file)
 
 #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;
        }
 }