Support moving dock clients to another output.
i3String *i3string_escape_markup(i3String *str) {
#if PANGO_SUPPORT
const char *text = i3string_as_utf8(str);
- return i3string_from_utf8(g_markup_escape_text(text, -1));
+ char *escaped = g_markup_escape_text(text, -1);
+ i3String *result = i3string_from_utf8(escaped);
+ free(escaped);
+ return result;
#else
return str;
#endif
new_binding->command = sstrdup(command);
new_binding->event_state_mask = event_state_from_str(modifiers);
int group_bits_set = 0;
- if (new_binding->event_state_mask & I3_XKB_GROUP_MASK_1)
+ if ((new_binding->event_state_mask >> 16) & I3_XKB_GROUP_MASK_1)
group_bits_set++;
- if (new_binding->event_state_mask & I3_XKB_GROUP_MASK_2)
+ if ((new_binding->event_state_mask >> 16) & I3_XKB_GROUP_MASK_2)
group_bits_set++;
- if (new_binding->event_state_mask & I3_XKB_GROUP_MASK_3)
+ if ((new_binding->event_state_mask >> 16) & I3_XKB_GROUP_MASK_3)
group_bits_set++;
- if (new_binding->event_state_mask & I3_XKB_GROUP_MASK_4)
+ if ((new_binding->event_state_mask >> 16) & I3_XKB_GROUP_MASK_4)
group_bits_set++;
if (group_bits_set > 1)
ELOG("Keybinding has more than one Group specified, but your X server is always in precisely one group. The keybinding can never trigger.\n");
int border_style = con_border_style(con);
if (border_style == BS_NONE)
return (Rect){0, 0, 0, 0};
- borders_to_hide = con_adjacent_borders(con) & config.hide_edge_borders;
if (border_style == BS_NORMAL) {
result = (Rect){border_width, 0, -(2 * border_width), -(border_width)};
} else {
result = (Rect){border_width, border_width, -(2 * border_width), -(2 * border_width)};
}
- /* Floating windows are never adjacent to any other window, so
- don’t hide their border(s). This prevents bug #998. */
- if (con_is_floating(con))
- return result;
-
+ borders_to_hide = con_adjacent_borders(con) & config.hide_edge_borders;
if (borders_to_hide & ADJ_LEFT_SCREEN_EDGE) {
result.x -= border_width;
result.width += border_width;
*/
adjacent_t con_adjacent_borders(Con *con) {
adjacent_t result = ADJ_NONE;
+ /* Floating windows are never adjacent to any other window, so
+ don’t hide their border(s). This prevents bug #998. */
+ if (con_is_floating(con))
+ return result;
+
Con *workspace = con_get_workspace(con);
if (con->rect.x == workspace->rect.x)
result |= ADJ_LEFT_SCREEN_EDGE;
for (char *walk = format; *walk != '\0'; walk++) {
if (STARTS_WITH(walk, "%title")) {
if (escaped_title == NULL)
- escaped_title = i3string_as_utf8(is_markup ? i3string_escape_markup(win->name) : win->name);
+ escaped_title = win->name == NULL ? "" : i3string_as_utf8(is_markup ? i3string_escape_markup(win->name) : win->name);
buffer_len = buffer_len - strlen("%title") + strlen(escaped_title);
walk += strlen("%title") - 1;
} else if (STARTS_WITH(walk + 1, "instance")) {
outwalk += sprintf(outwalk, "%s", escaped_instance);
walk += strlen("instance");
+ } else {
+ *(outwalk++) = *walk;
}
}
*outwalk = '\0';