Merge branch 'development' of https://github.com/project-repo/cagebreak into development

This commit is contained in:
Cagebreak Signing Key 3 2020-07-18 19:16:04 +02:00
commit 509ff38dc9
9 changed files with 23 additions and 18 deletions

View file

@ -826,11 +826,11 @@ keybinding_move_view_to_workspace(struct cg_server *server, uint32_t ws) {
}
void
keybinding_configure_output(struct cg_server *server, struct cg_output_config *cfg) {
struct cg_output_config *it,*tmp;
wl_list_for_each_safe(it, tmp, &server->output_config,
link) {
if(strcmp(cfg->output_name,it->output_name) == 0) {
keybinding_configure_output(struct cg_server *server,
struct cg_output_config *cfg) {
struct cg_output_config *it, *tmp;
wl_list_for_each_safe(it, tmp, &server->output_config, link) {
if(strcmp(cfg->output_name, it->output_name) == 0) {
wl_list_remove(&it->link);
free(it->output_name);
}

View file

@ -18,10 +18,11 @@ enum keybinding_action {
KEYBINDING_SPLIT_HORIZONTAL,
KEYBINDING_CHANGE_TTY, // data.u is the desired tty
KEYBINDING_LAYOUT_FULLSCREEN,
KEYBINDING_CYCLE_VIEWS, // data.b is 0 if forward, 1 if reverse
KEYBINDING_CYCLE_TILES, // data.b is 0 if forward, 1 if reverse
KEYBINDING_CYCLE_OUTPUT, // data.b is 0 if forward, 1 if reverse
KEYBINDING_CONFIGURE_OUTPUT, // data.o_cfg is the desired output configuration
KEYBINDING_CYCLE_VIEWS, // data.b is 0 if forward, 1 if reverse
KEYBINDING_CYCLE_TILES, // data.b is 0 if forward, 1 if reverse
KEYBINDING_CYCLE_OUTPUT, // data.b is 0 if forward, 1 if reverse
KEYBINDING_CONFIGURE_OUTPUT, // data.o_cfg is the desired output
// configuration
KEYBINDING_QUIT,
KEYBINDING_NOOP,
KEYBINDING_SWITCH_WORKSPACE, // data.u is the desired workspace

View file

@ -1,4 +1,4 @@
% CAGEBREAK-CONFIG(1) Version 1.3.2 | Cagebreak Manual
% CAGEBREAK-CONFIG(1) Version 1.3.3 | Cagebreak Manual
# NAME

View file

@ -1,4 +1,4 @@
% CAGEBREAK(1) Version 1.3.2 | Cagebreak Manual
% CAGEBREAK(1) Version 1.3.3 | Cagebreak Manual
# NAME

View file

@ -1,5 +1,5 @@
project('cagebreak', 'c',
version: '1.3.2',
version: '1.3.3',
license: 'MIT',
default_options: [
'c_std=c11',

View file

@ -537,7 +537,7 @@ parse_command(struct cg_server *server, struct keybinding *keybinding,
}
} else if(strcmp(action, "output") == 0) {
keybinding->action = KEYBINDING_CONFIGURE_OUTPUT;
keybinding->data.o_cfg=parse_output_config(&saveptr,errstr);
keybinding->data.o_cfg = parse_output_config(&saveptr, errstr);
if(keybinding->data.o_cfg == NULL) {
return -1;
}

5
view.c
View file

@ -56,7 +56,7 @@ view_child_handle_commit(struct wl_listener *listener, void *_data) {
struct cg_view_child *child = wl_container_of(listener, child, commit);
int x, y;
child->get_coords(child, &x, &y);
view_damage_child(child, x, y, false);
view_damage_child(child, x + child->view->ox, y + child->view->oy, false);
}
static void
@ -120,8 +120,7 @@ subsurface_handle_destroy(struct wl_listener *listener, void *_data) {
static void
subsurface_get_coords(struct cg_view_child *child, int *x, int *y) {
struct wlr_surface *surface = child->wlr_surface;
*x = -child->view->ox;
*y = -child->view->oy;
*x = *y = 0;
if(child->parent && child->parent->get_coords) {
int sx, sy;

2
view.h
View file

@ -83,6 +83,8 @@ view_damage_part(struct cg_view *view);
void
view_damage_whole(struct cg_view *view);
void
view_damage_child(struct cg_view_child *view, int x, int y, bool whole);
void
view_activate(struct cg_view *view, bool activate);
void
view_position(struct cg_view *view);

View file

@ -59,6 +59,9 @@ xdg_popup_destroy(struct cg_view_child *child) {
return;
}
int x, y;
child->get_coords(child, &x, &y);
view_damage_child(child, x + child->view->ox, y + child->view->oy, true);
struct cg_xdg_popup *popup = (struct cg_xdg_popup *)child;
wl_list_remove(&popup->destroy.link);
wl_list_remove(&popup->map.link);
@ -128,8 +131,8 @@ xdg_popup_get_coords(struct cg_view_child *child, int *x, int *y) {
struct cg_xdg_popup *popup = (struct cg_xdg_popup *)child;
struct wlr_xdg_surface *surface = popup->wlr_popup->base;
int x_offset = -surface->geometry.x - child->view->ox;
int y_offset = -surface->geometry.y - child->view->oy;
int x_offset = -surface->geometry.x;
int y_offset = -surface->geometry.y;
wlr_xdg_popup_get_toplevel_coords(
surface->popup, x_offset + surface->popup->geometry.x,