Move more switcher details to switcher.c
This commit is contained in:
@@ -544,8 +544,7 @@ wlsc_output_repaint(struct wlsc_output *output)
|
|||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
|
|
||||||
wl_list_for_each_reverse(es, &ec->surface_list, link) {
|
wl_list_for_each_reverse(es, &ec->surface_list, link) {
|
||||||
if (ec->switcher &&
|
if (ec->overlay == es)
|
||||||
ec->switcher->current == es)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (es->visual == &ec->compositor.rgb_visual) {
|
if (es->visual == &ec->compositor.rgb_visual) {
|
||||||
@@ -560,9 +559,8 @@ wlsc_output_repaint(struct wlsc_output *output)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ec->switcher)
|
if (ec->overlay)
|
||||||
wlsc_surface_draw(ec->switcher->current,
|
wlsc_surface_draw(ec->overlay, output, &total_damage);
|
||||||
output, &total_damage);
|
|
||||||
|
|
||||||
if (ec->focus)
|
if (ec->focus)
|
||||||
wl_list_for_each(eid, &ec->input_device_list, link)
|
wl_list_for_each(eid, &ec->input_device_list, link)
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ struct wlsc_compositor {
|
|||||||
pixman_region32_t damage_region;
|
pixman_region32_t damage_region;
|
||||||
struct wl_array vertices, indices;
|
struct wl_array vertices, indices;
|
||||||
|
|
||||||
|
struct wlsc_surface *overlay;
|
||||||
struct wlsc_switcher *switcher;
|
struct wlsc_switcher *switcher;
|
||||||
uint32_t focus;
|
uint32_t focus;
|
||||||
|
|
||||||
@@ -254,12 +255,6 @@ wlsc_shm_init(struct wlsc_compositor *ec);
|
|||||||
int
|
int
|
||||||
wlsc_shell_init(struct wlsc_compositor *ec);
|
wlsc_shell_init(struct wlsc_compositor *ec);
|
||||||
|
|
||||||
struct wlsc_switcher {
|
|
||||||
struct wlsc_compositor *compositor;
|
|
||||||
struct wlsc_surface *current;
|
|
||||||
struct wl_listener listener;
|
|
||||||
};
|
|
||||||
|
|
||||||
void
|
void
|
||||||
wlsc_switcher_init(struct wlsc_compositor *compositor);
|
wlsc_switcher_init(struct wlsc_compositor *compositor);
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,12 @@
|
|||||||
|
|
||||||
#include "compositor.h"
|
#include "compositor.h"
|
||||||
|
|
||||||
|
struct wlsc_switcher {
|
||||||
|
struct wlsc_compositor *compositor;
|
||||||
|
struct wlsc_surface *current;
|
||||||
|
struct wl_listener listener;
|
||||||
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
wlsc_switcher_next(struct wlsc_switcher *switcher)
|
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_remove(&switcher->listener.link);
|
||||||
wl_list_insert(switcher->current->surface.destroy_listener_list.prev,
|
wl_list_insert(switcher->current->surface.destroy_listener_list.prev,
|
||||||
&switcher->listener.link);
|
&switcher->listener.link);
|
||||||
|
switcher->compositor->overlay = switcher->current;
|
||||||
wlsc_surface_damage(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_surface_activate(compositor->switcher->current, wd, time);
|
||||||
wlsc_switcher_destroy(compositor->switcher);
|
wlsc_switcher_destroy(compositor->switcher);
|
||||||
compositor->switcher = NULL;
|
compositor->switcher = NULL;
|
||||||
|
compositor->overlay = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user