path: root/legacy/elementary/src/lib/elm_win.c
diff options
authorChristopher Michael <cpmichael1@comcast.net>2012-08-06 14:34:25 +0000
committerChristopher Michael <cpmichael1@comcast.net>2012-08-06 14:34:25 +0000
commit0d4d37e8075809a5bfa327c8bf961738bd418f84 (patch)
tree4740c172fb6b9d415f9291c31508eba9f670995c /legacy/elementary/src/lib/elm_win.c
parentElm: Do not need to get frame x/y values here as we do not need them (diff)
Elm: Fix ticket #1266: "delete,request" callback never gets called on window close
Delete requests where not being called when the frame close button was pressed. I know this is not the 'ideal' fix (which is why I left myself a FIXME here), HOWEVER the Ideal fix would mean breaking the Feature Freeze (and potentially API), so I will wait until freeze is over for that. For now, this fixes the 'bugger' in a non-instrusive way. SVN revision: 74946
Diffstat (limited to 'legacy/elementary/src/lib/elm_win.c')
1 files changed, 25 insertions, 1 deletions
diff --git a/legacy/elementary/src/lib/elm_win.c b/legacy/elementary/src/lib/elm_win.c
index c91ad23092..63a5f7e781 100644
--- a/legacy/elementary/src/lib/elm_win.c
+++ b/legacy/elementary/src/lib/elm_win.c
@@ -1909,9 +1909,33 @@ _elm_win_frame_cb_close(void *data,
const char *source __UNUSED__)
Elm_Win_Smart_Data *sd;
+ Evas_Object *win;
+ /* FIXME: After the current freeze, this should be handled differently.
+ *
+ * Ideally, we would want to mimic the X11 backend and use something
+ * like ECORE_WL_EVENT_WINDOW_DELETE and handle the delete_request
+ * inside of ecore_evas. That would be the 'proper' way, but since we are
+ * in a freeze right now, I cannot add a new event value, or a new
+ * event structure to ecore_wayland.
+ *
+ * So yes, this is a temporary 'stop-gap' solution which will be fixed
+ * when the freeze is over, but it does fix a trac bug for now, and in a
+ * way which does not break API or the freeze. - dh
+ */
if (!(sd = data)) return;
- evas_object_del(ELM_WIDGET_DATA(sd)->obj);
+ win = ELM_WIDGET_DATA(sd)->obj;
+ int autodel = sd->autodel;
+ sd->autodel_clear = &autodel;
+ evas_object_ref(win);
+ evas_object_smart_callback_call(win, SIG_DELETE_REQUEST, NULL);
+ // FIXME: if above callback deletes - then the below will be invalid
+ if (autodel) evas_object_del(win);
+ else sd->autodel_clear = NULL;
+ evas_object_unref(win);
static void