* outputs.c: Maintaining the outputs list
*
*/
+#include "common.h"
+
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <yajl/yajl_parse.h>
#include <yajl/yajl_version.h>
-#include "common.h"
-
/* A datatype to pass through the callbacks to save the state */
struct outputs_json_params {
struct outputs_head *outputs;
state = yajl_parse(handle, (const unsigned char *)json, strlen(json));
- /* FIXME: Propper errorhandling for JSON-parsing */
+ /* FIXME: Proper errorhandling for JSON-parsing */
switch (state) {
case yajl_status_ok:
break;
return walk;
}
+
+/*
+ * Returns true if the output has the currently focused workspace
+ *
+ */
+bool output_has_focus(i3_output *output) {
+ i3_ws *ws_walk;
+ TAILQ_FOREACH(ws_walk, output->workspaces, tailq) {
+ if (ws_walk->focused) {
+ return true;
+ }
+ }
+ return false;
+}