aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/output.c
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2018-01-14 10:47:19 -0500
committerLibravatar Tony Crisci <tony@dubstepdish.com>2018-01-14 10:47:19 -0500
commit76ce62919830b2917c696f599e7710ce05d109c0 (patch)
tree3bc06a2cafc611dd436ec8a8255452a63ff81cfe /sway/desktop/output.c
parentrender xdg surface (diff)
downloadsway-76ce62919830b2917c696f599e7710ce05d109c0.tar.gz
sway-76ce62919830b2917c696f599e7710ce05d109c0.tar.zst
sway-76ce62919830b2917c696f599e7710ce05d109c0.zip
xdg-popups
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r--sway/desktop/output.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index 1e9a823a..9182f8d5 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -118,6 +118,33 @@ static void render_surface(struct wlr_surface *surface,
118 } 118 }
119} 119}
120 120
121static void render_xdg_v6_popups(struct wlr_xdg_surface_v6 *surface,
122 struct wlr_output *wlr_output, struct timespec *when, double base_x,
123 double base_y, float rotation) {
124 double width = surface->surface->current->width;
125 double height = surface->surface->current->height;
126
127 struct wlr_xdg_surface_v6 *popup;
128 wl_list_for_each(popup, &surface->popups, popup_link) {
129 if (!popup->configured) {
130 continue;
131 }
132
133 double popup_width = popup->surface->current->width;
134 double popup_height = popup->surface->current->height;
135
136 double popup_sx, popup_sy;
137 wlr_xdg_surface_v6_popup_get_position(popup, &popup_sx, &popup_sy);
138 rotate_child_position(&popup_sx, &popup_sy, popup_width, popup_height,
139 width, height, rotation);
140
141 render_surface(popup->surface, wlr_output, when,
142 base_x + popup_sx, base_y + popup_sy, rotation);
143 render_xdg_v6_popups(popup, wlr_output, when,
144 base_x + popup_sx, base_y + popup_sy, rotation);
145 }
146}
147
121static void output_frame_view(swayc_t *view, void *data) { 148static void output_frame_view(swayc_t *view, void *data) {
122 struct sway_output *output = data; 149 struct sway_output *output = data;
123 struct wlr_output *wlr_output = output->wlr_output; 150 struct wlr_output *wlr_output = output->wlr_output;
@@ -132,6 +159,10 @@ static void output_frame_view(swayc_t *view, void *data) {
132 view->x - window_offset_x, 159 view->x - window_offset_x,
133 view->y - window_offset_y, 160 view->y - window_offset_y,
134 0); 161 0);
162 render_xdg_v6_popups(sway_view->wlr_xdg_surface_v6, wlr_output,
163 &output->last_frame,
164 view->x - window_offset_x, view->y - window_offset_y,
165 0);
135 break; 166 break;
136 } 167 }
137 case SWAY_WL_SHELL_VIEW: 168 case SWAY_WL_SHELL_VIEW: