clang-format: bring back ForeachMacros (#3948)
* clang-format: bring back ForeachMacros
ForeachMacros was disabled in 4211274fcd
due to the breakage of include/queue.h. The currently used version,
clang-format-6.0 doesn't break it.
* Add curly braces
Co-authored-by: Orestis Floros <orestisflo@gmail.com>
This commit is contained in:
16
src/ewmh.c
16
src/ewmh.c
@ -11,10 +11,10 @@
|
||||
|
||||
xcb_window_t ewmh_window;
|
||||
|
||||
#define FOREACH_NONINTERNAL \
|
||||
TAILQ_FOREACH(output, &(croot->nodes_head), nodes) \
|
||||
TAILQ_FOREACH(ws, &(output_get_content(output)->nodes_head), nodes) \
|
||||
if (!con_is_internal(ws))
|
||||
#define FOREACH_NONINTERNAL \
|
||||
TAILQ_FOREACH (output, &(croot->nodes_head), nodes) \
|
||||
TAILQ_FOREACH (ws, &(output_get_content(output)->nodes_head), nodes) \
|
||||
if (!con_is_internal(ws))
|
||||
|
||||
/*
|
||||
* Updates _NET_CURRENT_DESKTOP with the current desktop number.
|
||||
@ -125,13 +125,13 @@ static void ewmh_update_wm_desktop_recursively(Con *con, const uint32_t desktop)
|
||||
Con *child;
|
||||
|
||||
/* Recursively call this to descend through the entire subtree. */
|
||||
TAILQ_FOREACH(child, &(con->nodes_head), nodes) {
|
||||
TAILQ_FOREACH (child, &(con->nodes_head), nodes) {
|
||||
ewmh_update_wm_desktop_recursively(child, desktop);
|
||||
}
|
||||
|
||||
/* If con is a workspace, we also need to go through the floating windows on it. */
|
||||
if (con->type == CT_WORKSPACE) {
|
||||
TAILQ_FOREACH(child, &(con->floating_head), floating_windows) {
|
||||
TAILQ_FOREACH (child, &(con->floating_head), floating_windows) {
|
||||
ewmh_update_wm_desktop_recursively(child, desktop);
|
||||
}
|
||||
}
|
||||
@ -183,9 +183,9 @@ void ewmh_update_wm_desktop(void) {
|
||||
uint32_t desktop = 0;
|
||||
|
||||
Con *output;
|
||||
TAILQ_FOREACH(output, &(croot->nodes_head), nodes) {
|
||||
TAILQ_FOREACH (output, &(croot->nodes_head), nodes) {
|
||||
Con *workspace;
|
||||
TAILQ_FOREACH(workspace, &(output_get_content(output)->nodes_head), nodes) {
|
||||
TAILQ_FOREACH (workspace, &(output_get_content(output)->nodes_head), nodes) {
|
||||
ewmh_update_wm_desktop_recursively(workspace, desktop);
|
||||
|
||||
if (!con_is_internal(workspace)) {
|
||||
|
Reference in New Issue
Block a user