devilhorns pushed a commit to branch master.
commit 809144780e79387b0dfa55abd117fa0bb8d0a627
Author: Chris Michael <[email protected]>
Date: Tue Apr 30 14:53:42 2013 +0100
Fix some formatting.
Reduce duplicated code in ecore_evas_wl_resize and just call the
_common_resize function
Fix segfault on elm app closing
Signed-off-by: Chris Michael <[email protected]>
---
.../engines/wayland/ecore_evas_wayland_shm.c | 94 +++++-----------------
1 file changed, 18 insertions(+), 76 deletions(-)
diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c
b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c
index f25c9a2..080b9ed 100644
--- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c
+++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_shm.c
@@ -189,7 +189,8 @@ ecore_evas_wayland_shm_new_internal(const char *disp_name,
unsigned int parent,
wdata->win =
ecore_wl_window_new(p, x, y, w, h, ECORE_WL_WINDOW_BUFFER_TYPE_SHM);
ee->prop.window = wdata->win->id;
- ecore_wl_window_state_changed_cb_set(wdata->win,
_ecore_evas_wl_common_state_change, ee);
+ ecore_wl_window_state_changed_cb_set(wdata->win,
+ _ecore_evas_wl_common_state_change,
ee);
if ((einfo = (Evas_Engine_Info_Wayland_Shm
*)evas_engine_info_get(ee->evas)))
{
@@ -249,92 +250,32 @@ static void
_ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h)
{
Ecore_Evas_Engine_Wl_Data *wdata;
- int orig_w, orig_h;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ee) return;
- if (w < 1) w = 1;
- if (h < 1) h = 1;
- ee->req.w = w;
- ee->req.h = h;
- orig_w = w;
- orig_h = h;
+ _ecore_evas_wl_common_resize(ee, w, h);
wdata = ee->engine.data;
- if (!ee->prop.fullscreen)
- {
- int fw = 0, fh = 0;
-
- if (ee->prop.min.w > w) w = ee->prop.min.w;
- else if (w > ee->prop.max.w) w = ee->prop.max.w;
- if (ee->prop.min.h > h) h = ee->prop.min.h;
- else if (h > ee->prop.max.h) h = ee->prop.max.h;
-
- orig_w = w;
- orig_h = h;
-
- evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
- if ((ee->rotation == 90) || (ee->rotation == 270))
- {
- w += fh;
- h += fw;
- }
- else
- {
- w += fw;
- h += fh;
- }
- }
-
- if ((ee->w != w) || (ee->h != h))
+ if (wdata->win)
{
- ee->w = orig_w;
- ee->h = orig_h;
-
- if ((ee->rotation == 90) || (ee->rotation == 270))
- {
- evas_output_size_set(ee->evas, h, w);
- evas_output_viewport_set(ee->evas, 0, 0, h, w);
- }
- else
- {
- evas_output_size_set(ee->evas, w, h);
- evas_output_viewport_set(ee->evas, 0, 0, w, h);
- }
-
- if (ee->prop.avoid_damage)
- {
- int pdam = 0;
-
- pdam = ecore_evas_avoid_damage_get(ee);
- ecore_evas_avoid_damage_set(ee, 0);
- ecore_evas_avoid_damage_set(ee, pdam);
- }
-
- if (wdata->frame)
- evas_object_resize(wdata->frame, w, h);
-
- if (wdata->win)
- {
- Ecore_Wl_Window *win;
- Evas_Engine_Info_Wayland_Shm *einfo;
+ Ecore_Wl_Window *win;
+ Evas_Engine_Info_Wayland_Shm *einfo;
- win = wdata->win;
+ win = wdata->win;
- if ((einfo = (Evas_Engine_Info_Wayland_Shm
*)evas_engine_info_get(ee->evas)))
- einfo->info.edges = win->edges;
+ if ((einfo = (Evas_Engine_Info_Wayland_Shm
*)evas_engine_info_get(ee->evas)))
+ einfo->info.edges = win->edges;
- win->edges = 0;
+ win->edges = 0;
- win->server_allocation = win->allocation;
- ecore_wl_window_update_size(wdata->win, w, h);
- }
-
- if (ee->func.fn_resize) ee->func.fn_resize(ee);
+ win->server_allocation = win->allocation;
+ ecore_wl_window_update_size(wdata->win, w, h);
}
+
+ if (ee->func.fn_resize) ee->func.fn_resize(ee);
}
static void
@@ -362,9 +303,7 @@ _ecore_evas_wl_rotation_set(Ecore_Evas *ee, int rotation,
int resize)
return;
einfo->info.rotation = rotation;
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
- {
- ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
- }
+ ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
_ecore_evas_wl_common_rotation_set(ee, rotation, resize);
}
@@ -425,6 +364,8 @@ _ecore_evas_wl_hide(Ecore_Evas *ee)
if ((!ee) || (!ee->visible)) return;
wdata = ee->engine.data;
+ evas_sync(ee->evas);
+
einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas);
if (einfo)
{
@@ -519,6 +460,7 @@ _ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location)
if (!ee) return;
wdata = ee->engine.data;
+
if (wdata->win)
{
int fw, fh;
--
------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1