Skip to content

Commit

Permalink
fixed empty workspace bug
Browse files Browse the repository at this point in the history
  • Loading branch information
milgra committed Apr 25, 2022
1 parent c091d99 commit 379aafa
Show file tree
Hide file tree
Showing 6 changed files with 492 additions and 2 deletions.
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project(
'sov',
'c',
version: '0.6',
version: '0.61',
license: 'ISC',
default_options: ['c_std=c99']
)
Expand Down
2 changes: 1 addition & 1 deletion src/sov/tree/tree_drawer.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void tree_drawer_draw(
int wsnum_dy)
{
int max = cols;
if (workspaces->length > cols)
if (workspaces->length > 0)
{
sway_workspace_t* wsl = workspaces->data[workspaces->length - 1];
max = ceilf((float) wsl->number / cols) * cols;
Expand Down
Binary file added tst/image_empty_6.bmp
Binary file not shown.
2 changes: 2 additions & 0 deletions tst/runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ build/test_tree -c tst/config_b -w tst/workspace_a.json -t tst/tree_a.json -o ts
build/test_tree -c tst/config_a -w tst/workspace_b.json -t tst/tree_b.json -o tst/image_cfga_treeb_test.bmp
build/test_tree -c tst/config_b -w tst/workspace_b.json -t tst/tree_b.json -o tst/image_cfgb_treeb_test.bmp
build/test_tree -c tst/config_a -w tst/workspace_empty.json -t tst/tree_empty.json -o tst/image_empty_test.bmp
build/test_tree -c tst/config_a -w tst/workspace_empty_6.json -t tst/tree_empty_6.json -o tst/image_empty_6_test.bmp
build/test_tree -c tst/config_a -w tst/workspace_floating.json -t tst/tree_floating.json -o tst/image_floating_test.bmp
build/test_tree -c tst/config_a -w tst/workspace_feh.json -t tst/tree_feh.json -o tst/image_feh_test.bmp
diff tst/image_cfga_treea.bmp tst/image_cfga_treea_test.bmp
diff tst/image_cfgb_treea.bmp tst/image_cfgb_treea_test.bmp
diff tst/image_cfga_treeb.bmp tst/image_cfga_treeb_test.bmp
diff tst/image_cfgb_treeb.bmp tst/image_cfgb_treeb_test.bmp
diff tst/image_empty.bmp tst/image_empty_test.bmp
diff tst/image_empty_6.bmp tst/image_empty_6_test.bmp
diff tst/image_feh.bmp tst/image_feh_test.bmp
diff tst/image_floating.bmp tst/image_floating_test.bmp
Loading

0 comments on commit 379aafa

Please sign in to comment.