Move more switcher details to switcher.c

This commit is contained in:
Kristian Høgsberg 2011-04-12 22:23:30 -04:00
parent 30021d7993
commit 547cadf375
3 changed files with 12 additions and 11 deletions

View 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)

View 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);

View File

@ -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;
}
}