summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2016-01-21 14:29:10 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2016-02-02 13:35:55 -0500
commitf4c3d3eae80ca92fc445904fc2f6c11d6e295c6e (patch)
tree9f013dfdd7048f150bb27ac5e9f38a1efd573691
parent3535581b2c1987dea7066871ce5edf75fa244822 (diff)
unify client mouse action ending
the code for this in most places was identical, but in some places it was not, leading to behavior inconsistencies and potentially dangling objects
-rw-r--r--src/bin/e_client.c49
1 files changed, 16 insertions, 33 deletions
diff --git a/src/bin/e_client.c b/src/bin/e_client.c
index 28191e947..9100f474b 100644
--- a/src/bin/e_client.c
+++ b/src/bin/e_client.c
@@ -413,6 +413,17 @@ _e_client_action_finish(void)
413} 413}
414 414
415static void 415static void
416_e_client_mouse_action_end(E_Client *ec)
417{
418 if (!ec->cur_mouse_action) return;
419 if (ec->cur_mouse_action->func.end_mouse)
420 ec->cur_mouse_action->func.end_mouse(E_OBJECT(ec), "", NULL);
421 else if (ec->cur_mouse_action->func.end)
422 ec->cur_mouse_action->func.end(E_OBJECT(ec), "");
423 E_FREE_FUNC(ec->cur_mouse_action, e_object_unref);
424}
425
426static void
416_e_client_revert_focus(E_Client *ec) 427_e_client_revert_focus(E_Client *ec)
417{ 428{
418 E_Client *pec; 429 E_Client *pec;
@@ -586,11 +597,7 @@ _e_client_del(E_Client *ec)
586 ec->exe_inst = NULL; 597 ec->exe_inst = NULL;
587 } 598 }
588 599
589 if (ec->cur_mouse_action) 600 _e_client_mouse_action_end(ec);
590 {
591 if (ec->cur_mouse_action->func.end)
592 ec->cur_mouse_action->func.end(E_OBJECT(ec), "");
593 }
594 if (action_client == ec) _e_client_action_finish(); 601 if (action_client == ec) _e_client_action_finish();
595 e_pointer_type_pop(e_comp->pointer, ec, NULL); 602 e_pointer_type_pop(e_comp->pointer, ec, NULL);
596 603
@@ -1388,14 +1395,7 @@ _e_client_cb_evas_hide(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UN
1388 1395
1389 if (stopping) return; //ignore all of this if we're shutting down! 1396 if (stopping) return; //ignore all of this if we're shutting down!
1390 if (e_object_is_del(data)) return; //client is about to die 1397 if (e_object_is_del(data)) return; //client is about to die
1391 if (ec->cur_mouse_action) 1398 _e_client_mouse_action_end(ec);
1392 {
1393 if (ec->cur_mouse_action->func.end_mouse)
1394 ec->cur_mouse_action->func.end_mouse(E_OBJECT(ec), "", NULL);
1395 else if (ec->cur_mouse_action->func.end)
1396 ec->cur_mouse_action->func.end(E_OBJECT(ec), "");
1397 E_FREE_FUNC(ec->cur_mouse_action, e_object_unref);
1398 }
1399 if (action_client == ec) _e_client_action_finish(); 1399 if (action_client == ec) _e_client_action_finish();
1400 e_pointer_type_pop(e_comp->pointer, ec, NULL); 1400 e_pointer_type_pop(e_comp->pointer, ec, NULL);
1401 1401
@@ -2905,14 +2905,7 @@ e_client_mouse_up(E_Client *ec, int button, Evas_Point *output, E_Binding_Event_
2905 /* also we don't pass the same params that went in - then again that */ 2905 /* also we don't pass the same params that went in - then again that */
2906 /* should be ok as we are just ending the action if it has an end */ 2906 /* should be ok as we are just ending the action if it has an end */
2907 if (ec->cur_mouse_action) 2907 if (ec->cur_mouse_action)
2908 { 2908 _e_client_mouse_action_end(ec);
2909 if (ec->cur_mouse_action->func.end_mouse)
2910 ec->cur_mouse_action->func.end_mouse(E_OBJECT(ec), "", ev);
2911 else if (ec->cur_mouse_action->func.end)
2912 ec->cur_mouse_action->func.end(E_OBJECT(ec), "");
2913 e_object_unref(E_OBJECT(ec->cur_mouse_action));
2914 ec->cur_mouse_action = NULL;
2915 }
2916 else 2909 else
2917 { 2910 {
2918 if (!e_bindings_mouse_up_event_handle(E_BINDING_CONTEXT_WINDOW, E_OBJECT(ec), ev)) 2911 if (!e_bindings_mouse_up_event_handle(E_BINDING_CONTEXT_WINDOW, E_OBJECT(ec), ev))
@@ -4587,12 +4580,7 @@ e_client_move_cancel(void)
4587 4580
4588 ec = ecmove; 4581 ec = ecmove;
4589 e_object_ref(E_OBJECT(ec)); 4582 e_object_ref(E_OBJECT(ec));
4590 if (ec->cur_mouse_action->func.end_mouse) 4583 _e_client_mouse_action_end(ec);
4591 ec->cur_mouse_action->func.end_mouse(E_OBJECT(ec), "", NULL);
4592 else if (ec->cur_mouse_action->func.end)
4593 ec->cur_mouse_action->func.end(E_OBJECT(ec), "");
4594 e_object_unref(E_OBJECT(ec->cur_mouse_action));
4595 ec->cur_mouse_action = NULL;
4596 e_object_unref(E_OBJECT(ec)); 4584 e_object_unref(E_OBJECT(ec));
4597 } 4585 }
4598 else 4586 else
@@ -4609,12 +4597,7 @@ e_client_resize_cancel(void)
4609 4597
4610 ec = ecresize; 4598 ec = ecresize;
4611 e_object_ref(E_OBJECT(ec)); 4599 e_object_ref(E_OBJECT(ec));
4612 if (ec->cur_mouse_action->func.end_mouse) 4600 _e_client_mouse_action_end(ec);
4613 ec->cur_mouse_action->func.end_mouse(E_OBJECT(ec), "", NULL);
4614 else if (ec->cur_mouse_action->func.end)
4615 ec->cur_mouse_action->func.end(E_OBJECT(ec), "");
4616 e_object_unref(E_OBJECT(ec->cur_mouse_action));
4617 ec->cur_mouse_action = NULL;
4618 e_object_unref(E_OBJECT(ec)); 4601 e_object_unref(E_OBJECT(ec));
4619 } 4602 }
4620 else 4603 else