diff --git a/assets/LICENSE b/assets/LICENSE index 58381a0..6c1fdae 100644 --- a/assets/LICENSE +++ b/assets/LICENSE @@ -23,3 +23,5 @@ Photo attribution - By [Sebastian Svenson]() on Unsplash - By [Shubham Dhage]() on Unsplash - By [Vimal Saran]() on Unsplash +- By [Simon Lee]() on Unsplash +- By [Fachrizal Maulana]() on Unsplash diff --git a/assets/Wallpaper-2.jpg b/assets/Wallpaper-2.jpg index 1665e86..6302033 100644 Binary files a/assets/Wallpaper-2.jpg and b/assets/Wallpaper-2.jpg differ diff --git a/assets/Wallpaper-3.jpg b/assets/Wallpaper-3.jpg index 6302033..57f5639 100644 Binary files a/assets/Wallpaper-3.jpg and b/assets/Wallpaper-3.jpg differ diff --git a/assets/Wallpaper-4.jpg b/assets/Wallpaper-4.jpg deleted file mode 100644 index 58382ae..0000000 Binary files a/assets/Wallpaper-4.jpg and /dev/null differ diff --git a/assets/Wallpaper-Default.jpg b/assets/Wallpaper-Default.jpg index 57f5639..761898c 100644 Binary files a/assets/Wallpaper-Default.jpg and b/assets/Wallpaper-Default.jpg differ diff --git a/bonsai/main.c b/bonsai/main.c index 3e29d58..45e54db 100644 --- a/bonsai/main.c +++ b/bonsai/main.c @@ -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) diff --git a/bonsai/output.c b/bonsai/output.c index e938616..354a40f 100644 --- a/bonsai/output.c +++ b/bonsai/output.c @@ -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. */ @@ -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 @@ -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); } diff --git a/bonsai/server.c b/bonsai/server.c index 7369e6b..d7373bb 100644 --- a/bonsai/server.c +++ b/bonsai/server.c @@ -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 @@ -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", diff --git a/extern/xdg-desktop-portal-wlr/config b/extern/xdg-desktop-portal-wlr/config index da6a73a..baf2123 100644 --- a/extern/xdg-desktop-portal-wlr/config +++ b/extern/xdg-desktop-portal-wlr/config @@ -1,4 +1,4 @@ [screencast] -max_fps=60 +max_fps=30 chooser_type=dmenu chooser_cmd=bemenu -c -i diff --git a/include/bonsai/server.h b/include/bonsai/server.h index 993ea62..66fcef4 100644 --- a/include/bonsai/server.h +++ b/include/bonsai/server.h @@ -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); diff --git a/meson.build b/meson.build index c051e44..184380c 100644 --- a/meson.build +++ b/meson.build @@ -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'),