Merge branch 'master' into next

next
Michael Stapelberg 2015-02-11 21:08:00 +01:00
commit db62b5a4df
2 changed files with 42 additions and 42 deletions

View File

@ -520,33 +520,35 @@ void child_click_events_key(const char *key) {
*
*/
void send_block_clicked(int button, const char *name, const char *instance, int x, int y) {
if (child.click_events) {
child_click_events_initialize();
yajl_gen_map_open(gen);
if (name) {
child_click_events_key("name");
yajl_gen_string(gen, (const unsigned char *)name, strlen(name));
}
if (instance) {
child_click_events_key("instance");
yajl_gen_string(gen, (const unsigned char *)instance, strlen(instance));
}
child_click_events_key("button");
yajl_gen_integer(gen, button);
child_click_events_key("x");
yajl_gen_integer(gen, x);
child_click_events_key("y");
yajl_gen_integer(gen, y);
yajl_gen_map_close(gen);
child_write_output();
if (!child.click_events) {
return;
}
child_click_events_initialize();
yajl_gen_map_open(gen);
if (name) {
child_click_events_key("name");
yajl_gen_string(gen, (const unsigned char *)name, strlen(name));
}
if (instance) {
child_click_events_key("instance");
yajl_gen_string(gen, (const unsigned char *)instance, strlen(instance));
}
child_click_events_key("button");
yajl_gen_integer(gen, button);
child_click_events_key("x");
yajl_gen_integer(gen, x);
child_click_events_key("y");
yajl_gen_integer(gen, y);
yajl_gen_map_close(gen);
child_write_output();
}
/*

View File

@ -339,18 +339,6 @@ void handle_button(xcb_button_press_event_t *event) {
return;
}
/* TODO: Move this to extern get_ws_for_output() */
TAILQ_FOREACH(cur_ws, walk->workspaces, tailq) {
if (cur_ws->visible) {
break;
}
}
if (cur_ws == NULL) {
DLOG("No Workspace active?\n");
return;
}
int32_t x = event->event_x >= 0 ? event->event_x : 0;
int32_t original_x = x;
@ -398,6 +386,18 @@ void handle_button(xcb_button_press_event_t *event) {
x = original_x;
}
/* TODO: Move this to extern get_ws_for_output() */
TAILQ_FOREACH (cur_ws, walk->workspaces, tailq) {
if (cur_ws->visible) {
break;
}
}
if (cur_ws == NULL) {
DLOG("No Workspace active?\n");
return;
}
switch (event->detail) {
case 4:
/* Mouse wheel up. We select the previous ws, if any.
@ -1512,16 +1512,14 @@ void reconfig_windows(bool redraw_bars) {
* BUTTON_PRESS, to handle clicks on the workspace buttons
* */
values[2] = XCB_EVENT_MASK_EXPOSURE |
XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT;
XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT |
XCB_EVENT_MASK_BUTTON_PRESS;
if (config.hide_on_modifier == M_DOCK) {
/* If the bar is normally visible, catch visibility change events to suspend
* the status process when the bar is obscured by full-screened windows. */
values[2] |= XCB_EVENT_MASK_VISIBILITY_CHANGE;
walk->visible = true;
}
if (!config.disable_ws) {
values[2] |= XCB_EVENT_MASK_BUTTON_PRESS;
}
xcb_void_cookie_t win_cookie = xcb_create_window_checked(xcb_connection,
root_screen->root_depth,
walk->bar,