diff options
author | Mike Blumenkrantz <m.blumenkran@samsung.com> | 2013-07-22 11:32:28 +0100 |
---|---|---|
committer | Mike Blumenkrantz <m.blumenkran@samsung.com> | 2013-07-22 11:32:28 +0100 |
commit | 2b67ab4646883b983b611eed6ff021b871f86a6c (patch) | |
tree | f6b64fa6581da7d71799b6cea469d14629f4ff08 | |
parent | f81f249188b03dac2d91e394231fa78ab5959882 (diff) | |
download | enlightenment-devs/discomfitor/e19-superborkagedontevenclonethisohgodwhyareyoucloningit.tar.gz |
internal wins workingdevs/discomfitor/e19-superborkagedontevenclonethisohgodwhyareyoucloningit
-rw-r--r-- | src/bin/e_comp_object.c | 8 | ||||
-rw-r--r-- | src/bin/e_comp_x.c | 96 | ||||
-rw-r--r-- | src/bin/e_win.c | 38 |
3 files changed, 86 insertions, 56 deletions
diff --git a/src/bin/e_comp_object.c b/src/bin/e_comp_object.c index 50ed9e764d..45929a7cb8 100644 --- a/src/bin/e_comp_object.c +++ b/src/bin/e_comp_object.c @@ -2488,16 +2488,18 @@ e_comp_object_redirected_set(Evas_Object *obj, Eina_Bool set) Evas_Object *o; e_pixmap_clear(cw->ec->pixmap); - evas_object_image_native_surface_set(cw->obj, NULL); - cw->native = 0; + if (cw->native) + evas_object_image_native_surface_set(cw->obj, NULL); evas_object_image_size_set(cw->obj, 1, 1); evas_object_image_data_set(cw->obj, NULL); EINA_LIST_FOREACH(cw->obj_mirror, l, o) { evas_object_image_size_set(o, 1, 1); evas_object_image_data_set(o, NULL); - evas_object_image_native_surface_set(o, NULL); + if (cw->native) + evas_object_image_native_surface_set(o, NULL); } + cw->native = 0; } } diff --git a/src/bin/e_comp_x.c b/src/bin/e_comp_x.c index 67c890d300..47e338cf83 100644 --- a/src/bin/e_comp_x.c +++ b/src/bin/e_comp_x.c @@ -63,7 +63,7 @@ static Eina_Hash *frame_extents = NULL; static Ecore_Idle_Enterer *_e_comp_x_post_client_idler = NULL; static Eina_List *post_clients = NULL; -static int _e_comp_x_mapping_change_enabled = 1; +static int _e_comp_x_mapping_change_disabled = 0; static void _e_comp_x_print_win(Ecore_X_Window win) @@ -137,7 +137,7 @@ _e_comp_x_client_new_helper(E_Client *ec) ec->icccm.accepts_focus = (!ec->override) && (!ec->input_only); ec->x = ec->client.x = ec->comp_data->initial_attributes.x; ec->y = ec->client.y = ec->comp_data->initial_attributes.y; - if ((!e_client_util_ignored_get(ec)) && (!ec->internal)) + if ((!e_client_util_ignored_get(ec)) && (!ec->internal) && (!ec->internal_ecore_evas)) { ec->comp_data->need_reparent = 1; EC_CHANGED(ec); @@ -1062,7 +1062,7 @@ _e_comp_x_show_request(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_Eve } if (ecore_x_window_parent_get(ev->win) != ec->comp->man->root) return ECORE_CALLBACK_RENEW; - if ((!ec->comp_data->reparented) && (!ec->override) && (!ec->input_only)) + if ((!ec->comp_data->reparented) && (!e_client_util_ignored_get(ec))) { if ((!ec->re_manage) && (!ec->comp_data->first_map)) { @@ -1098,11 +1098,18 @@ _e_comp_x_show(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_Event_Windo { if ((!ec->re_manage) && (!ec->comp_data->first_map) && (!ec->comp_data->reparented)) { + /* this is most likely an internal window */ if (!_e_comp_x_client_new_helper(ec)) return ECORE_CALLBACK_RENEW; + ec->comp_data->need_reparent = 1; + ec->visible = 1; + EC_CHANGED(ec); + } + if (!ec->comp_data->need_reparent) + { + e_pixmap_usable_set(ec->pixmap, 1); + ec->comp_data->first_map = 1; + evas_object_show(ec->frame); } - e_pixmap_usable_set(ec->pixmap, 1); - ec->comp_data->first_map = 1; - evas_object_show(ec->frame); } return ECORE_CALLBACK_PASS_ON; } @@ -1143,7 +1150,8 @@ _e_comp_x_hide(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_Event_Windo else { evas_object_hide(ec->frame); - e_object_del(E_OBJECT(ec)); + if (!ec->internal) + e_object_del(E_OBJECT(ec)); } return ECORE_CALLBACK_PASS_ON; } @@ -1165,13 +1173,13 @@ _e_comp_x_reparent(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_Event_W return ECORE_CALLBACK_PASS_ON; } -#if 0 -dunno why I added this static Eina_Bool _e_comp_x_configure(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_Event_Window_Configure *ev) { E_Client *ec = _e_comp_x_client_find_by_window(ev->win); Eina_Bool child; + + return ECORE_CALLBACK_RENEW; if (!ec) { E_Comp *c = e_comp_find_by_window(ev->win); @@ -1196,19 +1204,18 @@ _e_comp_x_configure(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_Event_ if (ec->input_only) return ECORE_CALLBACK_RENEW; if (!ec->override) return ECORE_CALLBACK_RENEW; - if ((ec->client.w != ev->w) || (ec->client.h != ev->h)) - e_client_resize_without_frame(ec, ev->w, ev->h); - if (ec->border_size != ev->border) - { - ec->border_size = ev->border; - e_pixmap_dirty(ec->pixmap); - e_comp_object_render_update_add(ec->frame); - } - if ((!child) && ((ec->client.x != ev->x) || (ec->client.y != ev->y))) - e_client_move_without_frame(ec, ev->x, ev->y); + //if ((ec->client.w != ev->w) || (ec->client.h != ev->h)) + //e_client_resize_without_frame(ec, ev->w, ev->h); + //if (ec->border_size != ev->border) + //{ + //ec->border_size = ev->border; + //e_pixmap_dirty(ec->pixmap); + //e_comp_object_render_update_add(ec->frame); + //} + //if ((!child) && ((ec->client.x != ev->x) || (ec->client.y != ev->y))) + //e_client_move_without_frame(ec, ev->x, ev->y); return ECORE_CALLBACK_RENEW; } -#endif static Eina_Bool _e_comp_x_configure_request(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_Event_Window_Configure_Request *ev) @@ -1797,7 +1804,7 @@ _e_comp_x_mapping_change(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_E E_Client *ec; E_Comp *c; - if (!_e_comp_x_mapping_change_enabled) return ECORE_CALLBACK_RENEW; + if (_e_comp_x_mapping_change_disabled) return ECORE_CALLBACK_RENEW; e_managers_keys_ungrab(); EINA_LIST_FOREACH(e_comp_list(), l, c) EINA_LIST_FOREACH(c->clients, ll, ec) @@ -2494,8 +2501,17 @@ _e_comp_x_hook_client_pre_frame_assign(void *d EINA_UNUSED, E_Client *ec) } e_pixmap_parent_window_set(ec->pixmap, pwin); ec->border.changed = 1; + if (!ec->shaped) + ecore_x_window_shape_mask_set(pwin, 0); + if (ec->shaped_input) + ecore_x_window_shape_input_rectangles_set(pwin, (Ecore_X_Rectangle*)ec->shape_input_rects, ec->shape_input_rects_num); ec->changes.shape = 1; ec->changes.shape_input = 1; + if (ec->internal_ecore_evas) + { + ecore_x_window_gravity_set(win, ECORE_X_GRAVITY_NW); + ec->changes.reset_gravity = 1; + } EC_CHANGED(ec); eina_hash_add(clients_win_hash, &pwin, ec); @@ -2657,8 +2673,8 @@ _e_comp_x_hook_client_fetch(void *d EINA_UNUSED, E_Client *ec) ((!e_util_strcasecmp(ec->icccm.class, "vmplayer")) || (!e_util_strcasecmp(ec->icccm.class, "vmware"))); if (ec->hacks.mapping_change) - _e_comp_x_mapping_change_enabled--; - _e_comp_x_mapping_change_enabled = MAX(_e_comp_x_mapping_change_enabled, 0); + _e_comp_x_mapping_change_disabled++; + _e_comp_x_mapping_change_disabled = MIN(_e_comp_x_mapping_change_disabled, 0); free(nname); free(nclass); @@ -3252,7 +3268,8 @@ _e_comp_x_hook_client_fetch(void *d EINA_UNUSED, E_Client *ec) EC_CHANGED(ec); } } - ecore_x_window_shape_rectangles_set(pwin, rects, num); + if (ec->comp_data->reparented) + ecore_x_window_shape_rectangles_set(pwin, rects, num); ec->changes.shape_input = 0; E_FREE(ec->shape_rects); ec->shape_rects_num = 0; @@ -3270,8 +3287,8 @@ _e_comp_x_hook_client_fetch(void *d EINA_UNUSED, E_Client *ec) } } _e_comp_x_client_shape_input_rectangle_set(ec); - if (!ec->shaped) - ecore_x_window_shape_mask_set(e_client_util_pwin_get(ec), 0); + if ((!ec->shaped) && ec->comp_data->reparented) + ecore_x_window_shape_mask_set(pwin, 0); } if (ec->changes.shape_input) { @@ -3328,7 +3345,8 @@ _e_comp_x_hook_client_fetch(void *d EINA_UNUSED, E_Client *ec) EC_CHANGED(ec); } } - ecore_x_window_shape_input_rectangles_set(pwin, rects, num); + if (ec->comp_data->reparented) + ecore_x_window_shape_input_rectangles_set(pwin, rects, num); changed = EINA_TRUE; E_FREE(ec->shape_input_rects); ec->shape_input_rects = (Eina_Rectangle*)rects; @@ -3744,11 +3762,11 @@ _e_comp_x_hook_client_del(void *d EINA_UNUSED, E_Client *ec) win = e_client_util_win_get(ec); - e_bindings_mouse_ungrab(E_BINDING_CONTEXT_WINDOW, e_client_util_pwin_get(ec)); - e_bindings_wheel_ungrab(E_BINDING_CONTEXT_WINDOW, e_client_util_pwin_get(ec)); - _e_comp_x_focus_setdown(ec); if ((!ec->already_unparented) && stopping && ec->comp_data->reparented) { + e_bindings_mouse_ungrab(E_BINDING_CONTEXT_WINDOW, e_client_util_pwin_get(ec)); + e_bindings_wheel_ungrab(E_BINDING_CONTEXT_WINDOW, e_client_util_pwin_get(ec)); + _e_comp_x_focus_setdown(ec); ecore_x_window_reparent(win, ec->comp->man->root, ec->client.x, ec->client.y); ecore_x_window_save_set_del(win); @@ -3756,22 +3774,22 @@ _e_comp_x_hook_client_del(void *d EINA_UNUSED, E_Client *ec) ec->already_unparented = 1; eina_hash_del_by_key(clients_win_hash, &win); - win = e_client_util_pwin_get(ec); - eina_hash_del_by_key(clients_win_hash, &win); + if (ec->comp_data->reparented) + { + win = e_client_util_pwin_get(ec); + eina_hash_del_by_key(clients_win_hash, &win); + e_pixmap_parent_window_set(ec->pixmap, 0); + ecore_x_window_free(win); + } if (ec->hacks.mapping_change) - _e_comp_x_mapping_change_enabled++; + _e_comp_x_mapping_change_disabled--; if (ec->comp_data->counter) { ecore_x_sync_counter_free(ec->comp_data->counter); ec->comp_data->counter = 0; } E_FREE_FUNC(ec->comp_data->update_timeout, ecore_timer_del); - if (ec->comp_data->reparented) - { - e_pixmap_parent_window_set(ec->pixmap, 0); - ecore_x_window_free(win); - } if (ec->parent && (ec->parent->modal == ec)) { if (ec->parent->comp_data->lock_win) @@ -4449,7 +4467,7 @@ e_comp_x_init(void) E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_RESIZE_REQUEST, _e_comp_x_resize_request, NULL); E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_HIDE, _e_comp_x_hide, NULL); E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_REPARENT, _e_comp_x_reparent, NULL); - //E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_CONFIGURE, _e_comp_x_configure, NULL); + E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_CONFIGURE, _e_comp_x_configure, NULL); E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_CONFIGURE_REQUEST, _e_comp_x_configure_request, NULL); E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_STATE_REQUEST, _e_comp_x_state_request, NULL); E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_WINDOW_STACK, _e_comp_x_stack, NULL); diff --git a/src/bin/e_win.c b/src/bin/e_win.c index aadea8637d..244c611243 100644 --- a/src/bin/e_win.c +++ b/src/bin/e_win.c @@ -7,6 +7,7 @@ static void _e_win_state_update(E_Win *win); static void _e_win_cb_move(Ecore_Evas *ee); static void _e_win_cb_resize(Ecore_Evas *ee); static void _e_win_cb_delete(Ecore_Evas *ee); +static void _e_win_cb_destroy(Ecore_Evas *ee); static void _e_win_cb_state(Ecore_Evas *ee); /* local subsystem globals */ @@ -231,6 +232,10 @@ _e_win_hide(void *obj) E_Win *win = obj; if (!win->client) return; + ecore_evas_callback_move_set(win->ecore_evas, NULL); + ecore_evas_callback_resize_set(win->ecore_evas, NULL); + ecore_evas_callback_delete_request_set(win->ecore_evas, NULL); + ecore_evas_callback_state_change_set(win->ecore_evas, NULL); if (win->client->visible) evas_object_hide(win->client->frame); e_object_del(E_OBJECT(win->client)); } @@ -285,6 +290,7 @@ e_win_new(E_Comp *c) ecore_evas_callback_move_set(win->ecore_evas, _e_win_cb_move); ecore_evas_callback_resize_set(win->ecore_evas, _e_win_cb_resize); ecore_evas_callback_delete_request_set(win->ecore_evas, _e_win_cb_delete); + ecore_evas_callback_destroy_set(win->ecore_evas, _e_win_cb_destroy); ecore_evas_callback_state_change_set(win->ecore_evas, _e_win_cb_state); win->evas = ecore_evas_get(win->ecore_evas); ecore_evas_name_class_set(win->ecore_evas, "E", "_e_internal_window"); @@ -309,7 +315,7 @@ e_win_new(E_Comp *c) win->max_aspect = 0.0; wins = eina_list_append(wins, win); - win->pointer = e_pointer_window_new(win->evas_win, 0); + win->pointer = e_pointer_window_new(win->evas_win, 1); return win; } @@ -329,9 +335,11 @@ e_win_show(E_Win *win) win->client->internal_ecore_evas = win->ecore_evas; if (win->state.no_remember) win->client->internal_no_remember = 1; win->client->internal_no_reopen = win->state.no_reopen; + win->client->changes.size = win->client->changes.pos = 1; + EC_CHANGED(win->client); } _e_win_prop_update(win); - evas_object_show(win->client->frame); + ecore_evas_show(win->ecore_evas); } EAPI void @@ -636,18 +644,6 @@ _e_win_free(E_Win *win) if (win->pointer) e_object_del(E_OBJECT(win->pointer)); - if (win->client) - { - ecore_evas_callback_move_set(win->ecore_evas, NULL); - ecore_evas_callback_resize_set(win->ecore_evas, NULL); - ecore_evas_callback_delete_request_set(win->ecore_evas, NULL); - ecore_evas_callback_state_change_set(win->ecore_evas, NULL); - } - else - { - e_canvas_del(win->ecore_evas); - ecore_evas_free(win->ecore_evas); - } wins = eina_list_remove(wins, win); free(win); } @@ -694,6 +690,20 @@ _e_win_cb_resize(Ecore_Evas *ee) } static void +_e_win_cb_destroy(Ecore_Evas *ee) +{ + E_Win *win; + + win = ecore_evas_data_get(ee, "E_Win"); + if (!win) return; + if (!win->client) return; + e_canvas_del(ee); + win->client->internal_ecore_evas = NULL; + if (win->client->visible) evas_object_hide(win->client->frame); + e_object_del(E_OBJECT(win->client)); +} + +static void _e_win_cb_delete(Ecore_Evas *ee) { E_Win *win; |