diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-03-31 11:40:34 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-31 11:40:34 -0400 |
commit | 89ca6676bedca3580a2db45a2f60f34c136cd3d0 (patch) | |
tree | 8131a6e50f159d30b6bc936384fdd3fb460e95b3 /sway/desktop/xwayland.c | |
parent | Merge pull request #1677 from emersion/maximize-xwayland-views (diff) | |
parent | Fix xwayland configure in set_size (diff) | |
download | sway-89ca6676bedca3580a2db45a2f60f34c136cd3d0.tar.gz sway-89ca6676bedca3580a2db45a2f60f34c136cd3d0.tar.zst sway-89ca6676bedca3580a2db45a2f60f34c136cd3d0.zip |
Merge pull request #1681 from emersion/xwayland-configure-position
Fix various xwayland issues
Diffstat (limited to 'sway/desktop/xwayland.c')
-rw-r--r-- | sway/desktop/xwayland.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c index 83e97a4b..273ca2bf 100644 --- a/sway/desktop/xwayland.c +++ b/sway/desktop/xwayland.c | |||
@@ -41,7 +41,7 @@ static void set_size(struct sway_view *view, int width, int height) { | |||
41 | view->sway_xwayland_surface->pending_height = height; | 41 | view->sway_xwayland_surface->pending_height = height; |
42 | 42 | ||
43 | struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface; | 43 | struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface; |
44 | wlr_xwayland_surface_configure(xsurface, view->swayc->x, view->swayc->y, | 44 | wlr_xwayland_surface_configure(xsurface, xsurface->x, xsurface->y, |
45 | width, height); | 45 | width, height); |
46 | } | 46 | } |
47 | 47 | ||
@@ -67,13 +67,10 @@ static void set_position(struct sway_view *view, double ox, double oy) { | |||
67 | view->swayc->x = ox; | 67 | view->swayc->x = ox; |
68 | view->swayc->y = oy; | 68 | view->swayc->y = oy; |
69 | 69 | ||
70 | if (view->width == 0 || view->height == 0) { | ||
71 | return; | ||
72 | } | ||
73 | |||
74 | wlr_xwayland_surface_configure(view->wlr_xwayland_surface, | 70 | wlr_xwayland_surface_configure(view->wlr_xwayland_surface, |
75 | ox + loutput->x, oy + loutput->y, | 71 | ox + loutput->x, oy + loutput->y, |
76 | view->width, view->height); | 72 | view->wlr_xwayland_surface->width, |
73 | view->wlr_xwayland_surface->height); | ||
77 | } | 74 | } |
78 | 75 | ||
79 | static void set_activated(struct sway_view *view, bool activated) { | 76 | static void set_activated(struct sway_view *view, bool activated) { |
@@ -157,7 +154,7 @@ static void handle_map(struct wl_listener *listener, void *data) { | |||
157 | view_damage_whole(sway_surface->view); | 154 | view_damage_whole(sway_surface->view); |
158 | } | 155 | } |
159 | 156 | ||
160 | static void handle_configure_request(struct wl_listener *listener, void *data) { | 157 | static void handle_request_configure(struct wl_listener *listener, void *data) { |
161 | struct sway_xwayland_surface *sway_surface = | 158 | struct sway_xwayland_surface *sway_surface = |
162 | wl_container_of(listener, sway_surface, request_configure); | 159 | wl_container_of(listener, sway_surface, request_configure); |
163 | struct wlr_xwayland_surface_configure_event *ev = data; | 160 | struct wlr_xwayland_surface_configure_event *ev = data; |
@@ -212,7 +209,7 @@ void handle_xwayland_surface(struct wl_listener *listener, void *data) { | |||
212 | 209 | ||
213 | wl_signal_add(&xsurface->events.request_configure, | 210 | wl_signal_add(&xsurface->events.request_configure, |
214 | &sway_surface->request_configure); | 211 | &sway_surface->request_configure); |
215 | sway_surface->request_configure.notify = handle_configure_request; | 212 | sway_surface->request_configure.notify = handle_request_configure; |
216 | 213 | ||
217 | wl_signal_add(&xsurface->events.unmap, &sway_surface->unmap); | 214 | wl_signal_add(&xsurface->events.unmap, &sway_surface->unmap); |
218 | sway_surface->unmap.notify = handle_unmap; | 215 | sway_surface->unmap.notify = handle_unmap; |