From a08b84b381cc452cff2e2fc3b2a36933f84909ae Mon Sep 17 00:00:00 2001 From: project-repo Date: Sat, 18 Jul 2020 11:48:14 +0200 Subject: [PATCH 1/2] Fix rendering of cg_view_child objects --- view.c | 5 ++--- view.h | 2 ++ xdg_shell.c | 9 ++++++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/view.c b/view.c index 1560885..d1483c4 100644 --- a/view.c +++ b/view.c @@ -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; diff --git a/view.h b/view.h index bcb8908..b7cc426 100644 --- a/view.h +++ b/view.h @@ -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); diff --git a/xdg_shell.c b/xdg_shell.c index 7d8ee4f..1cd349d 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -59,7 +59,10 @@ xdg_popup_destroy(struct cg_view_child *child) { return; } - struct cg_xdg_popup *popup = (struct cg_xdg_popup *)child; + 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); wl_list_remove(&popup->unmap.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, From 46236810302d39fd765427f4f2af9b1f35fc6ffc Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 18 Jul 2020 17:59:27 +0200 Subject: [PATCH 2/2] Preparation for 1.3.3 release - Bump version number - Apply clang-format --- keybinding.c | 10 +++++----- keybinding.h | 9 +++++---- man/cagebreak-config.5.md | 2 +- man/cagebreak.1.md | 2 +- meson.build | 2 +- parse.c | 2 +- view.c | 4 ++-- xdg_shell.c | 4 ++-- 8 files changed, 18 insertions(+), 17 deletions(-) diff --git a/keybinding.c b/keybinding.c index 25e21fa..054f638 100644 --- a/keybinding.c +++ b/keybinding.c @@ -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); } diff --git a/keybinding.h b/keybinding.h index b0d99fd..cd48840 100644 --- a/keybinding.h +++ b/keybinding.h @@ -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 diff --git a/man/cagebreak-config.5.md b/man/cagebreak-config.5.md index c063dc5..969f56d 100644 --- a/man/cagebreak-config.5.md +++ b/man/cagebreak-config.5.md @@ -1,4 +1,4 @@ -% CAGEBREAK-CONFIG(1) Version 1.3.2 | Cagebreak Manual +% CAGEBREAK-CONFIG(1) Version 1.3.3 | Cagebreak Manual # NAME diff --git a/man/cagebreak.1.md b/man/cagebreak.1.md index 3445932..0ae8733 100644 --- a/man/cagebreak.1.md +++ b/man/cagebreak.1.md @@ -1,4 +1,4 @@ -% CAGEBREAK(1) Version 1.3.2 | Cagebreak Manual +% CAGEBREAK(1) Version 1.3.3 | Cagebreak Manual # NAME diff --git a/meson.build b/meson.build index decd4b7..39876e0 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('cagebreak', 'c', - version: '1.3.2', + version: '1.3.3', license: 'MIT', default_options: [ 'c_std=c11', diff --git a/parse.c b/parse.c index 59663e9..ff1f8c0 100644 --- a/parse.c +++ b/parse.c @@ -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; } diff --git a/view.c b/view.c index d1483c4..167ed7e 100644 --- a/view.c +++ b/view.c @@ -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+child->view->ox, y+child->view->oy, false); + view_damage_child(child, x + child->view->ox, y + child->view->oy, false); } static void @@ -120,7 +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=*y=0; + *x = *y = 0; if(child->parent && child->parent->get_coords) { int sx, sy; diff --git a/xdg_shell.c b/xdg_shell.c index 1cd349d..a6d850c 100644 --- a/xdg_shell.c +++ b/xdg_shell.c @@ -61,8 +61,8 @@ xdg_popup_destroy(struct cg_view_child *child) { 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; + 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); wl_list_remove(&popup->unmap.link);