Skip to content

Commit

Permalink
#487 cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
koekeishiya committed Apr 25, 2020
1 parent cad6590 commit 3b75fa9
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
9 changes: 4 additions & 5 deletions src/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ extern struct space_manager g_space_manager;
extern struct window_manager g_window_manager;
extern struct mouse_state g_mouse_state;
extern bool g_mission_control_active;
extern uint32_t *g_insert_feedback_windows;
extern int g_connection;

static void event_signal_populate_args(void *context, enum event_type type, struct signal_args *args)
Expand Down Expand Up @@ -1217,8 +1216,8 @@ static EVENT_CALLBACK(EVENT_HANDLER_MISSION_CONTROL_ENTER)
debug("%s:\n", __FUNCTION__);
g_mission_control_active = true;

for (int i = 0; i < buf_len(g_insert_feedback_windows); ++i) {
uint32_t feedback_wid = g_insert_feedback_windows[i];
for (int i = 0; i < buf_len(g_window_manager.insert_feedback_windows); ++i) {
uint32_t feedback_wid = g_window_manager.insert_feedback_windows[i];
SLSOrderWindow(g_connection, feedback_wid, 0, 0);
}

Expand Down Expand Up @@ -1281,8 +1280,8 @@ static EVENT_CALLBACK(EVENT_HANDLER_MISSION_CONTROL_EXIT)
debug("%s:\n", __FUNCTION__);
g_mission_control_active = false;

for (int i = 0; i < buf_len(g_insert_feedback_windows); ++i) {
uint32_t feedback_wid = g_insert_feedback_windows[i];
for (int i = 0; i < buf_len(g_window_manager.insert_feedback_windows); ++i) {
uint32_t feedback_wid = g_window_manager.insert_feedback_windows[i];
SLSOrderWindow(g_connection, feedback_wid, 1, 0);
}

Expand Down
9 changes: 4 additions & 5 deletions src/view.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ extern int g_connection;
extern struct display_manager g_display_manager;
extern struct space_manager g_space_manager;
extern struct window_manager g_window_manager;
extern uint32_t *g_insert_feedback_windows;

void insert_feedback_show(struct window_node *node)
{
Expand All @@ -25,7 +24,7 @@ void insert_feedback_show(struct window_node *node)
g_window_manager.insert_feedback_color.g,
g_window_manager.insert_feedback_color.b,
g_window_manager.insert_feedback_color.a);
buf_push(g_insert_feedback_windows, node->feedback_window.id);
buf_push(g_window_manager.insert_feedback_windows, node->feedback_window.id);
}

frame.origin.x = 0; frame.origin.y = 0;
Expand Down Expand Up @@ -80,9 +79,9 @@ void insert_feedback_show(struct window_node *node)
void insert_feedback_destroy(struct window_node *node)
{
if (node->feedback_window.id) {
for (int i = 0; i < buf_len(g_insert_feedback_windows); ++i) {
if (g_insert_feedback_windows[i] == node->feedback_window.id) {
buf_del(g_insert_feedback_windows, i);
for (int i = 0; i < buf_len(g_window_manager.insert_feedback_windows); ++i) {
if (g_window_manager.insert_feedback_windows[i] == node->feedback_window.id) {
buf_del(g_window_manager.insert_feedback_windows, i);
break;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/window_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -1502,6 +1502,7 @@ void window_manager_init(struct window_manager *wm)
wm->active_window_opacity = 1.0f;
wm->normal_window_opacity = 1.0f;
wm->window_opacity_duration = 0.2f;
wm->insert_feedback_windows = NULL;
wm->insert_feedback_color = rgba_color_from_hex(0xaad75f5f);

table_init(&wm->application, 150, hash_wm, compare_wm);
Expand Down
1 change: 1 addition & 0 deletions src/window_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ struct window_manager
float active_window_opacity;
float normal_window_opacity;
float window_opacity_duration;
uint32_t *insert_feedback_windows;
struct rgba_color insert_feedback_color;
};

Expand Down
1 change: 0 additions & 1 deletion src/yabai.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ struct window_manager g_window_manager;
struct mouse_state g_mouse_state;
struct event_tap g_event_tap;
struct daemon g_daemon;
uint32_t *g_insert_feedback_windows;
int g_connection;

struct signal *g_signal_event[EVENT_TYPE_COUNT];
Expand Down

0 comments on commit 3b75fa9

Please sign in to comment.