Skip to content

Commit

Permalink
Release 1.7.0
Browse files Browse the repository at this point in the history
- Improve window ordering
- Update dependency versions (adapt to wlroots 0.13.0)
  • Loading branch information
Cagebreak Signing Key 3 committed Apr 19, 2021
1 parent 2da9169 commit ed29a49
Show file tree
Hide file tree
Showing 18 changed files with 142 additions and 128 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ ninja -C build

For every release after 1.0.5, hashes will be provided.

1.7.0

* sha 256: 5af11b84e61a82a1a276e8f91f6ebc6baafd2c98d22be3da1d01734cc9d55faa
* sha 512: 45474115fb4c28fe1ee91ad54706bfe521b6e70bd8ea619b94a3f50bae426891bf6a0387aa9b2f7f6d18349280c4e84973e4e433d50c090e5a764c64fa67795d

1.6.0

* sha 256: aef473eae73454429afb158d66a7bd9aec75ef915845b7508de5448820357aa8
Expand Down Expand Up @@ -413,6 +418,10 @@ Adds options to disable or enable outputs. See Issue 22 in Bugs.md and Issue #2

Adds support for non-build dependencies and an option for builds without pandoc.

### Release 1.7.0

Improve window ordering.

## Contributors

* Aisha Tammy
Expand Down
2 changes: 1 addition & 1 deletion cagebreak.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ main(int argc, char *argv[]) {

set_sig_handler(SIGCHLD, sig_chld_handler);

backend = wlr_backend_autocreate(server.wl_display, NULL);
backend = wlr_backend_autocreate(server.wl_display);
if(!backend) {
wlr_log(WLR_ERROR, "Unable to create the wlroots backend");
ret = 1;
Expand Down
2 changes: 1 addition & 1 deletion fuzz/fuzz-lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ LLVMFuzzerInitialize(int *argc, char ***argv) {
server.backend = backend;

struct wlr_backend *headless_backend =
wlr_headless_backend_create(server.wl_display, NULL);
wlr_headless_backend_create(server.wl_display);
if(!headless_backend) {
wlr_log(WLR_ERROR, "Unable to create the wlroots headless backend");
ret = 1;
Expand Down
78 changes: 40 additions & 38 deletions keybinding.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ swap_tile(struct cg_tile *tile,
tile->view = swap_tile->view;
swap_tile->view = tmp_view;
if(tile->view != NULL) {
view_maximize(tile->view, &tile->tile);
view_maximize(tile->view, tile);
view_damage_whole(tile->view);
} else {
wlr_output_damage_add_box(tile->workspace->output->damage, &tile->tile);
Expand All @@ -183,7 +183,7 @@ swap_tile(struct cg_tile *tile,
server->curr_output->workspaces[server->curr_output->curr_workspace],
swap_tile);
if(swap_tile->view != NULL) {
view_maximize(swap_tile->view, &swap_tile->tile);
view_maximize(swap_tile->view, swap_tile);
view_damage_whole(swap_tile->view);
} else {
wlr_output_damage_add_box(tile->workspace->output->damage, &tile->tile);
Expand Down Expand Up @@ -342,7 +342,7 @@ resize(struct cg_tile *tile, const struct cg_tile *parent, int coord_offset,
.height = tile->tile.y == 0 ? tile->tile.height : coord_offset};
wlr_output_damage_add_box(tile->workspace->output->damage, &damage_box);
if(tile->view != NULL) {
view_maximize(tile->view, &tile->tile);
view_maximize(tile->view, tile);
}
}

Expand Down Expand Up @@ -456,6 +456,13 @@ keybinding_workspace_fullscreen(struct cg_server *server) {
return;
}

struct cg_view *it_view;
wl_list_for_each(it_view,
&output->workspaces[output->curr_workspace]->views, link) {
it_view->tile =
output->workspaces[output->curr_workspace]->focused_tile;
}

seat_set_focus(server->seat, current_view);
}

Expand Down Expand Up @@ -537,11 +544,11 @@ keybinding_split_output(struct cg_output *output, bool vertical) {
workspace_focus_tile(curr_workspace, curr_workspace->focused_tile);

if(next_view != NULL) {
view_maximize(next_view, &new_tile->tile);
view_maximize(next_view, new_tile);
}

if(original_view != NULL) {
view_maximize(original_view, &curr_workspace->focused_tile->tile);
view_maximize(original_view, curr_workspace->focused_tile);
}
}

Expand Down Expand Up @@ -601,46 +608,40 @@ keybinding_cycle_views(struct cg_server *server, bool reverse) {
server->curr_output->workspaces[server->curr_output->curr_workspace];
struct cg_view *current_view = curr_workspace->focused_tile->view;

struct cg_view *new_view;
// We are focused on the desktop
if(current_view == NULL) {
current_view = wl_container_of(&curr_workspace->views, new_view, link);
if(reverse) {
new_view =
wl_container_of(curr_workspace->views.prev, new_view, link);
} else {
new_view =
wl_container_of(curr_workspace->views.next, new_view, link);
}
} else {
if(reverse) {
new_view = wl_container_of(current_view->link.prev, new_view, link);
} else {
new_view = wl_container_of(current_view->link.next, new_view, link);
}
current_view =
wl_container_of(&curr_workspace->views, current_view, link);
}
while(&new_view->link != &current_view->link &&
(&new_view->link == &curr_workspace->views ||
view_is_visible(new_view))) {
if(reverse) {
new_view = wl_container_of(new_view->link.prev, new_view, link);
} else {
new_view = wl_container_of(new_view->link.next, new_view, link);
struct cg_view *it_view, *next_view = NULL;
if(reverse) {
next_view = view_get_prev_view(current_view);
} else {
struct wl_list *it;
it = current_view->link.next;
while(it != &current_view->link) {
if(it == &curr_workspace->views) {
it = it->next;
continue;
}
it_view = wl_container_of(it, it_view, link);
if(!view_is_visible(it_view)) {
next_view = it_view;
break;
}
it = it->next;
}
}
if(&new_view->link == &curr_workspace->views) {

if(next_view == NULL) {
return;
}

wlr_output_damage_add_box(curr_workspace->output->damage,
&curr_workspace->focused_tile->tile);
seat_set_focus(server->seat, new_view);
/* Move the previous view to the end of the list unless we are focused on
* the desktop*/
if(!reverse && &current_view->link != &curr_workspace->views) {
wl_list_remove(&current_view->link);
wl_list_insert(curr_workspace->views.prev, &current_view->link);
}
/* Prevent seat_set_focus from reordering the views */
curr_workspace->focused_tile->view = wl_container_of(
next_view->link.prev, curr_workspace->focused_tile->view, link);
seat_set_focus(server->seat, next_view);
}

void
Expand Down Expand Up @@ -717,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);
}
}
Expand Down Expand Up @@ -824,7 +826,7 @@ keybinding_move_view_to_workspace(struct cg_server *server, uint32_t ws) {
view->workspace = ws;
wl_list_insert(&ws->views, &view->link);
ws->focused_tile->view = view;
view_maximize(view, &ws->focused_tile->tile);
view_maximize(view, ws->focused_tile);
seat_set_focus(server->seat, view);
}
}
Expand Down
2 changes: 1 addition & 1 deletion man/cagebreak-config.5.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% CAGEBREAK-CONFIG(1) Version 1.6.0 | Cagebreak Manual
% CAGEBREAK-CONFIG(1) Version 1.7.0 | Cagebreak Manual

# NAME

Expand Down
2 changes: 1 addition & 1 deletion man/cagebreak.1.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
% CAGEBREAK(1) Version 1.6.0 | Cagebreak Manual
% CAGEBREAK(1) Version 1.7.0 | Cagebreak Manual

# NAME

Expand Down
14 changes: 7 additions & 7 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project('cagebreak', 'c',
version: '1.6.0',
version: '1.7.0',
license: 'MIT',
default_options: [
'c_std=c11',
Expand Down Expand Up @@ -53,7 +53,7 @@ if is_freebsd
)
endif

wlroots = dependency('wlroots', version: '>= 0.12.0')
wlroots = dependency('wlroots', version: '>= 0.13.0')
wayland_protos = dependency('wayland-protocols', version: '>=1.14')
wayland_server = dependency('wayland-server')
wayland_cursor = dependency('wayland-cursor')
Expand Down Expand Up @@ -198,13 +198,13 @@ reproducible_build_versions = {
'wayland_server': '1.19.0',
'wayland_client': '1.19.0',
'wayland_cursor': '1.19.0',
'wlroots': '0.12.0',
'xkbcommon': '1.1.0',
'fontconfig': '2.13.91',
'wlroots': '0.13.0',
'xkbcommon': '1.2.1',
'fontconfig': '2.13.93',
'pixman': '0.40.0',
'pango': '1.48.2',
'pango': '1.48.4',
'cairo': '1.17.4',
'pangocairo': '1.48.2',
'pangocairo': '1.48.4',
'math': '-1'
}

Expand Down
3 changes: 2 additions & 1 deletion message.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <cairo/cairo.h>
#include <drm_fourcc.h>
#include <pango/pangocairo.h>
#include <unistd.h>
#include <wlr/backend.h>
Expand Down Expand Up @@ -85,7 +86,7 @@ create_message_texture(const char *string, const struct cg_output *output) {
int stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width);
struct wlr_renderer *renderer =
wlr_backend_get_renderer(output->wlr_output->backend);
texture = wlr_texture_from_pixels(renderer, WL_SHM_FORMAT_ARGB8888, stride,
texture = wlr_texture_from_pixels(renderer, DRM_FORMAT_ARGB8888, stride,
width, height, data);
cairo_surface_destroy(surface);
g_object_unref(pango);
Expand Down
47 changes: 35 additions & 12 deletions output.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -361,17 +368,23 @@ handle_output_damage_frame(struct wl_listener *listener, void *data) {
}

static void
handle_output_transform(struct wl_listener *listener, void *data) {
struct cg_output *output = wl_container_of(listener, output, transform);
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);
}
}
}
}

Expand All @@ -386,7 +399,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);
}
}
}

Expand Down Expand Up @@ -429,6 +444,10 @@ output_clear(struct cg_output *output) {
view->workspace =
server->curr_output
->workspaces[server->curr_output->curr_workspace];
view->tile =
server->curr_output
->workspaces[server->curr_output->curr_workspace]
->focused_tile;
if(server->seat->focused_view == NULL) {
seat_set_focus(server->seat, view);
}
Expand All @@ -448,6 +467,10 @@ output_clear(struct cg_output *output) {
view->workspace =
server->curr_output
->workspaces[server->curr_output->curr_workspace];
view->tile =
server->curr_output
->workspaces[server->curr_output->curr_workspace]
->focused_tile;
}
}
}
Expand All @@ -460,7 +483,7 @@ output_destroy(struct cg_output *output) {

wl_list_remove(&output->destroy.link);
wl_list_remove(&output->mode.link);
wl_list_remove(&output->transform.link);
wl_list_remove(&output->commit.link);
wl_list_remove(&output->damage_frame.link);
wl_list_remove(&output->damage_destroy.link);

Expand Down Expand Up @@ -605,8 +628,8 @@ handle_new_output(struct wl_listener *listener, void *data) {

output->mode.notify = handle_output_mode;
wl_signal_add(&wlr_output->events.mode, &output->mode);
output->transform.notify = handle_output_transform;
wl_signal_add(&wlr_output->events.transform, &output->transform);
output->commit.notify = handle_output_commit;
wl_signal_add(&wlr_output->events.commit, &output->commit);
output->destroy.notify = handle_output_destroy;
wl_signal_add(&wlr_output->events.destroy, &output->destroy);
output->damage_frame.notify = handle_output_damage_frame;
Expand Down
2 changes: 1 addition & 1 deletion output.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct cg_output {
struct wlr_output_damage *damage;

struct wl_listener mode;
struct wl_listener transform;
struct wl_listener commit;
struct wl_listener destroy;
struct wl_listener damage_frame;
struct wl_listener damage_destroy;
Expand Down
1 change: 0 additions & 1 deletion render.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ render_view_toplevels(struct cg_view *view, struct cg_output *output,
.tile_width = 0,
.tile_height = 0,
};
// TODO: improve run time behaviour of view_get_tile
struct cg_tile *view_tile = view_get_tile(view);
if(view_tile != NULL) {
if(view_tile->tile.width != view->wlr_surface->current.width ||
Expand Down
Loading

0 comments on commit ed29a49

Please sign in to comment.