aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/xwayland.c
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-04-05 17:37:24 -0400
committerLibravatar emersion <contact@emersion.fr>2018-04-05 17:39:17 -0400
commit1c91d0c10ffbed14cafaba79276a14f55172b7eb (patch)
treecd4e9e420f6765d6643a41528367fcddef13453e /sway/desktop/xwayland.c
parentHandle xwayland configure requests for unmanaged surfaces (diff)
downloadsway-1c91d0c10ffbed14cafaba79276a14f55172b7eb.tar.gz
sway-1c91d0c10ffbed14cafaba79276a14f55172b7eb.tar.zst
sway-1c91d0c10ffbed14cafaba79276a14f55172b7eb.zip
Add damage tracking for xwayland unmanaged surfaces
Diffstat (limited to 'sway/desktop/xwayland.c')
-rw-r--r--sway/desktop/xwayland.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index 3842c2c8..4797b801 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -2,17 +2,18 @@
2#include <stdbool.h> 2#include <stdbool.h>
3#include <stdlib.h> 3#include <stdlib.h>
4#include <wayland-server.h> 4#include <wayland-server.h>
5#include <wlr/xwayland.h>
6#include <wlr/types/wlr_output_layout.h> 5#include <wlr/types/wlr_output_layout.h>
7#include <wlr/types/wlr_output.h> 6#include <wlr/types/wlr_output.h>
7#include <wlr/xwayland.h>
8#include "log.h"
9#include "sway/desktop.h"
10#include "sway/input/input-manager.h"
11#include "sway/input/seat.h"
12#include "sway/output.h"
13#include "sway/server.h"
8#include "sway/tree/container.h" 14#include "sway/tree/container.h"
9#include "sway/tree/layout.h" 15#include "sway/tree/layout.h"
10#include "sway/server.h"
11#include "sway/tree/view.h" 16#include "sway/tree/view.h"
12#include "sway/output.h"
13#include "sway/input/seat.h"
14#include "sway/input/input-manager.h"
15#include "log.h"
16 17
17static void unmanaged_handle_request_configure(struct wl_listener *listener, 18static void unmanaged_handle_request_configure(struct wl_listener *listener,
18 void *data) { 19 void *data) {
@@ -27,7 +28,9 @@ static void unmanaged_handle_request_configure(struct wl_listener *listener,
27static void unmanaged_handle_commit(struct wl_listener *listener, void *data) { 28static void unmanaged_handle_commit(struct wl_listener *listener, void *data) {
28 struct sway_xwayland_unmanaged *surface = 29 struct sway_xwayland_unmanaged *surface =
29 wl_container_of(listener, surface, commit); 30 wl_container_of(listener, surface, commit);
30 // TODO: damage tracking 31 struct wlr_xwayland_surface *xsurface = surface->wlr_xwayland_surface;
32 desktop_damage_from_surface(xsurface->surface, xsurface->x, xsurface->y);
33 // TODO: handle window motion
31} 34}
32 35
33static void unmanaged_handle_map(struct wl_listener *listener, void *data) { 36static void unmanaged_handle_map(struct wl_listener *listener, void *data) {
@@ -38,15 +41,16 @@ static void unmanaged_handle_map(struct wl_listener *listener, void *data) {
38 &surface->link); 41 &surface->link);
39 wl_signal_add(&xsurface->surface->events.commit, &surface->commit); 42 wl_signal_add(&xsurface->surface->events.commit, &surface->commit);
40 surface->commit.notify = unmanaged_handle_commit; 43 surface->commit.notify = unmanaged_handle_commit;
41 // TODO: damage tracking 44 desktop_damage_whole_surface(xsurface->surface, xsurface->x, xsurface->y);
42} 45}
43 46
44static void unmanaged_handle_unmap(struct wl_listener *listener, void *data) { 47static void unmanaged_handle_unmap(struct wl_listener *listener, void *data) {
45 struct sway_xwayland_unmanaged *surface = 48 struct sway_xwayland_unmanaged *surface =
46 wl_container_of(listener, surface, unmap); 49 wl_container_of(listener, surface, unmap);
50 struct wlr_xwayland_surface *xsurface = surface->wlr_xwayland_surface;
51 desktop_damage_whole_surface(xsurface->surface, xsurface->x, xsurface->y);
47 wl_list_remove(&surface->link); 52 wl_list_remove(&surface->link);
48 wl_list_remove(&surface->commit.link); 53 wl_list_remove(&surface->commit.link);
49 // TODO: damage tracking
50} 54}
51 55
52static void unmanaged_handle_destroy(struct wl_listener *listener, void *data) { 56static void unmanaged_handle_destroy(struct wl_listener *listener, void *data) {