Merge pull request #1647 from acrisci/refactor-tree

Refactor tree
This commit is contained in:
Drew DeVault 2018-03-29 23:19:14 -04:00 committed by GitHub
commit 6b7841b11f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 593 additions and 588 deletions

View file

@ -3,10 +3,10 @@
#include <stdlib.h>
#include <wayland-server.h>
#include <wlr/types/wlr_xdg_shell_v6.h>
#include "sway/container.h"
#include "sway/layout.h"
#include "sway/tree/container.h"
#include "sway/tree/layout.h"
#include "sway/server.h"
#include "sway/view.h"
#include "sway/tree/view.h"
#include "sway/input/seat.h"
#include "sway/input/input-manager.h"
#include "log.h"
@ -83,7 +83,7 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
wl_container_of(listener, sway_xdg_surface, destroy);
wl_list_remove(&sway_xdg_surface->commit.link);
wl_list_remove(&sway_xdg_surface->destroy.link);
swayc_t *parent = destroy_view(sway_xdg_surface->view->swayc);
struct sway_container *parent = container_view_destroy(sway_xdg_surface->view->swayc);
free(sway_xdg_surface->view);
free(sway_xdg_surface);
arrange_windows(parent, -1, -1);
@ -137,8 +137,8 @@ void handle_xdg_shell_v6_surface(struct wl_listener *listener, void *data) {
wl_signal_add(&xdg_surface->events.destroy, &sway_surface->destroy);
struct sway_seat *seat = input_manager_current_seat(input_manager);
swayc_t *focus = sway_seat_get_focus_inactive(seat, &root_container);
swayc_t *cont = new_view(focus, sway_view);
struct sway_container *focus = sway_seat_get_focus_inactive(seat, &root_container);
struct sway_container *cont = container_view_create(focus, sway_view);
sway_view->swayc = cont;
arrange_windows(cont->parent, -1, -1);