Implement workspaces

This commit is contained in:
Drew DeVault 2018-01-30 23:09:21 -05:00
parent 8231f99c12
commit b28602aa74
14 changed files with 420 additions and 30 deletions

View file

@ -219,8 +219,8 @@ static void output_frame_notify(struct wl_listener *listener, void *data) {
wlr_output_make_current(wlr_output);
wlr_renderer_begin(server->renderer, wlr_output);
swayc_descendants_of_type(
&root_container, C_VIEW, output_frame_view, soutput);
swayc_t *workspace = soutput->swayc->focused;
swayc_descendants_of_type(workspace, C_VIEW, output_frame_view, soutput);
// render unmanaged views on top
struct sway_view *view;

View file

@ -124,8 +124,6 @@ void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) {
sway_surface->view = sway_view;
// TODO:
// - Wire up listeners
// - Handle popups
// - Look up pid and open on appropriate workspace
// - Set new view to maximized so it behaves nicely
// - Criteria
@ -136,11 +134,8 @@ void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) {
sway_surface->destroy.notify = handle_destroy;
wl_signal_add(&xdg_surface->events.destroy, &sway_surface->destroy);
// TODO: actual focus semantics
swayc_t *parent = root_container.children->items[0];
parent = parent->children->items[0]; // workspace
swayc_t *cont = new_view(parent, sway_view);
struct sway_seat *seat = input_manager_current_seat(input_manager);
swayc_t *cont = new_view(seat->focus, sway_view);
sway_view->swayc = cont;
arrange_windows(cont->parent, -1, -1);