mirror of
https://cagebreak.project-repo.co/cagebreak.git
synced 2026-08-23 05:54:19 +02:00
Fix bugs due to updated wlroots
This commit is contained in:
parent
72bcf8f1de
commit
20ce9ae3a4
5 changed files with 25 additions and 22 deletions
|
|
@ -718,7 +718,8 @@ keybinding_move_view_to_next_output(struct cg_server *server) {
|
|||
->focused_tile->view = view;
|
||||
view->workspace = server->curr_output
|
||||
->workspaces[server->curr_output->curr_workspace];
|
||||
view_position(view);
|
||||
view->tile=view->workspace->focused_tile;
|
||||
view_maximize(view,view->tile);
|
||||
seat_set_focus(server->seat, view);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
28
output.c
28
output.c
|
|
@ -226,8 +226,12 @@ scan_out_primary_view(struct cg_output *output) {
|
|||
}
|
||||
}
|
||||
|
||||
struct cg_view *view =
|
||||
output->workspaces[output->curr_workspace]->focused_tile->view;
|
||||
struct cg_workspace *ws = output->workspaces[output->curr_workspace];
|
||||
if(ws->focused_tile->next != ws->focused_tile) {
|
||||
return false;
|
||||
}
|
||||
|
||||
struct cg_view *view = ws->focused_tile->view;
|
||||
if(view == NULL || view->wlr_surface == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -261,6 +265,9 @@ scan_out_primary_view(struct cg_output *output) {
|
|||
}
|
||||
|
||||
wlr_output_attach_buffer(wlr_output, &surface->buffer->base);
|
||||
if(!wlr_output_test(wlr_output)) {
|
||||
return false;
|
||||
}
|
||||
return wlr_output_commit(wlr_output);
|
||||
}
|
||||
|
||||
|
|
@ -363,15 +370,20 @@ frame_done:
|
|||
static void
|
||||
handle_output_commit(struct wl_listener *listener, void *data) {
|
||||
struct cg_output *output = wl_container_of(listener, output, commit);
|
||||
struct wlr_output_event_commit *event = data;
|
||||
|
||||
if(!output->wlr_output->enabled || output->workspaces == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
struct cg_view *view;
|
||||
wl_list_for_each(view, &output->workspaces[output->curr_workspace]->views,
|
||||
link) {
|
||||
view_position(view);
|
||||
if(event->committed & (WLR_OUTPUT_STATE_TRANSFORM | WLR_OUTPUT_STATE_SCALE)) {
|
||||
struct cg_view *view;
|
||||
wl_list_for_each(view, &output->workspaces[output->curr_workspace]->views,
|
||||
link) {
|
||||
if(view_is_visible(view)) {
|
||||
view_maximize(view,view->tile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -386,7 +398,9 @@ handle_output_mode(struct wl_listener *listener, void *data) {
|
|||
struct cg_view *view;
|
||||
wl_list_for_each(view, &output->workspaces[output->curr_workspace]->views,
|
||||
link) {
|
||||
view_position(view);
|
||||
if(view_is_visible(view)) {
|
||||
view_maximize(view,view->tile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
3
seat.c
3
seat.c
|
|
@ -56,9 +56,6 @@ view_at(const struct cg_view *view, double lx, double ly,
|
|||
struct wlr_box *output_layout_box = wlr_output_layout_get_box(
|
||||
view->server->output_layout, view->workspace->output->wlr_output);
|
||||
if(output_layout_box == NULL) {
|
||||
fprintf(stderr, "OUTPUT:%d\n",
|
||||
view->workspace->output->wlr_output->enabled);
|
||||
return output_layout_box->x;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
11
view.c
11
view.c
|
|
@ -258,14 +258,6 @@ view_maximize(struct cg_view *view, struct cg_tile *tile) {
|
|||
view->tile = tile;
|
||||
}
|
||||
|
||||
void
|
||||
view_position(struct cg_view *view) {
|
||||
view_maximize(view,
|
||||
view->workspace->output
|
||||
->workspaces[view->workspace->output->curr_workspace]
|
||||
->focused_tile);
|
||||
}
|
||||
|
||||
void
|
||||
view_for_each_surface(struct cg_view *view,
|
||||
wlr_surface_iterator_func_t iterator, void *data) {
|
||||
|
|
@ -363,7 +355,8 @@ view_map(struct cg_view *view, struct wlr_surface *surface,
|
|||
} else
|
||||
#endif
|
||||
{
|
||||
view_position(view);
|
||||
view->tile=view->workspace->focused_tile;
|
||||
view_maximize(view,view->tile);
|
||||
wl_list_insert(&ws->views, &view->link);
|
||||
}
|
||||
seat_set_focus(output->server->seat, view);
|
||||
|
|
|
|||
2
view.h
2
view.h
|
|
@ -89,8 +89,6 @@ view_damage_child(struct cg_view_child *view, bool whole);
|
|||
void
|
||||
view_activate(struct cg_view *view, bool activate);
|
||||
void
|
||||
view_position(struct cg_view *view);
|
||||
void
|
||||
view_for_each_surface(struct cg_view *view,
|
||||
wlr_surface_iterator_func_t iterator, void *data);
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue