[CppCheck] Fix some shadowing variables.

This commit is contained in:
Dave Davenport 2021-08-21 01:08:40 +02:00
parent ff924ca01c
commit c64565e877
7 changed files with 119 additions and 108 deletions

View file

@ -353,14 +353,14 @@ static void exec_cmd_entry(DRunModeEntry *e, const char *path) {
if (e->key_file == NULL) { if (e->key_file == NULL) {
GKeyFile *kf = g_key_file_new(); GKeyFile *kf = g_key_file_new();
GError *error = NULL; GError *key_error = NULL;
gboolean res = g_key_file_load_from_file(kf, e->path, 0, &error); gboolean res = g_key_file_load_from_file(kf, e->path, 0, &key_error);
if (res) { if (res) {
e->key_file = kf; e->key_file = kf;
} else { } else {
g_warning("[%s] [%s] Failed to parse desktop file because: %s.", g_warning("[%s] [%s] Failed to parse desktop file because: %s.",
e->app_id, e->path, error->message); e->app_id, e->path, key_error->message);
g_error_free(error); g_error_free(key_error);
g_key_file_free(kf); g_key_file_free(kf);
return; return;
@ -395,10 +395,10 @@ static void exec_cmd_entry(DRunModeEntry *e, const char *path) {
gboolean terminal = gboolean terminal =
g_key_file_get_boolean(e->key_file, e->action, "Terminal", NULL); g_key_file_get_boolean(e->key_file, e->action, "Terminal", NULL);
if (helper_execute_command(exec_path, fp, terminal, sn ? &context : NULL)) { if (helper_execute_command(exec_path, fp, terminal, sn ? &context : NULL)) {
char *path = g_build_filename(cache_dir, DRUN_CACHE_FILE, NULL); char *drun_cach_path = g_build_filename(cache_dir, DRUN_CACHE_FILE, NULL);
// Store it based on the unique identifiers (desktop_id). // Store it based on the unique identifiers (desktop_id).
history_set(path, e->desktop_id); history_set(drun_cach_path, e->desktop_id);
g_free(path); g_free(drun_cach_path);
} }
g_free(wmclass); g_free(wmclass);
g_free(exec_path); g_free(exec_path);

View file

@ -296,9 +296,9 @@ static RunEntry *get_apps(unsigned int *length) {
continue; continue;
} }
if (is_homedir) { if (is_homedir) {
gchar *fpath = g_build_filename(dirname, dent->d_name, NULL); gchar *full_path = g_build_filename(dirname, dent->d_name, NULL);
gboolean b = g_file_test(fpath, G_FILE_TEST_IS_EXECUTABLE); gboolean b = g_file_test(full_path, G_FILE_TEST_IS_EXECUTABLE);
g_free(fpath); g_free(full_path);
if (!b) { if (!b) {
continue; continue;
} }

View file

@ -201,20 +201,20 @@ static SshEntry *read_known_hosts_file(const char *path, SshEntry *retv,
int port = 0; int port = 0;
if (start[0] == '[') { if (start[0] == '[') {
start++; start++;
char *end = strchr(start, ']'); char *strend = strchr(start, ']');
if (end[1] == ':') { if (strend[1] == ':') {
*end = '\0'; *strend = '\0';
errno = 0; errno = 0;
gchar *endptr = NULL; gchar *endptr = NULL;
gint64 number = g_ascii_strtoll(&(end[2]), &endptr, 10); gint64 number = g_ascii_strtoll(&(strend[2]), &endptr, 10);
if (errno != 0) { if (errno != 0) {
g_warning("Failed to parse port number: %s.", &(end[2])); g_warning("Failed to parse port number: %s.", &(strend[2]));
} else if (endptr == &(end[2])) { } else if (endptr == &(strend[2])) {
g_warning("Failed to parse port number: %s, invalid number.", g_warning("Failed to parse port number: %s, invalid number.",
&(end[2])); &(strend[2]));
} else if (number < 0 || number > 65535) { } else if (number < 0 || number > 65535) {
g_warning("Failed to parse port number: %s, out of range.", g_warning("Failed to parse port number: %s, out of range.",
&(end[2])); &(strend[2]));
} else { } else {
port = number; port = number;
} }
@ -499,15 +499,16 @@ static SshEntry *get_ssh(SSHModePrivateData *pd, unsigned int *length) {
parse_ssh_config_file(pd, path, &retv, length, num_favorites); parse_ssh_config_file(pd, path, &retv, length, num_favorites);
if (config.parse_known_hosts == TRUE) { if (config.parse_known_hosts == TRUE) {
char *path = char *known_hosts_path =
g_build_filename(g_get_home_dir(), ".ssh", "known_hosts", NULL); g_build_filename(g_get_home_dir(), ".ssh", "known_hosts", NULL);
retv = read_known_hosts_file(path, retv, length); retv = read_known_hosts_file(known_hosts_path, retv, length);
g_free(path); g_free(known_hosts_path);
for (GList *iter = g_list_first(pd->user_known_hosts); iter; for (GList *iter = g_list_first(pd->user_known_hosts); iter;
iter = g_list_next(iter)) { iter = g_list_next(iter)) {
char *path = rofi_expand_path((const char *)iter->data); char *user_known_hosts_path = rofi_expand_path((const char *)iter->data);
retv = read_known_hosts_file((const char *)path, retv, length); retv = read_known_hosts_file((const char *)user_known_hosts_path, retv,
g_free(path); length);
g_free(user_known_hosts_path);
} }
} }
if (config.parse_hosts == TRUE) { if (config.parse_hosts == TRUE) {

View file

@ -538,90 +538,97 @@ static void _window_mode_load_data(Mode *sw, unsigned int cd) {
// we're working... // we're working...
pd->ids = winlist_new(); pd->ids = winlist_new();
xcb_get_property_cookie_t c = xcb_get_property_cookie_t prop_cookie =
xcb_ewmh_get_desktop_names(&xcb->ewmh, xcb->screen_nbr); xcb_ewmh_get_desktop_names(&xcb->ewmh, xcb->screen_nbr);
xcb_ewmh_get_utf8_strings_reply_t names; xcb_ewmh_get_utf8_strings_reply_t names;
int has_names = FALSE; int has_names = FALSE;
if (xcb_ewmh_get_desktop_names_reply(&xcb->ewmh, c, &names, NULL)) { if (xcb_ewmh_get_desktop_names_reply(&xcb->ewmh, prop_cookie, &names,
NULL)) {
has_names = TRUE; has_names = TRUE;
} }
// calc widths of fields // calc widths of fields
for (i = clients.windows_len - 1; i > -1; i--) { for (i = clients.windows_len - 1; i > -1; i--) {
client *c = window_client(pd, clients.windows[i]); client *winclient = window_client(pd, clients.windows[i]);
if ((c != NULL) && !c->xattr.override_redirect && if ((winclient != NULL) && !winclient->xattr.override_redirect &&
!client_has_window_type(c, xcb->ewmh._NET_WM_WINDOW_TYPE_DOCK) && !client_has_window_type(winclient,
!client_has_window_type(c, xcb->ewmh._NET_WM_WINDOW_TYPE_DESKTOP) && xcb->ewmh._NET_WM_WINDOW_TYPE_DOCK) &&
!client_has_state(c, xcb->ewmh._NET_WM_STATE_SKIP_PAGER) && !client_has_window_type(winclient,
!client_has_state(c, xcb->ewmh._NET_WM_STATE_SKIP_TASKBAR)) { xcb->ewmh._NET_WM_WINDOW_TYPE_DESKTOP) &&
!client_has_state(winclient, xcb->ewmh._NET_WM_STATE_SKIP_PAGER) &&
!client_has_state(winclient, xcb->ewmh._NET_WM_STATE_SKIP_TASKBAR)) {
pd->clf_len = pd->clf_len =
MAX(pd->clf_len, MAX(pd->clf_len, (winclient->class != NULL)
(c->class != NULL) ? (g_utf8_strlen(c->class, -1)) : 0); ? (g_utf8_strlen(winclient->class, -1))
: 0);
if (client_has_state(c, xcb->ewmh._NET_WM_STATE_DEMANDS_ATTENTION)) { if (client_has_state(winclient,
c->demands = TRUE; xcb->ewmh._NET_WM_STATE_DEMANDS_ATTENTION)) {
winclient->demands = TRUE;
} }
if ((c->hint_flags & XCB_ICCCM_WM_HINT_X_URGENCY) != 0) { if ((winclient->hint_flags & XCB_ICCCM_WM_HINT_X_URGENCY) != 0) {
c->demands = TRUE; winclient->demands = TRUE;
} }
if (c->window == curr_win_id) { if (winclient->window == curr_win_id) {
c->active = TRUE; winclient->active = TRUE;
} }
// find client's desktop. // find client's desktop.
xcb_get_property_cookie_t cookie; xcb_get_property_cookie_t cookie;
xcb_get_property_reply_t *r; xcb_get_property_reply_t *r;
c->wmdesktop = 0xFFFFFFFF; winclient->wmdesktop = 0xFFFFFFFF;
cookie = xcb_get_property(xcb->connection, 0, c->window, cookie = xcb_get_property(xcb->connection, 0, winclient->window,
xcb->ewmh._NET_WM_DESKTOP, XCB_ATOM_CARDINAL, xcb->ewmh._NET_WM_DESKTOP, XCB_ATOM_CARDINAL,
0, 1); 0, 1);
r = xcb_get_property_reply(xcb->connection, cookie, NULL); r = xcb_get_property_reply(xcb->connection, cookie, NULL);
if (r) { if (r) {
if (r->type == XCB_ATOM_CARDINAL) { if (r->type == XCB_ATOM_CARDINAL) {
c->wmdesktop = *((uint32_t *)xcb_get_property_value(r)); winclient->wmdesktop = *((uint32_t *)xcb_get_property_value(r));
} }
free(r); free(r);
} }
if (c->wmdesktop != 0xFFFFFFFF) { if (winclient->wmdesktop != 0xFFFFFFFF) {
if (has_names) { if (has_names) {
if ((current_window_manager & WM_PANGO_WORKSPACE_NAMES) == if ((current_window_manager & WM_PANGO_WORKSPACE_NAMES) ==
WM_PANGO_WORKSPACE_NAMES) { WM_PANGO_WORKSPACE_NAMES) {
char *output = NULL; char *output = NULL;
if (pango_parse_markup(_window_name_list_entry(names.strings, if (pango_parse_markup(
names.strings_len, _window_name_list_entry(names.strings, names.strings_len,
c->wmdesktop), winclient->wmdesktop),
-1, 0, NULL, &output, NULL, NULL)) { -1, 0, NULL, &output, NULL, NULL)) {
c->wmdesktopstr = g_strdup(_window_name_list_entry( winclient->wmdesktopstr = g_strdup(_window_name_list_entry(
names.strings, names.strings_len, c->wmdesktop)); names.strings, names.strings_len, winclient->wmdesktop));
c->wmdesktopstr_len = g_utf8_strlen(output, -1); winclient->wmdesktopstr_len = g_utf8_strlen(output, -1);
pd->wmdn_len = MAX(pd->wmdn_len, c->wmdesktopstr_len); pd->wmdn_len = MAX(pd->wmdn_len, winclient->wmdesktopstr_len);
g_free(output); g_free(output);
} else { } else {
c->wmdesktopstr = g_strdup("Invalid name"); winclient->wmdesktopstr = g_strdup("Invalid name");
pd->wmdn_len = pd->wmdn_len = MAX(pd->wmdn_len,
MAX(pd->wmdn_len, g_utf8_strlen(c->wmdesktopstr, -1)); g_utf8_strlen(winclient->wmdesktopstr, -1));
} }
} else { } else {
c->wmdesktopstr = g_markup_escape_text( winclient->wmdesktopstr = g_markup_escape_text(
_window_name_list_entry(names.strings, names.strings_len, _window_name_list_entry(names.strings, names.strings_len,
c->wmdesktop), winclient->wmdesktop),
-1); -1);
pd->wmdn_len = pd->wmdn_len =
MAX(pd->wmdn_len, g_utf8_strlen(c->wmdesktopstr, -1)); MAX(pd->wmdn_len, g_utf8_strlen(winclient->wmdesktopstr, -1));
} }
} else { } else {
c->wmdesktopstr = g_strdup_printf("%u", (uint32_t)c->wmdesktop); winclient->wmdesktopstr =
g_strdup_printf("%u", (uint32_t)winclient->wmdesktop);
pd->wmdn_len = pd->wmdn_len =
MAX(pd->wmdn_len, g_utf8_strlen(c->wmdesktopstr, -1)); MAX(pd->wmdn_len, g_utf8_strlen(winclient->wmdesktopstr, -1));
} }
} else { } else {
c->wmdesktopstr = g_strdup(""); winclient->wmdesktopstr = g_strdup("");
pd->wmdn_len = MAX(pd->wmdn_len, g_utf8_strlen(c->wmdesktopstr, -1)); pd->wmdn_len =
MAX(pd->wmdn_len, g_utf8_strlen(winclient->wmdesktopstr, -1));
} }
if (cd && c->wmdesktop != current_desktop) { if (cd && winclient->wmdesktop != current_desktop) {
continue; continue;
} }
winlist_append(pd->ids, c->window, NULL); winlist_append(pd->ids, winclient->window, NULL);
} }
} }

View file

@ -502,13 +502,13 @@ void rofi_theme_print_index(ThemeWidget *widget, int index) {
} }
if (g_list_length(list) > 0) { if (g_list_length(list) > 0) {
printf("%*s", index, ""); printf("%*s", index, "");
for (GList *iter = g_list_first(list); iter != NULL; for (GList *citer = g_list_first(list); citer != NULL;
iter = g_list_next(iter)) { citer = g_list_next(citer)) {
char *name = (char *)iter->data; char *name = (char *)citer->data;
fputs(name, stdout); fputs(name, stdout);
if (iter->prev == NULL && iter->next) { if (citer->prev == NULL && citer->next) {
putchar(' '); putchar(' ');
} else if (iter->next) { } else if (citer->next) {
putchar('.'); putchar('.');
} }
} }
@ -519,13 +519,13 @@ void rofi_theme_print_index(ThemeWidget *widget, int index) {
size_t property_name_length = 0; size_t property_name_length = 0;
g_hash_table_iter_init(&iter, widget->properties); g_hash_table_iter_init(&iter, widget->properties);
while (g_hash_table_iter_next(&iter, &key, &value)) { while (g_hash_table_iter_next(&iter, &key, &value)) {
Property *p = (Property *)value; Property *pv = (Property *)value;
property_name_length = MAX(strlen(p->name), property_name_length); property_name_length = MAX(strlen(pv->name), property_name_length);
} }
g_hash_table_iter_init(&iter, widget->properties); g_hash_table_iter_init(&iter, widget->properties);
while (g_hash_table_iter_next(&iter, &key, &value)) { while (g_hash_table_iter_next(&iter, &key, &value)) {
Property *p = (Property *)value; Property *pv = (Property *)value;
rofi_theme_print_property_index(property_name_length, index + 4, p); rofi_theme_print_property_index(property_name_length, index + 4, pv);
} }
printf("%*s}\n", index, ""); printf("%*s}\n", index, "");
g_list_free(list); g_list_free(list);
@ -753,9 +753,9 @@ static int rofi_theme_get_position_inside(Property *p, const widget *widget,
if (widget->parent) { if (widget->parent) {
ThemeWidget *parent = ThemeWidget *parent =
rofi_theme_find_widget(widget->parent->name, widget->state, FALSE); rofi_theme_find_widget(widget->parent->name, widget->state, FALSE);
Property *p = Property *pv =
rofi_theme_find_property(parent, P_POSITION, property, FALSE); rofi_theme_find_property(parent, P_POSITION, property, FALSE);
return rofi_theme_get_position_inside(p, widget, property, def); return rofi_theme_get_position_inside(pv, widget, property, def);
} }
return def; return def;
} }
@ -778,9 +778,9 @@ static int rofi_theme_get_integer_inside(Property *p, const widget *widget,
if (widget->parent) { if (widget->parent) {
ThemeWidget *parent = ThemeWidget *parent =
rofi_theme_find_widget(widget->parent->name, widget->state, FALSE); rofi_theme_find_widget(widget->parent->name, widget->state, FALSE);
Property *p = Property *pv =
rofi_theme_find_property(parent, P_INTEGER, property, FALSE); rofi_theme_find_property(parent, P_INTEGER, property, FALSE);
return rofi_theme_get_integer_inside(p, widget, property, def); return rofi_theme_get_integer_inside(pv, widget, property, def);
} }
return def; return def;
} }
@ -805,9 +805,10 @@ static RofiDistance rofi_theme_get_distance_inside(Property *p,
if (widget->parent) { if (widget->parent) {
ThemeWidget *parent = ThemeWidget *parent =
rofi_theme_find_widget(widget->parent->name, widget->state, FALSE); rofi_theme_find_widget(widget->parent->name, widget->state, FALSE);
Property *p = Property *pv =
rofi_theme_find_property(parent, P_PADDING, property, FALSE); rofi_theme_find_property(parent, P_PADDING, property, FALSE);
return rofi_theme_get_distance_inside(p, widget->parent, property, def); return rofi_theme_get_distance_inside(pv, widget->parent, property,
def);
} }
return (RofiDistance){ return (RofiDistance){
.base = {def, ROFI_PU_PX, ROFI_DISTANCE_MODIFIER_NONE, NULL, NULL}, .base = {def, ROFI_PU_PX, ROFI_DISTANCE_MODIFIER_NONE, NULL, NULL},
@ -840,9 +841,9 @@ static int rofi_theme_get_boolean_inside(Property *p, const widget *widget,
if (widget->parent) { if (widget->parent) {
ThemeWidget *parent = ThemeWidget *parent =
rofi_theme_find_widget(widget->parent->name, widget->state, FALSE); rofi_theme_find_widget(widget->parent->name, widget->state, FALSE);
Property *p = Property *pv =
rofi_theme_find_property(parent, P_BOOLEAN, property, FALSE); rofi_theme_find_property(parent, P_BOOLEAN, property, FALSE);
return rofi_theme_get_boolean_inside(p, widget, property, def); return rofi_theme_get_boolean_inside(pv, widget, property, def);
} }
return def; return def;
} }
@ -868,9 +869,9 @@ static RofiOrientation rofi_theme_get_orientation_inside(Property *p,
if (widget->parent) { if (widget->parent) {
ThemeWidget *parent = ThemeWidget *parent =
rofi_theme_find_widget(widget->parent->name, widget->state, FALSE); rofi_theme_find_widget(widget->parent->name, widget->state, FALSE);
Property *p = Property *pv =
rofi_theme_find_property(parent, P_ORIENTATION, property, FALSE); rofi_theme_find_property(parent, P_ORIENTATION, property, FALSE);
return rofi_theme_get_orientation_inside(p, widget, property, def); return rofi_theme_get_orientation_inside(pv, widget, property, def);
} }
return def; return def;
} }
@ -897,9 +898,9 @@ static RofiCursorType rofi_theme_get_cursor_type_inside(Property *p,
if (widget->parent) { if (widget->parent) {
ThemeWidget *parent = ThemeWidget *parent =
rofi_theme_find_widget(widget->parent->name, widget->state, FALSE); rofi_theme_find_widget(widget->parent->name, widget->state, FALSE);
Property *p = Property *pv =
rofi_theme_find_property(parent, P_CURSOR, property, FALSE); rofi_theme_find_property(parent, P_CURSOR, property, FALSE);
return rofi_theme_get_cursor_type_inside(p, widget, property, def); return rofi_theme_get_cursor_type_inside(pv, widget, property, def);
} }
return def; return def;
} }
@ -925,9 +926,9 @@ static const char *rofi_theme_get_string_inside(Property *p,
if (widget->parent) { if (widget->parent) {
ThemeWidget *parent = ThemeWidget *parent =
rofi_theme_find_widget(widget->parent->name, widget->state, FALSE); rofi_theme_find_widget(widget->parent->name, widget->state, FALSE);
Property *p = Property *pv =
rofi_theme_find_property(parent, P_STRING, property, FALSE); rofi_theme_find_property(parent, P_STRING, property, FALSE);
return rofi_theme_get_string_inside(p, widget, property, def); return rofi_theme_get_string_inside(pv, widget, property, def);
} }
return def; return def;
} }
@ -951,9 +952,9 @@ static double rofi_theme_get_double_inside(ThemeWidget *wid, Property *p,
if (widget->parent) { if (widget->parent) {
ThemeWidget *parent = ThemeWidget *parent =
rofi_theme_find_widget(widget->parent->name, widget->state, FALSE); rofi_theme_find_widget(widget->parent->name, widget->state, FALSE);
Property *p = Property *pv =
rofi_theme_find_property(parent, P_DOUBLE, property, FALSE); rofi_theme_find_property(parent, P_DOUBLE, property, FALSE);
return rofi_theme_get_double_inside(parent, p, widget, property, def); return rofi_theme_get_double_inside(parent, pv, widget, property, def);
} }
return def; return def;
} }
@ -966,10 +967,10 @@ static double rofi_theme_get_double_inside(ThemeWidget *wid, Property *p,
if (widget->parent) { if (widget->parent) {
ThemeWidget *parent = ThemeWidget *parent =
rofi_theme_find_widget(widget->parent->name, widget->state, FALSE); rofi_theme_find_widget(widget->parent->name, widget->state, FALSE);
Property *p = Property *pv =
rofi_theme_find_property(parent, P_INTEGER, property, FALSE); rofi_theme_find_property(parent, P_INTEGER, property, FALSE);
return rofi_theme_get_double_inside(parent, p, widget->parent, property, return rofi_theme_get_double_inside(parent, pv, widget->parent,
def); property, def);
} }
return def; return def;
} }
@ -992,9 +993,9 @@ static void rofi_theme_get_color_inside(const widget *widget, Property *p,
if (widget->parent) { if (widget->parent) {
ThemeWidget *parent = ThemeWidget *parent =
rofi_theme_find_widget(widget->parent->name, widget->state, FALSE); rofi_theme_find_widget(widget->parent->name, widget->state, FALSE);
Property *p = Property *pv =
rofi_theme_find_property(parent, P_COLOR, property, FALSE); rofi_theme_find_property(parent, P_COLOR, property, FALSE);
rofi_theme_get_color_inside(widget, p, property, d); rofi_theme_get_color_inside(widget, pv, property, d);
} }
return; return;
} }
@ -1020,9 +1021,9 @@ static gboolean rofi_theme_get_image_inside(Property *p, const widget *widget,
if (widget->parent) { if (widget->parent) {
ThemeWidget *parent = ThemeWidget *parent =
rofi_theme_find_widget(widget->parent->name, widget->state, FALSE); rofi_theme_find_widget(widget->parent->name, widget->state, FALSE);
Property *p = Property *pv =
rofi_theme_find_property(parent, P_IMAGE, property, FALSE); rofi_theme_find_property(parent, P_IMAGE, property, FALSE);
return rofi_theme_get_image_inside(p, widget, property, d); return rofi_theme_get_image_inside(pv, widget, property, d);
} }
return FALSE; return FALSE;
} }
@ -1132,9 +1133,9 @@ static RofiPadding rofi_theme_get_padding_inside(Property *p,
if (widget->parent) { if (widget->parent) {
ThemeWidget *parent = ThemeWidget *parent =
rofi_theme_find_widget(widget->parent->name, widget->state, FALSE); rofi_theme_find_widget(widget->parent->name, widget->state, FALSE);
Property *p = Property *pv =
rofi_theme_find_property(parent, P_PADDING, property, FALSE); rofi_theme_find_property(parent, P_PADDING, property, FALSE);
return rofi_theme_get_padding_inside(p, widget, property, pad); return rofi_theme_get_padding_inside(pv, widget, property, pad);
} }
return pad; return pad;
} }
@ -1167,8 +1168,9 @@ static GList *rofi_theme_get_list_inside(Property *p, const widget *widget,
if (widget->parent) { if (widget->parent) {
ThemeWidget *parent = ThemeWidget *parent =
rofi_theme_find_widget(widget->parent->name, widget->state, FALSE); rofi_theme_find_widget(widget->parent->name, widget->state, FALSE);
Property *p = rofi_theme_find_property(parent, P_LIST, property, FALSE); Property *pv =
return rofi_theme_get_list_inside(p, widget, property, defaults); rofi_theme_find_property(parent, P_LIST, property, FALSE);
return rofi_theme_get_list_inside(pv, widget, property, defaults);
} }
} else if (p->type == P_LIST) { } else if (p->type == P_LIST) {
return g_list_copy_deep(p->value.list, rofi_g_list_strdup, NULL); return g_list_copy_deep(p->value.list, rofi_g_list_strdup, NULL);
@ -1201,9 +1203,10 @@ rofi_theme_get_highlight_inside(Property *p, widget *widget,
if (widget->parent) { if (widget->parent) {
ThemeWidget *parent = ThemeWidget *parent =
rofi_theme_find_widget(widget->parent->name, widget->state, FALSE); rofi_theme_find_widget(widget->parent->name, widget->state, FALSE);
Property *p = Property *pv =
rofi_theme_find_property(parent, P_HIGHLIGHT, property, FALSE); rofi_theme_find_property(parent, P_HIGHLIGHT, property, FALSE);
return rofi_theme_get_highlight_inside(p, widget->parent, property, th); return rofi_theme_get_highlight_inside(pv, widget->parent, property,
th);
} }
return th; return th;
} }
@ -1502,9 +1505,9 @@ static gboolean rofi_theme_has_property_inside(Property *p,
if (widget->parent) { if (widget->parent) {
ThemeWidget *parent = ThemeWidget *parent =
rofi_theme_find_widget(widget->parent->name, widget->state, FALSE); rofi_theme_find_widget(widget->parent->name, widget->state, FALSE);
Property *p = Property *pp =
rofi_theme_find_property(parent, P_STRING, property, FALSE); rofi_theme_find_property(parent, P_STRING, property, FALSE);
return rofi_theme_has_property_inside(p, widget, property); return rofi_theme_has_property_inside(pp, widget, property);
} }
return FALSE; return FALSE;
} }

View file

@ -2186,8 +2186,8 @@ void rofi_view_switch_mode(RofiViewState *state, Mode *mode) {
} }
if (state->sidebar_bar) { if (state->sidebar_bar) {
for (unsigned int j = 0; j < state->num_modi; j++) { for (unsigned int j = 0; j < state->num_modi; j++) {
const Mode *mode = rofi_get_mode(j); const Mode *tb_mode = rofi_get_mode(j);
textbox_font(state->modi[j], (mode == state->sw) ? HIGHLIGHT : NORMAL); textbox_font(state->modi[j], (tb_mode == state->sw) ? HIGHLIGHT : NORMAL);
} }
} }
rofi_view_restart(state); rofi_view_restart(state);

View file

@ -407,7 +407,7 @@ static void textbox_draw(widget *wid, cairo_t *draw) {
return; return;
} }
textbox *tb = (textbox *)wid; textbox *tb = (textbox *)wid;
unsigned int offset = ((tb->flags & TB_INDICATOR) ? DOT_OFFSET : 0); unsigned int dot_offset = ((tb->flags & TB_INDICATOR) ? DOT_OFFSET : 0);
if (tb->changed) { if (tb->changed) {
__textbox_update_pango_text(tb); __textbox_update_pango_text(tb);
@ -429,7 +429,7 @@ static void textbox_draw(widget *wid, cairo_t *draw) {
} }
y += top; y += top;
x += offset; x += dot_offset;
if (tb->xalign > 0.001) { if (tb->xalign > 0.001) {
int rem = int rem =