[PATCH] alt-tab: highlight the currently selected view

pochu27 at gmail.com pochu27 at gmail.com
Thu Jan 9 01:25:59 PST 2014


From: Emilio Pozuelo Monfort <emilio.pozuelo at collabora.co.uk>

---
 desktop-shell/shell.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 13a42e1..3cb82a1 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -3987,12 +3987,23 @@ struct alt_tab_preview {
 static void
 alt_tab_next(struct alt_tab *alt_tab)
 {
+	struct alt_tab_preview *preview, *current;
+
 	alt_tab->current = alt_tab->current->next;
 
 	/* Make sure we're not pointing to the list header e.g. after
 	 * cycling through the whole list. */
 	if (alt_tab->current->next == alt_tab->preview_list.next)
 		alt_tab->current = alt_tab->current->next;
+
+	current = wl_container_of(alt_tab->current, current, link);
+
+	/* Highlight the currently selected view */
+	wl_list_for_each(preview, &alt_tab->preview_list, link) {
+		preview->view->alpha = (current == preview) ? 1.0 : 0.25;
+		weston_view_geometry_dirty(preview->view);
+		weston_surface_damage(preview->view->surface);
+	}
 }
 
 static void
-- 
1.8.5.2



More information about the wayland-devel mailing list