mirror of
https://github.com/labwc/labwc.git
synced 2025-11-02 09:01:47 -05:00
Add -Wshadow + reformat switch cases
Adding -Wshadow will prevent unintentional variable overrides. Also, wrapping switch cases with declarations with braces will make our logic more robust by limiting lifetimes of variables.
This commit is contained in:
parent
e19f0fc267
commit
68bf55d724
4 changed files with 91 additions and 94 deletions
|
|
@ -101,11 +101,11 @@ _osd_update(struct server *server)
|
|||
|
||||
/* Border */
|
||||
set_cairo_color(cairo, theme->osd_border_color);
|
||||
struct wlr_fbox fbox = {
|
||||
struct wlr_fbox border_fbox = {
|
||||
.width = width,
|
||||
.height = height,
|
||||
};
|
||||
draw_cairo_border(cairo, fbox, theme->osd_border_width);
|
||||
draw_cairo_border(cairo, border_fbox, theme->osd_border_width);
|
||||
|
||||
/* Boxes */
|
||||
uint16_t x;
|
||||
|
|
@ -385,9 +385,9 @@ workspaces_switch_to(struct workspace *target, bool update_focus)
|
|||
* below that should take care of the issue.
|
||||
*/
|
||||
if (update_focus) {
|
||||
struct view *view = server->active_view;
|
||||
if (!view || (!view->visible_on_all_workspaces
|
||||
&& !view_is_always_on_top(view))) {
|
||||
struct view *active_view = server->active_view;
|
||||
if (!active_view || (!active_view->visible_on_all_workspaces
|
||||
&& !view_is_always_on_top(active_view))) {
|
||||
desktop_focus_topmost_view(server);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue