Skip to content

Commit

Permalink
Crash fixes, config changes, new wallpapers.
Browse files Browse the repository at this point in the history
  • Loading branch information
Luka Vilfan committed Jun 14, 2022
1 parent a7c9001 commit 9eaac57
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 30 deletions.
2 changes: 2 additions & 0 deletions assets/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ Photo attribution
- By [Sebastian Svenson](<https://unsplash.com/@sebastiansvenson>) on Unsplash
- By [Shubham Dhage](<https://unsplash.com/@theshubhamdhage>) on Unsplash
- By [Vimal Saran](<https://unsplash.com/@vimal_saran>) on Unsplash
- By [Simon Lee](<https://unsplash.com/@simonppt>) on Unsplash
- By [Fachrizal Maulana](<https://unsplash.com/@fachrizalm>) on Unsplash
Binary file modified assets/Wallpaper-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/Wallpaper-3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/Wallpaper-4.jpg
Binary file not shown.
Binary file modified assets/Wallpaper-Default.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 2 additions & 10 deletions bonsai/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,10 @@
#include "bonsai/server.h"
#include "bonsai/util.h"

// TODO: Maybe add multipurpose client for indicating things to the user (e.g.
// took screenshot, switched to workspace).

// TODO: Implement server decoration.

// TODO: Implement input inhibitor, right now, it's faked.

// TODO: Gracefully handle multiple outputs.

// TODO: Implement xwayland support.

// TODO: Implement input inhibitor, right now, it's faked.
// TODO: Add idle daemon and configuration.
// TODO: Implement server decoration.

int
main(void)
Expand Down
28 changes: 10 additions & 18 deletions bonsai/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,25 +362,20 @@ output_destroy(struct bsi_output* output)

debug("Moving member views to next workspace");

struct bsi_output* next_output =
wlr_output_layout_output_at(server->wlr_output_layout,
server->wlr_cursor->x,
server->wlr_cursor->y)
->data;
struct bsi_workspace* next_output_wspace =
workspaces_get_active(next_output);

struct wl_list* curr_output_wspaces = &output->workspaces;
struct bsi_workspace *wspace, *wspace_tmp;
wl_list_for_each_safe(
wspace, wspace_tmp, curr_output_wspaces, link_output)
struct bsi_output* next_output = outputs_find_not(server, output);
struct bsi_workspace* next_ws =
wl_container_of(next_output->workspaces.next, next_ws, link_output);

struct wl_list* curr_wss = &output->workspaces;
struct bsi_workspace *ws, *ws_tmp;
wl_list_for_each_safe(ws, ws_tmp, curr_wss, link_output)
{
struct bsi_view* view;
wl_list_for_each(view, &wspace->views, link_server)
wl_list_for_each(view, &ws->views, link_server)
{
workspace_view_move(wspace, next_output_wspace, view);
workspace_view_move(ws, next_ws, view);
}
workspace_destroy(wspace);
workspace_destroy(ws);
}
} else {
/* Destroy everything, there are no more outputs. */
Expand Down Expand Up @@ -657,7 +652,6 @@ handle_output_manager_apply(struct wl_listener* listener, void* data)

wlr_output_manager_v1_set_configuration(server->wlr_output_manager, config);
wlr_output_configuration_v1_send_succeeded(config);
wlr_output_configuration_v1_destroy(config);
}

void
Expand Down Expand Up @@ -697,6 +691,4 @@ handle_output_manager_test(struct wl_listener* listener, void* data)
wlr_output_configuration_v1_send_succeeded(config);
else
wlr_output_configuration_v1_send_failed(config);

wlr_output_configuration_v1_destroy(config);
}
24 changes: 24 additions & 0 deletions bonsai/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,15 @@ server_setup(struct bsi_server* server)
wl_display_destroy(server->wl_display);
exit(EXIT_FAILURE);
}

char* const argp[] = { "dbus-update-activation-environment",
"--systemd",
"WAYLAND_DISPLAY",
"XDG_CURRENT_DESKTOP",
NULL };
if (!util_tryexec(argp, 5)) {
error("Failed to update dbus activation environment");
}
}

void
Expand Down Expand Up @@ -351,6 +360,21 @@ outputs_find(struct bsi_server* server, struct wlr_output* wlr_output)
return NULL;
}

struct bsi_output*
outputs_find_not(struct bsi_server* server, struct bsi_output* not_output)
{
assert(wl_list_length(&server->output.outputs));

struct bsi_output* output;
wl_list_for_each(output, &server->output.outputs, link_server)
{
if (output != not_output)
return output;
}

return NULL;
}

static char* server_extern_progs[] = {
[BSI_SERVER_EXTERN_PROG_WALLPAPER] = "swaybg",
[BSI_SERVER_EXTERN_PROG_BAR] = "waybar",
Expand Down
2 changes: 1 addition & 1 deletion extern/xdg-desktop-portal-wlr/config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[screencast]
max_fps=60
max_fps=30
chooser_type=dmenu
chooser_cmd=bemenu -c -i
3 changes: 3 additions & 0 deletions include/bonsai/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ outputs_remove(struct bsi_output* output);
struct bsi_output*
outputs_find(struct bsi_server* server, struct wlr_output* wlr_output);

struct bsi_output*
outputs_find_not(struct bsi_server* server, struct bsi_output* not_output);

void
outputs_setup_extern(struct bsi_server* server);

Expand Down
1 change: 0 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ install_data(
'assets/Wallpaper-1.jpg',
'assets/Wallpaper-2.jpg',
'assets/Wallpaper-3.jpg',
'assets/Wallpaper-4.jpg',
'assets/Wallpaper-Default.jpg',
'assets/LICENSE',
install_dir : join_paths(datadir, 'backgrounds', 'bonsai'),
Expand Down

0 comments on commit 9eaac57

Please sign in to comment.