aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/xwayland.c
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-03-30 13:18:50 -0400
committerLibravatar emersion <contact@emersion.fr>2018-03-30 17:16:35 -0400
commita776ecbb860608e0f75430a53ea75a6ed19ac746 (patch)
treef664978ac74c3fc13993ed709cc1015c025d3344 /sway/desktop/xwayland.c
parentMerge pull request #1667 from emersion/wlroots-xwayland-map (diff)
downloadsway-a776ecbb860608e0f75430a53ea75a6ed19ac746.tar.gz
sway-a776ecbb860608e0f75430a53ea75a6ed19ac746.tar.zst
sway-a776ecbb860608e0f75430a53ea75a6ed19ac746.zip
Add lite damage tracking
This skips the renderer if nothing has changed, and renders everything otherwise.
Diffstat (limited to 'sway/desktop/xwayland.c')
-rw-r--r--sway/desktop/xwayland.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index dfc54e86..79c675a0 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -14,10 +14,10 @@
14#include "sway/input/input-manager.h" 14#include "sway/input/input-manager.h"
15#include "log.h" 15#include "log.h"
16 16
17 static bool assert_xwayland(struct sway_view *view) { 17static bool assert_xwayland(struct sway_view *view) {
18 return sway_assert(view->type == SWAY_XWAYLAND_VIEW && view->wlr_xwayland_surface, 18 return sway_assert(view->type == SWAY_XWAYLAND_VIEW,
19 "Expected xwayland view!"); 19 "Expected xwayland view!");
20 } 20}
21 21
22static const char *get_prop(struct sway_view *view, enum sway_view_prop prop) { 22static const char *get_prop(struct sway_view *view, enum sway_view_prop prop) {
23 if (!assert_xwayland(view)) { 23 if (!assert_xwayland(view)) {
@@ -99,6 +99,7 @@ static void handle_commit(struct wl_listener *listener, void *data) {
99 // TODO: Let floating views do whatever 99 // TODO: Let floating views do whatever
100 view->width = sway_surface->pending_width; 100 view->width = sway_surface->pending_width;
101 view->height = sway_surface->pending_height; 101 view->height = sway_surface->pending_height;
102 view_damage_from(view);
102} 103}
103 104
104static void handle_destroy(struct wl_listener *listener, void *data) { 105static void handle_destroy(struct wl_listener *listener, void *data) {
@@ -117,7 +118,7 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
117static void handle_unmap(struct wl_listener *listener, void *data) { 118static void handle_unmap(struct wl_listener *listener, void *data) {
118 struct sway_xwayland_surface *sway_surface = 119 struct sway_xwayland_surface *sway_surface =
119 wl_container_of(listener, sway_surface, unmap); 120 wl_container_of(listener, sway_surface, unmap);
120 121 view_damage_whole(sway_surface->view);
121 wl_list_remove(&sway_surface->view->unmanaged_view_link); 122 wl_list_remove(&sway_surface->view->unmanaged_view_link);
122 wl_list_init(&sway_surface->view->unmanaged_view_link); 123 wl_list_init(&sway_surface->view->unmanaged_view_link);
123 container_view_destroy(sway_surface->view->swayc); 124 container_view_destroy(sway_surface->view->swayc);
@@ -150,6 +151,8 @@ static void handle_map(struct wl_listener *listener, void *data) {
150 arrange_windows(cont->parent, -1, -1); 151 arrange_windows(cont->parent, -1, -1);
151 sway_input_manager_set_focus(input_manager, cont); 152 sway_input_manager_set_focus(input_manager, cont);
152 } 153 }
154
155 view_damage_whole(sway_surface->view);
153} 156}
154 157
155static void handle_configure_request(struct wl_listener *listener, void *data) { 158static void handle_configure_request(struct wl_listener *listener, void *data) {