aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/elementary
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
commit14e63d0a71fc680917a364254592a846c40950ca (patch)
treec9be324d04aa73744e9e9a4fa54b45280205489d /legacy/elementary
parentelm: Fixed formatting about smart_event check for code consistency. (diff)
downloadefl-14e63d0a71fc680917a364254592a846c40950ca.tar.gz
elm/win: Put framespace set code in a common place.
A little refactory that hopefully will prevent future mistakes when changing this code.
Diffstat (limited to 'legacy/elementary')
-rw-r--r--legacy/elementary/src/lib/elm_win.c45
1 files changed, 17 insertions, 28 deletions
diff --git a/legacy/elementary/src/lib/elm_win.c b/legacy/elementary/src/lib/elm_win.c
index 5bfc452188..fa41545d65 100644
--- a/legacy/elementary/src/lib/elm_win.c
+++ b/legacy/elementary/src/lib/elm_win.c
@@ -2199,25 +2199,18 @@ static struct _resize_info _border_corner[4] =
#endif
static void
-_elm_win_frame_obj_move(void *data,
- Evas *e __UNUSED__,
- Evas_Object *obj __UNUSED__,
- void *event_info __UNUSED__)
+_elm_win_frame_obj_update(Elm_Win_Smart_Data *sd)
{
- Elm_Win_Smart_Data *sd;
int fx, fy, fw, fh;
int ox, oy, ow, oh;
int sx, sy, sw, sh;
int x, y, w, h;
-
- if (!(sd = data)) return;
- if (!sd->client_obj) return;
-
evas_object_geometry_get(sd->frame_obj, &fx, &fy, &fw, &fh);
evas_object_geometry_get(sd->client_obj, &ox, &oy, &ow, &oh);
evas_object_geometry_get(sd->spacer_obj, &sx, &sy, &sw, &sh);
evas_output_framespace_get(sd->evas, &x, &y, &w, &h);
+
if ((x != (ox - fx)) || (y != (oy - fy)) ||
(w != (fw - ow)) || (h != (fh - oh)))
{
@@ -2231,35 +2224,31 @@ _elm_win_frame_obj_move(void *data,
}
static void
+_elm_win_frame_obj_move(void *data,
+ Evas *e __UNUSED__,
+ Evas_Object *obj __UNUSED__,
+ void *event_info __UNUSED__)
+{
+ Elm_Win_Smart_Data *sd;
+
+ if (!(sd = data)) return;
+ if (!sd->client_obj) return;
+
+ _elm_win_frame_obj_update(sd);
+}
+
+static void
_elm_win_frame_obj_resize(void *data,
Evas *e __UNUSED__,
Evas_Object *obj __UNUSED__,
void *event_info __UNUSED__)
{
Elm_Win_Smart_Data *sd;
- int fx, fy, fw, fh;
- int ox, oy, ow, oh;
- int sx, sy, sw, sh;
- int x, y, w, h;
if (!(sd = data)) return;
if (!sd->client_obj) return;
- evas_object_geometry_get(sd->frame_obj, &fx, &fy, &fw, &fh);
- evas_object_geometry_get(sd->client_obj, &ox, &oy, &ow, &oh);
- evas_object_geometry_get(sd->spacer_obj, &sx, &sy, &sw, &sh);
-
- evas_output_framespace_get(sd->evas, &x, &y, &w, &h);
- if ((x != (ox - fx)) || (y != (oy - fy)) ||
- (w != (fw - ow)) || (h != (fh - oh)))
- {
- evas_output_framespace_set(sd->evas, (ox - fx), (oy - fy),
- (fw - ow), (fh - oh));
- }
-
-#ifdef HAVE_ELEMENTARY_WAYLAND
- ecore_wl_window_opaque_region_set(sd->wl.win, -fx, -(fy - sy), sw, sh);
-#endif
+ _elm_win_frame_obj_update(sd);
}
static void