summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2018-03-27 14:58:35 -0500
committerDerek Foreman <derekf@osg.samsung.com>2018-04-11 16:29:07 -0500
commit48e0c6ea90a337a3f422a658cb826f7a548f88fd (patch)
treeed5c76a446f21e95e549e98d067732a58967bdef
parentf560c76b528753ab8a478e5a6f314838eac02221 (diff)
ecore_wl2: Fix ecore_wl2_window_output_find
Window geometry x, y are the offset from the top left corner of the buffer, and not screen co-ordinates, so has nothing to do with output geometry and can't be used to determine which window we're on. Now that we track surface enter/leave events we can just give the first output in the list of outputs we know we're on.
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_window.c35
1 files changed, 1 insertions, 34 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c
index 4398ffd824..031287500a 100644
--- a/src/lib/ecore_wl2/ecore_wl2_window.c
+++ b/src/lib/ecore_wl2/ecore_wl2_window.c
@@ -1187,42 +1187,9 @@ ecore_wl2_window_activated_get(const Ecore_Wl2_Window *window)
1187EAPI Ecore_Wl2_Output * 1187EAPI Ecore_Wl2_Output *
1188ecore_wl2_window_output_find(Ecore_Wl2_Window *window) 1188ecore_wl2_window_output_find(Ecore_Wl2_Window *window)
1189{ 1189{
1190 Ecore_Wl2_Output *out;
1191 Eina_Inlist *tmp;
1192 int x = 0, y = 0;
1193
1194 EINA_SAFETY_ON_NULL_RETURN_VAL(window, NULL); 1190 EINA_SAFETY_ON_NULL_RETURN_VAL(window, NULL);
1195 1191
1196 x = window->set_config.geometry.x; 1192 return eina_list_data_get(window->outputs);
1197 y = window->set_config.geometry.y;
1198
1199 EINA_INLIST_FOREACH_SAFE(window->display->outputs, tmp, out)
1200 {
1201 int ox, oy, ow, oh;
1202
1203 ox = out->geometry.x;
1204 oy = out->geometry.y;
1205
1206 switch (out->transform)
1207 {
1208 case WL_OUTPUT_TRANSFORM_90:
1209 case WL_OUTPUT_TRANSFORM_270:
1210 case WL_OUTPUT_TRANSFORM_FLIPPED_90:
1211 case WL_OUTPUT_TRANSFORM_FLIPPED_270:
1212 ow = out->geometry.h;
1213 oh = out->geometry.w;
1214 break;
1215 default:
1216 ow = out->geometry.w;
1217 oh = out->geometry.h;
1218 break;
1219 }
1220
1221 if (((x >= ox) && (x < ow)) && ((y >= oy) && (y < oh)))
1222 return out;
1223 }
1224
1225 return NULL;
1226} 1193}
1227 1194
1228EAPI void 1195EAPI void