aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/elementary/elm_win.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-03-25 15:11:38 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-03-25 15:11:38 +0900
commit1c2a5cec93133c7a372e238db4a474e8d27168b2 (patch)
tree60b63a4e6eaf663cf0cac489b1f6ab7b6a56f189 /src/lib/elementary/elm_win.c
parentelm theme: do some slickening up of shadows (diff)
downloadefl-1c2a5cec93133c7a372e238db4a474e8d27168b2.tar.gz
elm: fix window resize self-trigger
so there was/is a case where when an elm window is resized from outside, it will happen to use the last known size (maybe old) and end up requesting a resize to that size again itself. it basically triggers its own resize request as a result of resize events. this fixes that and stops the loop @fix
Diffstat (limited to 'src/lib/elementary/elm_win.c')
-rw-r--r--src/lib/elementary/elm_win.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/lib/elementary/elm_win.c b/src/lib/elementary/elm_win.c
index e7cbb7f304..00f9d1cdf1 100644
--- a/src/lib/elementary/elm_win.c
+++ b/src/lib/elementary/elm_win.c
@@ -212,6 +212,7 @@ struct _Elm_Win_Data
int size_step_w, size_step_h;
int norender;
int modal_count;
+ int response;
Eina_Bool urgent : 1;
Eina_Bool modal : 1;
Eina_Bool demand_attention : 1;
@@ -807,7 +808,9 @@ _elm_win_move(Ecore_Evas *ee)
sd->screen.y = y;
eo_event_callback_call(sd->obj, ELM_WIN_EVENT_MOVED, NULL);
evas_nochange_push(evas_object_evas_get(sd->obj));
+ sd->response++;
evas_object_move(sd->obj, x, y);
+ sd->response--;
evas_nochange_pop(evas_object_evas_get(sd->obj));
}
@@ -835,9 +838,10 @@ _elm_win_resize_job(void *data)
evas_object_move(sd->frame_obj, -fx, -fy);
evas_object_resize(sd->frame_obj, w + fw, h + fh);
}
-
+ sd->response++;
evas_object_resize(sd->obj, w, h);
evas_object_resize(sd->edje, w, h);
+ sd->response--;
}
static void
@@ -2065,7 +2069,7 @@ _elm_win_evas_object_smart_move(Eo *obj, Elm_Win_Data *sd, Evas_Coord x, Evas_Co
}
else
{
- TRAP(sd, move, x, y);
+ if (!sd->response) TRAP(sd, move, x, y);
if (!ecore_evas_override_get(sd->ee)) return;
}
@@ -2113,7 +2117,7 @@ _elm_win_evas_object_smart_resize(Eo *obj, Elm_Win_Data *sd, Evas_Coord w, Evas_
evas_object_image_size_set(sd->img_obj, w, h);
}
- TRAP(sd, resize, w, h);
+ if (!sd->response) TRAP(sd, resize, w, h);
}
static void
@@ -2456,7 +2460,10 @@ _elm_win_resize_objects_eval(Evas_Object *obj)
if (w > maxw) w = maxw;
if (h > maxh) h = maxh;
if (sd->img_obj) evas_object_resize(obj, w, h);
- else TRAP(sd, resize, w, h);
+ else
+ {
+ if (!sd->response) TRAP(sd, resize, w, h);
+ }
}
static void