summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Antognolli <rafael.antognolli@intel.com>2013-10-29 08:42:41 -0200
committerRafael Antognolli <rafael.antognolli@intel.com>2013-10-29 09:20:48 -0200
commite1ebba54bd57819dd1c50347f0a2e5d562505d1a (patch)
treea7f25c3f4a30275ec939c7ffe68c880eb2abdfdc
parentfa0371967b4543a2f8b0c48175a7e12153b95b92 (diff)
elm/win: Put framespace set code in a common place.
A little refactory that hopefully will prevent future mistakes when changing this code.
-rw-r--r--src/lib/elm_win.c45
1 files changed, 17 insertions, 28 deletions
diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c
index 5bfc45218..fa41545d6 100644
--- a/src/lib/elm_win.c
+++ b/src/lib/elm_win.c
@@ -2199,25 +2199,18 @@ static struct _resize_info _border_corner[4] =
2199#endif 2199#endif
2200 2200
2201static void 2201static void
2202_elm_win_frame_obj_move(void *data, 2202_elm_win_frame_obj_update(Elm_Win_Smart_Data *sd)
2203 Evas *e __UNUSED__,
2204 Evas_Object *obj __UNUSED__,
2205 void *event_info __UNUSED__)
2206{ 2203{
2207 Elm_Win_Smart_Data *sd;
2208 int fx, fy, fw, fh; 2204 int fx, fy, fw, fh;
2209 int ox, oy, ow, oh; 2205 int ox, oy, ow, oh;
2210 int sx, sy, sw, sh; 2206 int sx, sy, sw, sh;
2211 int x, y, w, h; 2207 int x, y, w, h;
2212
2213 if (!(sd = data)) return;
2214 if (!sd->client_obj) return;
2215
2216 evas_object_geometry_get(sd->frame_obj, &fx, &fy, &fw, &fh); 2208 evas_object_geometry_get(sd->frame_obj, &fx, &fy, &fw, &fh);
2217 evas_object_geometry_get(sd->client_obj, &ox, &oy, &ow, &oh); 2209 evas_object_geometry_get(sd->client_obj, &ox, &oy, &ow, &oh);
2218 evas_object_geometry_get(sd->spacer_obj, &sx, &sy, &sw, &sh); 2210 evas_object_geometry_get(sd->spacer_obj, &sx, &sy, &sw, &sh);
2219 2211
2220 evas_output_framespace_get(sd->evas, &x, &y, &w, &h); 2212 evas_output_framespace_get(sd->evas, &x, &y, &w, &h);
2213
2221 if ((x != (ox - fx)) || (y != (oy - fy)) || 2214 if ((x != (ox - fx)) || (y != (oy - fy)) ||
2222 (w != (fw - ow)) || (h != (fh - oh))) 2215 (w != (fw - ow)) || (h != (fh - oh)))
2223 { 2216 {
@@ -2231,35 +2224,31 @@ _elm_win_frame_obj_move(void *data,
2231} 2224}
2232 2225
2233static void 2226static void
2227_elm_win_frame_obj_move(void *data,
2228 Evas *e __UNUSED__,
2229 Evas_Object *obj __UNUSED__,
2230 void *event_info __UNUSED__)
2231{
2232 Elm_Win_Smart_Data *sd;
2233
2234 if (!(sd = data)) return;
2235 if (!sd->client_obj) return;
2236
2237 _elm_win_frame_obj_update(sd);
2238}
2239
2240static void
2234_elm_win_frame_obj_resize(void *data, 2241_elm_win_frame_obj_resize(void *data,
2235 Evas *e __UNUSED__, 2242 Evas *e __UNUSED__,
2236 Evas_Object *obj __UNUSED__, 2243 Evas_Object *obj __UNUSED__,
2237 void *event_info __UNUSED__) 2244 void *event_info __UNUSED__)
2238{ 2245{
2239 Elm_Win_Smart_Data *sd; 2246 Elm_Win_Smart_Data *sd;
2240 int fx, fy, fw, fh;
2241 int ox, oy, ow, oh;
2242 int sx, sy, sw, sh;
2243 int x, y, w, h;
2244 2247
2245 if (!(sd = data)) return; 2248 if (!(sd = data)) return;
2246 if (!sd->client_obj) return; 2249 if (!sd->client_obj) return;
2247 2250
2248 evas_object_geometry_get(sd->frame_obj, &fx, &fy, &fw, &fh); 2251 _elm_win_frame_obj_update(sd);
2249 evas_object_geometry_get(sd->client_obj, &ox, &oy, &ow, &oh);
2250 evas_object_geometry_get(sd->spacer_obj, &sx, &sy, &sw, &sh);
2251
2252 evas_output_framespace_get(sd->evas, &x, &y, &w, &h);
2253 if ((x != (ox - fx)) || (y != (oy - fy)) ||
2254 (w != (fw - ow)) || (h != (fh - oh)))
2255 {
2256 evas_output_framespace_set(sd->evas, (ox - fx), (oy - fy),
2257 (fw - ow), (fh - oh));
2258 }
2259
2260#ifdef HAVE_ELEMENTARY_WAYLAND
2261 ecore_wl_window_opaque_region_set(sd->wl.win, -fx, -(fy - sy), sw, sh);
2262#endif
2263} 2252}
2264 2253
2265static void 2254static void