Skip to content

Commit

Permalink
v0.87b
Browse files Browse the repository at this point in the history
  • Loading branch information
milgra committed Dec 20, 2022
1 parent 4d3ee04 commit 9db1359
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ sudo ninja -C build install
## Usage
Launch sov in a terminal, enter 0 to hide, 1 to show, 2 to quit sov, press return.
Launch sov in a terminal, enter 0 to hide, 1 to show, 2 to toggle, 3 to quit sov, press return.
```
sov
Expand Down
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.86b',
version: '0.87b',
license: 'MIT',
default_options: ['c_std=gnu99']
)
Expand Down
27 changes: 27 additions & 0 deletions src/sov/sov.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ struct sov
int ratio;
char* anchor;
int margin;

int shown;
} sov = {0};

/* asks for sway workspaces and tree */
Expand Down Expand Up @@ -73,6 +75,7 @@ void init(wl_event_t event)

void create_layers()
{
sov.shown = 1;
ku_wayland_set_time_event_delay(0);

if (sov.workspaces == NULL) sov.workspaces = VNEW(); // REL 0
Expand Down Expand Up @@ -175,6 +178,7 @@ void update(ku_event_t ev)
{
ku_wayland_set_time_event_delay(0);
sov.request = 0;
sov.shown = 0;

if (sov.wlwindows->length > 0)
{
Expand All @@ -195,6 +199,29 @@ void update(ku_event_t ev)
ku_wayland_set_time_event_delay(sov.timeout);
}
else if (ev.text[0] == '2')
{
if (sov.shown == 0)
{
create_layers();
}
else
{
sov.shown = 0;
ku_wayland_set_time_event_delay(0);
sov.request = 0;

if (sov.wlwindows->length > 0)
{
for (int w = 0; w < sov.wlwindows->length; w++)
{
wl_window_t* window = sov.wlwindows->data[w];
ku_wayland_delete_window(window);
}
mt_vector_reset(sov.wlwindows);
}
}
}
else if (ev.text[0] == '3')
{
ku_wayland_exit();
}
Expand Down

0 comments on commit 9db1359

Please sign in to comment.