From cc68614a5c1c83421668556cf732c341c8da83f9 Mon Sep 17 00:00:00 2001 From: Mathieu OTHACEHE Date: Wed, 14 Dec 2016 19:53:59 +0100 Subject: Add a hide_screen_windows function This function is useful to find the windows displayed on a specific screen and hide them. --- src/manage.c | 14 ++++++++++++++ src/manage.h | 1 + 2 files changed, 15 insertions(+) (limited to 'src') diff --git a/src/manage.c b/src/manage.c index 4296480..f2a15f5 100644 --- a/src/manage.c +++ b/src/manage.c @@ -978,3 +978,17 @@ hide_others (rp_window *win) hide_window (cur); } } + +/* Hide any window displayed on the given screen */ +void +hide_screen_windows (rp_screen *s) +{ + rp_frame *cur_frame; + rp_window *cur_win; + + list_for_each_entry (cur_frame, &s->frames, node) + { + cur_win = find_window_number (cur_frame->win_number); + hide_window (cur_win); + } +} diff --git a/src/manage.h b/src/manage.h index e83a5f2..6788485 100644 --- a/src/manage.h +++ b/src/manage.h @@ -55,5 +55,6 @@ void unhide_all_windows (void); void unhide_window_below (rp_window *win); void withdraw_window (rp_window *win); void hide_others (rp_window *win); +void hide_screen_windows (rp_screen *s); #endif /* ! _RATPOISION_MANAGE_H */ -- cgit v1.2.3