diff options
author | Mike Blumenkrantz <m.blumenkran@samsung.com> | 2013-02-25 14:04:12 +0000 |
---|---|---|
committer | Mike Blumenkrantz <m.blumenkran@samsung.com> | 2013-04-15 08:39:16 +0100 |
commit | 505cec1d91dde9f8bb5e3e4ebe6c0b0942183486 (patch) | |
tree | 61913d10c07c978c59de9e402f3ce766680c9b33 | |
parent | b919573644acc25dfc07a07a58213758d90e4671 (diff) | |
download | enlightenment-505cec1d91dde9f8bb5e3e4ebe6c0b0942183486.tar.gz |
giant comp rejiggering commit #5:
* border frame/object now drawn directly on compositor canvas
* border shadows now in border theme with edje hint, non-updated themes still receive comp object shadows FOR NOW
* e_border MOVE/RESIZE pointer mode defines are now e_pointer.h enums
* added BD_CHANGED() util macro for setting bd->changed and printing a debug line to assist in finding places where this all-important flag is wrongly set
* bd->bg_win removed entirely
* bd->pointer objects moved to compositor object; now only one pointer object exists for each compositor
* resizing windows now shows a new and totally-intended scaling effect for window contents
* some additional retooling of border deletion/free callbacks
* fixed lurking potential bug where window could recieve focus from autoraise timer after border had been deleted
* more comp shape improvements/rewrites
* desk transitions are now BROKEN(ish)
* various modules updated to not be totally broken with these changes
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | data/themes/edc/border.edc | 63 | ||||
-rw-r--r-- | src/bin/e_actions.c | 8 | ||||
-rw-r--r-- | src/bin/e_border.c | 1622 | ||||
-rw-r--r-- | src/bin/e_border.h | 31 | ||||
-rw-r--r-- | src/bin/e_comp.c | 363 | ||||
-rw-r--r-- | src/bin/e_comp.h | 4 | ||||
-rw-r--r-- | src/bin/e_container.c | 2 | ||||
-rw-r--r-- | src/bin/e_container.h | 4 | ||||
-rw-r--r-- | src/bin/e_desklock.c | 4 | ||||
-rw-r--r-- | src/bin/e_dnd.c | 3 | ||||
-rw-r--r-- | src/bin/e_manager.c | 22 | ||||
-rw-r--r-- | src/bin/e_pointer.c | 91 | ||||
-rw-r--r-- | src/bin/e_pointer.h | 19 | ||||
-rw-r--r-- | src/bin/e_shelf.c | 1 | ||||
-rw-r--r-- | src/bin/e_win.c | 44 | ||||
-rw-r--r-- | src/modules/everything/e_mod_main.h | 1 | ||||
-rw-r--r-- | src/modules/everything/evry.c | 133 | ||||
-rw-r--r-- | src/modules/everything/evry_gadget.c | 15 | ||||
-rw-r--r-- | src/modules/fileman/e_fwin.c | 2 | ||||
-rw-r--r-- | src/modules/illume-indicator/e_mod_ind_win.c | 8 | ||||
-rw-r--r-- | src/modules/shot/e_mod_main.c | 27 | ||||
-rw-r--r-- | src/modules/tasks/e_mod_main.c | 10 | ||||
-rw-r--r-- | src/modules/winlist/e_winlist.c | 11 |
25 files changed, 1213 insertions, 1280 deletions
@@ -1,3 +1,7 @@ +2013-04-15 Mike Blumenkrantz + + * window borders now drawn on compositor canvas + 2013-04-05 Jérémy Zurcher * added support for systemd halt and poweroff @@ -126,6 +126,7 @@ Improvements: * shelf gadcon can no longer resize smaller than 16x16, ensuring dnd success * Don't rely on bash or zsh behavior when starting enlightenment_init and tempget. * menus are now drawn directly on the compositor canvas + * window borders now drawn on compositor canvas Fixes: * IBar menu didn't allow to configure different icon sources, show contents menu even on empty IBar. diff --git a/data/themes/edc/border.edc b/data/themes/edc/border.edc index 28f5d4181b..d445a47bf4 100644 --- a/data/themes/edc/border.edc +++ b/data/themes/edc/border.edc @@ -19,6 +19,8 @@ group { name: "e/widgets/border/default/border"; images.image: "sym_up_light_selected.png" COMP; images.image: "glow_round_corners_small.png" COMP; images.image: "knob_round_small_busy.png" COMP; + images.image: "screen_circular_shadow.png" COMP; + data.item: "shadow" "1"; parts { part { name: "client_clip"; type: RECT; description { state: "default" 0.0; @@ -71,7 +73,7 @@ group { name: "e/widgets/border/default/border"; fill.smooth: 0; } } - part { name: "e.text.title"; type: TEXT; + part { name: "e.text.title"; type: TEXT; mouse_events: 0; scale: 1; effect: SHADOW BOTTOM; description { state: "default" 0.0; @@ -97,7 +99,7 @@ group { name: "e/widgets/border/default/border"; visible: 0; } } - part { name: "title2"; type: TEXT; + part { name: "title2"; type: TEXT; mouse_events: 0; scale: 1; effect: SOFT_SHADOW BOTTOM; description { state: "default" 0.0; @@ -141,7 +143,7 @@ group { name: "e/widgets/border/default/border"; rel2.relative: 1.0 0.85; } } - part { name: "e.swallow.icon"; type: SWALLOW; + part { name: "e.swallow.icon"; type: SWALLOW; mouse_events: 0; description { state: "default" 0.0; rel1.to: "icon"; rel1.relative: 0.15 0.15; @@ -150,7 +152,7 @@ group { name: "e/widgets/border/default/border"; rel2.offset: 0 0; } } - part { name: "busy_clip"; type: RECT; + part { name: "busy_clip"; type: RECT; mouse_events: 0; description { state: "default" 0.0; color: 255 255 255 0; visible: 0; @@ -194,7 +196,7 @@ group { name: "e/widgets/border/default/border"; map.rotation.z: 360; } } - part { name: "clip1"; type: RECT; + part { name: "clip1"; type: RECT; mouse_events: 0; description { state: "default" 0.0; rel1.to: "top"; rel2.to: "top"; @@ -204,7 +206,7 @@ group { name: "e/widgets/border/default/border"; visible: 0; } } - part { name: "clip2"; type: RECT; + part { name: "clip2"; type: RECT; mouse_events: 0; description { state: "default" 0.0; rel1.to: "top"; rel2.to: "top"; @@ -215,7 +217,7 @@ group { name: "e/widgets/border/default/border"; visible: 1; } } - part { name: "close1"; + part { name: "close1"; mouse_events: 0; clip_to: "clip1"; description { state: "default" 0.0; image.normal: "sym_close_dark_normal.png"; @@ -230,7 +232,7 @@ group { name: "e/widgets/border/default/border"; image.normal: "sym_close_dark_selected.png"; } } - part { name: "max1"; + part { name: "max1"; mouse_events: 0; clip_to: "clip1"; description { state: "default" 0.0; image.normal: "sym_up_dark_normal.png"; @@ -245,7 +247,7 @@ group { name: "e/widgets/border/default/border"; image.normal: "sym_up_dark_selected.png"; } } - part { name: "min1"; + part { name: "min1"; mouse_events: 0; clip_to: "clip1"; description { state: "default" 0.0; image.normal: "sym_down_dark_normal.png"; @@ -260,7 +262,7 @@ group { name: "e/widgets/border/default/border"; image.normal: "sym_down_dark_selected.png"; } } - part { name: "close2"; + part { name: "close2"; mouse_events: 0; clip_to: "clip2"; description { state: "default" 0.0; image.normal: "sym_close_light_normal.png"; @@ -275,7 +277,7 @@ group { name: "e/widgets/border/default/border"; image.normal: "sym_close_light_selected.png"; } } - part { name: "max2"; + part { name: "max2"; mouse_events: 0; clip_to: "clip2"; description { state: "default" 0.0; image.normal: "sym_up_light_normal.png"; @@ -290,7 +292,7 @@ group { name: "e/widgets/border/default/border"; image.normal: "sym_up_light_selected.png"; } } - part { name: "min2"; + part { name: "min2"; mouse_events: 0; clip_to: "clip2"; description { state: "default" 0.0; image.normal: "sym_down_light_normal.png"; @@ -389,7 +391,7 @@ group { name: "e/widgets/border/default/border"; color: 0 0 0 0; } } - part { name: "bottom"; type: RECT; + part { name: "bottom"; type: RECT; mouse_events: 0; description { state: "default" 0.0; color_class: "border_bottom"; rel1.relative: 0.0 1.0; @@ -410,7 +412,7 @@ group { name: "e/widgets/border/default/border"; visible: 0; } } - part { name: "bevel2"; + part { name: "bevel2"; mouse_events: 0; description { state: "default" 0.0; image.normal: "bevel_dark_out.png"; image.border: 1 1 1 1; @@ -428,6 +430,24 @@ group { name: "e/widgets/border/default/border"; visible: 0; } } + part { name: "shadow"; + mouse_events: 0; + description { state: "default" 0.0; + image.normal: "win_shadow.png"; + image.border: 14 14 14 14; + image.middle: 0; + rel1.relative: 0.0 1.0; + rel1.to: "top"; + rel1.offset: -7 -3; + rel2.to: "bottom"; + rel2.offset: 6 11; + fill.smooth: 0; + } + description { state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } part { name: "e.event.resize.bl"; type: RECT; description { state: "default" 0.0; rel1.relative: 0.0 1.0; @@ -501,9 +521,24 @@ group { name: "e/widgets/border/default/border"; FIXED_SIZE(69, 5) } } + part { name: "events"; type: RECT; repeat_events: 1; + description { state: "default"; + color: 0 0 0 0; + } + } } programs { program { + signal: "e,state,shadow,on"; source: "e"; + action: STATE_SET "default" 0.0; + target: "shadow"; + } + program { + signal: "e,state,shadow,off"; source: "e"; + action: STATE_SET "hidden" 0.0; + target: "shadow"; + } + program { signal: "e,state,focused"; source: "e"; action: STATE_SET "focused" 0.0; target: "top"; diff --git a/src/bin/e_actions.c b/src/bin/e_actions.c index 038feb3014..599df02a21 100644 --- a/src/bin/e_actions.c +++ b/src/bin/e_actions.c @@ -119,9 +119,7 @@ ACT_FN_GO_SIGNAL(window_move, ) e_border_signal_move_end((E_Border *)obj, sig, src); else { - if (((E_Border *)obj)->moving) - e_border_signal_move_end((E_Border *)obj, sig, src); - else + if (!((E_Border *)obj)->moving) e_border_signal_move_begin((E_Border *)obj, sig, src); } } @@ -2488,7 +2486,7 @@ ACT_FN_GO(pointer_resize_push, ) if ((bd->lock_user_size) || (bd->shaded) || (bd->shading) || (bd->fullscreen) || ((bd->maximized) && (!e_config->allow_manip))) return; - e_pointer_type_push(bd->pointer, bd, params); + e_pointer_type_push(e_comp_get(bd)->pointer, bd, params); } } @@ -2504,7 +2502,7 @@ ACT_FN_GO(pointer_resize_pop, ) if ((bd->lock_user_size) || (bd->shaded) || (bd->shading) || (bd->fullscreen) || ((bd->maximized) && (!e_config->allow_manip))) return; - e_pointer_type_pop(bd->pointer, bd, params); + e_pointer_type_pop(e_comp_get(bd)->pointer, bd, params); } } diff --git a/src/bin/e_border.c b/src/bin/e_border.c index 9c90aee3bf..cbf277f8a5 100644 --- a/src/bin/e_border.c +++ b/src/bin/e_border.c @@ -3,18 +3,6 @@ //#define INOUTDEBUG_MOUSE 1 //#define INOUTDEBUG_FOCUS 1 -/* These are compatible with netwm */ -#define RESIZE_TL 0 -#define RESIZE_T 1 -#define RESIZE_TR 2 -#define RESIZE_R 3 -#define RESIZE_BR 4 -#define RESIZE_B 5 -#define RESIZE_BL 6 -#define RESIZE_L 7 -#define MOVE 8 -#define RESIZE_NONE 11 - /* local subsystem functions */ static void _e_border_pri_raise(E_Border *bd); static void _e_border_pri_norm(E_Border *bd); @@ -29,6 +17,8 @@ static void _e_border_print(E_Border *bd, const char *func); #endif +static void _e_border_shadow(E_Border *bd); + /* FIXME: these likely belong in a separate icccm/client handler */ /* and the border needs to become a dumb object that just does what its */ /* told to do */ @@ -101,24 +91,6 @@ static void _e_border_cb_signal_bind(void *data, Evas_Object *obj, const char *emission, const char *source); -static Eina_Bool _e_border_cb_mouse_in(void *data, - int type, - void *event); -static Eina_Bool _e_border_cb_mouse_out(void *data, - int type, - void *event); -static Eina_Bool _e_border_cb_mouse_wheel(void *data, - int type, - void *event); -static Eina_Bool _e_border_cb_mouse_down(void *data, - int type, - void *event); -static Eina_Bool _e_border_cb_mouse_up(void *data, - int type, - void *event); -static Eina_Bool _e_border_cb_mouse_move(void *data, - int type, - void *event); static Eina_Bool _e_border_cb_grab_replay(void *data, int type, void *event); @@ -193,23 +165,22 @@ static void _e_border_move_update(E_Border *bd); static Eina_Bool _e_border_cb_ping_poller(void *data); static Eina_Bool _e_border_cb_kill_timer(void *data); -static void _e_border_pointer_resize_begin(E_Border *bd); -static void _e_border_pointer_resize_end(E_Border *bd); -static void _e_border_pointer_move_begin(E_Border *bd); -static void _e_border_pointer_move_end(E_Border *bd); - static void _e_border_hook_call(E_Border_Hook_Point hookpoint, void *bd); static void _e_border_client_move_resize_send(E_Border *bd); -static void _e_border_frame_replace(E_Border *bd, - Eina_Bool argb); - static void _e_border_shape_input_rectangle_set(E_Border *bd); static void _e_border_show(E_Border *bd); static void _e_border_hide(E_Border *bd); +static Eina_Bool _e_border_cb_mouse_x_wheel(void *d EINA_UNUSED, int t, Ecore_Event_Mouse_Wheel *ev); +static Eina_Bool _e_border_cb_mouse_x_up(void *d EINA_UNUSED, int t, Ecore_Event_Mouse_Button *ev); +static Eina_Bool _e_border_cb_mouse_x_down(void *d EINA_UNUSED, int t, Ecore_Event_Mouse_Button *ev); +static Eina_Bool _e_border_cb_mouse_x_move(void *d, int t EINA_UNUSED, Ecore_Event_Mouse_Move *ev); +static Eina_Bool _e_border_cb_mouse_x_in(void *d, int t EINA_UNUSED, Ecore_X_Event_Mouse_In *ev); +static Eina_Bool _e_border_cb_mouse_x_out(void *d, int t EINA_UNUSED, Ecore_X_Event_Mouse_Out *ev); + static void _e_border_move_lost_window_to_center(E_Border *bd); static void _e_border_reset_lost_window(E_Border *bd); static Eina_Bool _e_border_pointer_warp_to_center_timer(void *data); @@ -269,8 +240,7 @@ EAPI int E_EVENT_BORDER_FULLSCREEN = 0; EAPI int E_EVENT_BORDER_UNFULLSCREEN = 0; #define GRAV_SET(bd, grav) \ - ecore_x_window_gravity_set(bd->bg_win, grav); \ - ecore_x_window_gravity_set(bd->client.shell_win, grav); \ + ecore_x_window_gravity_set(bd->win, grav); \ if (bd->client.lock_win) ecore_x_window_gravity_set(bd->client.lock_win, grav); \ ecore_x_window_gravity_set(bd->client.win, grav); @@ -328,6 +298,18 @@ e_border_init(void) _e_border_cb_desktop_change, NULL); E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_SYNC_ALARM, _e_border_cb_sync_alarm, NULL); + E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_MOUSE_BUTTON_DOWN, + _e_border_cb_mouse_x_down, NULL); + E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_MOUSE_BUTTON_UP, + _e_border_cb_mouse_x_up, NULL); + E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_MOUSE_IN, + _e_border_cb_mouse_x_in, NULL); + E_LIST_HANDLER_APPEND(handlers, ECORE_X_EVENT_MOUSE_OUT, + _e_border_cb_mouse_x_out, NULL); + E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_MOUSE_WHEEL, + _e_border_cb_mouse_x_wheel, NULL); + E_LIST_HANDLER_APPEND(handlers, ECORE_EVENT_MOUSE_MOVE, + _e_border_cb_mouse_x_move, NULL); ecore_x_passive_grab_replay_func_set(_e_border_cb_grab_replay, NULL); @@ -421,6 +403,7 @@ e_border_new(E_Container *con, bd->h = 1; /* FIXME: ewww - round trip */ bd->client.argb = ecore_x_window_argb_get(win); + /* match bd parent argbness */ if (bd->client.argb) bd->win = ecore_x_window_manager_argb_new(con->win, 0, 0, bd->w, bd->h); else @@ -431,37 +414,27 @@ e_border_new(E_Container *con, e_bindings_mouse_grab(E_BINDING_CONTEXT_WINDOW, bd->win); e_bindings_wheel_grab(E_BINDING_CONTEXT_WINDOW, bd->win); e_focus_setup(bd); - bd->bg_ecore_evas = e_canvas_new(bd->win, - 0, 0, bd->w, bd->h, 1, 0, - &(bd->bg_win)); - ecore_evas_ignore_events_set(bd->bg_ecore_evas, EINA_TRUE); - e_canvas_add(bd->bg_ecore_evas); - bd->event_win = ecore_x_window_input_new(bd->win, 0, 0, bd->w, bd->h); - bd->bg_evas = ecore_evas_get(bd->bg_ecore_evas); - ecore_x_window_shape_events_select(bd->bg_win, 1); - ecore_evas_name_class_set(bd->bg_ecore_evas, "E", "Frame_Window"); - ecore_evas_title_set(bd->bg_ecore_evas, "Enlightenment Frame"); - if (bd->client.argb) - bd->client.shell_win = ecore_x_window_manager_argb_new(bd->win, 0, 0, 1, 1); - else - bd->client.shell_win = ecore_x_window_override_new(bd->win, 0, 0, 1, 1); - ecore_x_window_container_manage(bd->client.shell_win); - if (!internal) ecore_x_window_client_manage(win); /* FIXME: Round trip. XCB */ /* fetch needed to avoid grabbing the server as window may vanish */ att = &bd->client.initial_attributes; if ((!ecore_x_window_attributes_get(win, att)) || (att->input_only)) { // printf("##- ATTR FETCH FAILED/INPUT ONLY FOR 0x%x - ABORT MANAGE\n", win); - e_canvas_del(bd->bg_ecore_evas); - ecore_evas_free(bd->bg_ecore_evas); - ecore_x_window_free(bd->client.shell_win); + ecore_x_window_free(bd->win); e_bindings_mouse_ungrab(E_BINDING_CONTEXT_WINDOW, bd->win); e_bindings_wheel_ungrab(E_BINDING_CONTEXT_WINDOW, bd->win); ecore_x_window_free(bd->win); free(bd); return NULL; } + ecore_x_window_container_manage(bd->win); + if (!internal) ecore_x_window_client_manage(win); + ecore_x_window_configure(bd->win, + ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | + ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, + 0, 0, 0, 0, 0, + win, ECORE_X_WINDOW_STACK_BELOW); + ecore_x_event_mask_set(bd->win, ECORE_X_EVENT_MASK_MOUSE_IN | ECORE_X_EVENT_MASK_MOUSE_OUT); /* printf("##- ON MAP CLIENT 0x%x SIZE %ix%i %i:%i\n", * bd->client.win, bd->client.w, bd->client.h, att->x, att->y); */ @@ -485,19 +458,6 @@ e_border_new(E_Container *con, _e_border_hook_call(E_BORDER_HOOK_NEW_BORDER, bd); - E_LIST_HANDLER_APPEND(bd->handlers, ECORE_X_EVENT_MOUSE_IN, - _e_border_cb_mouse_in, bd); - E_LIST_HANDLER_APPEND(bd->handlers, ECORE_X_EVENT_MOUSE_OUT, - _e_border_cb_mouse_out, bd); - E_LIST_HANDLER_APPEND(bd->handlers, ECORE_EVENT_MOUSE_BUTTON_DOWN, - _e_border_cb_mouse_down, bd); - E_LIST_HANDLER_APPEND(bd->handlers, ECORE_EVENT_MOUSE_BUTTON_UP, - _e_border_cb_mouse_up, bd); - E_LIST_HANDLER_APPEND(bd->handlers, ECORE_EVENT_MOUSE_MOVE, - _e_border_cb_mouse_move, bd); - E_LIST_HANDLER_APPEND(bd->handlers, ECORE_EVENT_MOUSE_WHEEL, - _e_border_cb_mouse_wheel, bd); - bd->client.icccm.title = NULL; bd->client.icccm.name = NULL; bd->client.icccm.class = NULL; @@ -700,7 +660,7 @@ e_border_new(E_Container *con, bd->w = bd->client.w; bd->h = bd->client.h; - bd->resize_mode = RESIZE_NONE; + bd->resize_mode = E_POINTER_RESIZE_NONE; bd->layer = 100; bd->saved.layer = bd->layer; bd->changes.icon = 1; @@ -713,17 +673,15 @@ e_border_new(E_Container *con, /* just to friggin make java happy - we're DELAYING the reparent until * eval time... */ -/* ecore_x_window_reparent(win, bd->client.shell_win, 0, 0); */ +/* ecore_x_window_reparent(win, bd->win, 0, 0); */ bd->need_reparent = 1; ecore_x_window_border_width_set(win, 0); - ecore_x_window_show(bd->event_win); - ecore_x_window_show(bd->client.shell_win); bd->shape = e_container_shape_add(con); bd->take_focus = 1; bd->new_client = 1; - bd->changed = 1; + BD_CHANGED(bd); // bd->zone = e_zone_current_get(con); bd->desk = e_desk_current_get(bd->zone); @@ -748,11 +706,9 @@ e_border_new(E_Container *con, bd2->client.win); #endif eina_hash_del(borders_hash, e_util_winid_str_get(bd->client.win), bd2); - eina_hash_del(borders_hash, e_util_winid_str_get(bd2->bg_win), bd2); eina_hash_del(borders_hash, e_util_winid_str_get(bd2->win), bd2); } eina_hash_add(borders_hash, e_util_winid_str_get(bd->client.win), bd); - eina_hash_add(borders_hash, e_util_winid_str_get(bd->bg_win), bd); eina_hash_add(borders_hash, e_util_winid_str_get(bd->win), bd); managed = 1; ecore_x_window_prop_card32_set(win, E_ATOM_MANAGED, &managed, 1); @@ -774,7 +730,6 @@ e_border_new(E_Container *con, focus_stack = eina_list_append(focus_stack, bd); - bd->pointer = e_pointer_window_new(bd->win, 0); return bd; } @@ -1048,10 +1003,10 @@ e_border_hide(E_Border *bd, ecore_x_window_shadow_tree_flush(); if (bd->moving) _e_border_move_end(bd); - if (bd->resize_mode != RESIZE_NONE) + if (bd->resize_mode != E_POINTER_RESIZE_NONE) { - _e_border_pointer_resize_end(bd); - bd->resize_mode = RESIZE_NONE; + e_pointer_mode_pop(bd, bd->resize_mode); + bd->resize_mode = E_POINTER_RESIZE_NONE; _e_border_resize_end(bd); } @@ -1122,6 +1077,7 @@ send_event: ev = E_NEW(E_Event_Border_Hide, 1); ev->border = bd; + ev->manage = manage; e_object_ref(E_OBJECT(bd)); // e_object_breadcrumb_add(E_OBJECT(bd), "border_hide_event"); ecore_event_add(E_EVENT_BORDER_HIDE, ev, _e_border_event_border_hide_free, NULL); @@ -1207,107 +1163,12 @@ _e_border_pri_norm(E_Border *bd) } static void -_e_border_frame_replace(E_Border *bd, Eina_Bool argb) -{ - Ecore_X_Window win; - Ecore_Evas *bg_ecore_evas; - char buf[4096]; - - bd->argb = argb; - - win = bd->win; - bg_ecore_evas = bd->bg_ecore_evas; - - /* unregister old frame window */ - eina_hash_del(borders_hash, e_util_winid_str_get(bd->bg_win), bd); - eina_hash_del(borders_hash, e_util_winid_str_get(bd->win), bd); - - e_focus_setdown(bd); - e_bindings_mouse_ungrab(E_BINDING_CONTEXT_WINDOW, bd->win); - e_bindings_wheel_ungrab(E_BINDING_CONTEXT_WINDOW, bd->win); - - if (bd->icon_object) - evas_object_del(bd->icon_object); - - evas_object_del(bd->bg_object); - e_canvas_del(bg_ecore_evas); - ecore_evas_free(bg_ecore_evas); - - if (bd->pointer) - e_object_del(E_OBJECT(bd->pointer)); - - /* create new frame */ - if (argb) - bd->win = ecore_x_window_manager_argb_new(bd->zone->container->win, - bd->x, bd->y, bd->w, bd->h); - else - { - bd->win = ecore_x_window_override_new(bd->zone->container->win, - bd->x, bd->y, bd->w, bd->h); - ecore_x_window_shape_events_select(bd->win, 1); - } - - ecore_x_window_configure(bd->win, - ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING | - ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE, - 0, 0, 0, 0, 0, - win, ECORE_X_WINDOW_STACK_BELOW); - - e_bindings_mouse_grab(E_BINDING_CONTEXT_WINDOW, bd->win); - e_bindings_wheel_grab(E_BINDING_CONTEXT_WINDOW, bd->win); - e_focus_setup(bd); - - bd->bg_ecore_evas = e_canvas_new(bd->win, - 0, 0, bd->w, bd->h, 1, 0, - &(bd->bg_win)); - - e_canvas_add(bd->bg_ecore_evas); - ecore_x_window_reparent(bd->event_win, bd->win, 0, 0); - - bd->bg_evas = ecore_evas_get(bd->bg_ecore_evas); - ecore_evas_name_class_set(bd->bg_ecore_evas, "E", "Frame_Window"); - ecore_evas_title_set(bd->bg_ecore_evas, "Enlightenment Frame"); - - ecore_x_window_shape_events_select(bd->bg_win, 1); - - /* move client with shell win over to new frame */ - ecore_x_window_reparent(bd->client.shell_win, bd->win, - bd->client_inset.l, bd->client_inset.t); - - bd->pointer = e_pointer_window_new(bd->win, 0); - - eina_hash_add(borders_hash, e_util_winid_str_get(bd->bg_win), bd); - eina_hash_add(borders_hash, e_util_winid_str_get(bd->win), bd); - - if (bd->visible) - { - E_Border *tmp; - Eina_List *l; - - ecore_evas_show(bd->bg_ecore_evas); - ecore_x_window_show(bd->win); - - EINA_LIST_FOREACH(bd->client.e.state.video_child, l, tmp) - ecore_x_window_show(tmp->win); - } - - bd->bg_object = edje_object_add(bd->bg_evas); - snprintf(buf, sizeof(buf), "e/widgets/border/%s/border", bd->client.border.name); - e_theme_edje_object_set(bd->bg_object, "base/theme/borders", buf); - - bd->icon_object = e_border_icon_add(bd, bd->bg_evas); - - /* cleanup old frame */ - ecore_x_window_free(win); -} - -static void _e_border_client_move_resize_send(E_Border *bd) { if (bd->internal_ecore_evas) ecore_evas_managed_move(bd->internal_ecore_evas, - bd->x + bd->fx.x + bd->client_inset.l, - bd->y + bd->fx.y + bd->client_inset.t); + bd->client_inset.l, + bd->client_inset.t); ecore_x_icccm_move_resize_send(bd->client.win, bd->x + bd->fx.x + bd->client_inset.l, @@ -1400,7 +1261,7 @@ _e_border_move_internal(E_Border *bd, bd->pre_res_change.valid = 0; bd->x = x; bd->y = y; - bd->changed = 1; + BD_CHANGED(bd); bd->changes.pos = 1; #if 0 if (bd->client.netwm.sync.request) @@ -1596,7 +1457,7 @@ _e_border_move_resize_internal(E_Border *bd, bd->client.w = bd->w - (bd->client_inset.l + bd->client_inset.r); bd->client.h = bd->h - (bd->client_inset.t + bd->client_inset.b); - if ((bd->shaped) || (bd->client.shaped)) + if (bd->client.shaped) { bd->need_shape_merge = 1; bd->need_shape_export = 1; @@ -1608,7 +1469,7 @@ _e_border_move_resize_internal(E_Border *bd, if (bd->internal_ecore_evas) { - bd->changed = 1; + BD_CHANGED(bd); bd->changes.size = 1; } else @@ -1626,7 +1487,7 @@ _e_border_move_resize_internal(E_Border *bd, } else { - bd->changed = 1; + BD_CHANGED(bd); bd->changes.size = 1; } } @@ -2230,7 +2091,7 @@ e_border_focus_set(E_Border *bd, if (bd->visible && bd->changes.visible) { bd->want_focus = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if ((!bd->focused) || (focus_next && (bd != eina_list_data_get(focus_next)))) @@ -2455,7 +2316,7 @@ e_border_shade(E_Border *bd, bd->shade.start = ecore_loop_time_get(); bd->shading = 1; bd->changes.shading = 1; - bd->changed = 1; + BD_CHANGED(bd); if (bd->shade.dir == E_DIRECTION_UP || bd->shade.dir == E_DIRECTION_LEFT) @@ -2495,7 +2356,7 @@ e_border_shade(E_Border *bd, bd->changes.pos = 1; } - if ((bd->shaped) || (bd->client.shaped)) + if (bd->client.shaped) { bd->need_shape_merge = 1; bd->need_shape_export = 1; @@ -2508,7 +2369,7 @@ e_border_shade(E_Border *bd, bd->changes.size = 1; bd->shaded = 1; bd->changes.shaded = 1; - bd->changed = 1; + BD_CHANGED(bd); edje_object_signal_emit(bd->bg_object, "e,state,shaded", "e"); e_border_frame_recalc(bd); ev = E_NEW(E_Event_Border_Resize, 1); @@ -2562,7 +2423,7 @@ e_border_unshade(E_Border *bd, bd->shade.start = ecore_loop_time_get(); bd->shading = 1; bd->changes.shading = 1; - bd->changed = 1; + BD_CHANGED(bd); if (bd->shade.dir == E_DIRECTION_UP) { @@ -2585,14 +2446,14 @@ e_border_unshade(E_Border *bd, ecore_x_window_gravity_set(bd->client.win, ECORE_X_GRAVITY_SW); ecore_x_window_move_resize(bd->client.win, bd->w - (bd->client_inset.l + bd->client_inset.r) - - bd->client.h, + bd->client.w, 0, bd->client.w, bd->client.h); if (bd->client.lock_win) { ecore_x_window_gravity_set(bd->client.lock_win, ECORE_X_GRAVITY_SW); ecore_x_window_move_resize(bd->client.lock_win, bd->w - (bd->client_inset.l + bd->client_inset.r) - - bd->client.h, + bd->client.w, 0, bd->client.w, bd->client.h); } } @@ -2627,7 +2488,7 @@ e_border_unshade(E_Border *bd, bd->x = bd->x - bd->client.w; bd->changes.pos = 1; } - if ((bd->shaped) || (bd->client.shaped)) + if (bd->client.shaped) { bd->need_shape_merge = 1; bd->need_shape_export = 1; @@ -2640,7 +2501,7 @@ e_border_unshade(E_Border *bd, bd->changes.size = 1; bd->shaded = 0; bd->changes.shaded = 1; - bd->changed = 1; + BD_CHANGED(bd); edje_object_signal_emit(bd->bg_object, "e,state,unshaded", "e"); e_border_frame_recalc(bd); ev = E_NEW(E_Event_Border_Resize, 1); @@ -2658,18 +2519,25 @@ e_border_unshade(E_Border *bd, static void _e_border_client_inset_calc(E_Border *bd) { - int cx, cy, cw, ch; + int w, h, cx, cy, cw, ch; if (bd->bg_object) { - evas_object_resize(bd->bg_object, MAX(bd->w, 500), MAX(bd->h, 500)); + Evas_Object *layout; + + layout = e_comp_get(bd)->layout; + if (layout) e_layout_freeze(layout); + evas_object_geometry_get(bd->bg_object, NULL, NULL, &w, &h); + evas_object_resize(bd->bg_object, MAX(w, 50), MAX(h, 50)); edje_object_message_signal_process(bd->bg_object); edje_object_calc_force(bd->bg_object); edje_object_part_geometry_get(bd->bg_object, "e.swallow.client", &cx, &cy, &cw, &ch); bd->client_inset.l = cx; - bd->client_inset.r = MAX(bd->w, 500) - (cx + cw); + bd->client_inset.r = MAX(w, 50) - (cx + cw); bd->client_inset.t = cy; - bd->client_inset.b = MAX(bd->h, 500) - (cy + ch); + bd->client_inset.b = MAX(h, 50) - (cy + ch); + evas_object_resize(bd->bg_object, w, h); + if (layout) e_layout_thaw(layout); } else { @@ -2685,6 +2553,7 @@ _e_border_client_inset_calc(E_Border *bd) ecore_x_e_frame_size_set(bd->client.win, bd->client_inset.l, bd->client_inset.r, bd->client_inset.t, bd->client_inset.b); + bd->client_inset.calc = 1; } static void @@ -3131,9 +3000,10 @@ e_border_fullscreen(E_Border *bd, e_hints_window_fullscreen_set(bd, 1); e_hints_window_size_unset(bd); bd->client.border.changed = 1; - bd->changed = 1; + BD_CHANGED(bd); } bd->fullscreen_policy = policy; + _e_border_shadow(bd); ev = E_NEW(E_Event_Border_Fullscreen, 1); ev->border = bd; @@ -3180,9 +3050,10 @@ e_border_unfullscreen(E_Border *bd) e_hints_window_fullscreen_set(bd, 0); bd->client.border.changed = 1; - bd->changed = 1; + BD_CHANGED(bd); } bd->fullscreen_policy = 0; + _e_border_shadow(bd); ev = E_NEW(E_Event_Border_Unfullscreen, 1); ev->border = bd; @@ -3359,7 +3230,7 @@ e_border_pinned_set(E_Border *bd, e_border_layer_set(bd, layer); bd->client.border.changed = 1; - bd->changed = 1; + BD_CHANGED(bd); } } @@ -3387,18 +3258,6 @@ e_border_find_all_by_client_window(Ecore_X_Window win) } EAPI E_Border * -e_border_find_by_frame_window(Ecore_X_Window win) -{ - E_Border *bd; - - bd = eina_hash_find(borders_hash, e_util_winid_str_get(win)); - if ((bd) && (!e_object_is_del(E_OBJECT(bd))) && - (bd->bg_win == win)) - return bd; - return NULL; -} - -EAPI E_Border * e_border_find_by_window(Ecore_X_Window win) { E_Border *bd; @@ -3648,8 +3507,6 @@ _e_border_show(E_Border *bd) Eina_List *l; E_Border *tmp; - ecore_evas_show(bd->bg_ecore_evas); - if (bd->post_job) { bd->post_show = 1; @@ -3679,7 +3536,6 @@ _e_border_hide(E_Border *bd) if (!e_comp_evas_exists(bd)) { ecore_x_window_hide(bd->win); - ecore_evas_hide(bd->bg_ecore_evas); EINA_LIST_FOREACH(bd->client.e.state.video_child, l, tmp) ecore_x_window_hide(tmp->win); @@ -3698,7 +3554,6 @@ _e_border_action_input_win_del(void) return 0; e_grabinput_release(action_input_win, action_input_win); - ecore_x_window_free(action_input_win); action_input_win = 0; return 1; } @@ -3707,14 +3562,8 @@ static int _e_border_action_input_win_new(E_Border *bd) { if (!action_input_win) - { - Ecore_X_Window parent = bd->zone->container->win; - action_input_win = ecore_x_window_input_new(parent, 0, 0, 1, 1); - if (!action_input_win) - return 0; - } + action_input_win = e_comp_get(bd)->ee_win; - ecore_x_window_show(action_input_win); if (e_grabinput_get(action_input_win, 0, action_input_win)) return 1; @@ -4029,13 +3878,19 @@ e_border_act_move_begin(E_Border *bd, { E_OBJECT_CHECK(bd); E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE); - if ((bd->resize_mode != RESIZE_NONE) || (bd->moving)) return; + if ((bd->resize_mode != E_POINTER_RESIZE_NONE) || (bd->moving)) return; if (!_e_border_move_begin(bd)) return; + if (!_e_border_action_input_win_new(bd)) + { + _e_border_move_end(bd); + return; + } + _e_border_action_init(bd); e_zone_edge_disable(); bd->moving = 1; - _e_border_pointer_move_begin(bd); + e_pointer_mode_push(bd, E_POINTER_MOVE); if (ev) { char source[256]; @@ -4053,10 +3908,11 @@ e_border_act_move_end(E_Border *bd, E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE); if (!bd->moving) return; bd->moving = 0; - _e_border_pointer_move_end(bd); + e_pointer_mode_pop(bd, E_POINTER_MOVE); e_zone_edge_enable(); _e_border_move_end(bd); e_zone_flip_coords_handle(bd->zone, -1, -1); + _e_border_action_finish(); } EAPI void @@ -4066,19 +3922,25 @@ e_border_act_resize_begin(E_Border *bd, E_OBJECT_CHECK(bd); E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE); if (bd->lock_user_size) return; - if ((bd->resize_mode != RESIZE_NONE) || (bd->moving)) return; + if ((bd->resize_mode != E_POINTER_RESIZE_NONE) || (bd->moving)) return; if (!_e_border_resize_begin(bd)) return; + if (!_e_border_action_input_win_new(bd)) + { + _e_border_resize_end(bd); + return; + } + _e_border_action_init(bd); if (bd->mouse.current.mx < (bd->x + bd->w / 2)) { if (bd->mouse.current.my < (bd->y + bd->h / 2)) { - bd->resize_mode = RESIZE_TL; + bd->resize_mode = E_POINTER_RESIZE_TL; GRAV_SET(bd, ECORE_X_GRAVITY_SE); } else { - bd->resize_mode = RESIZE_BL; + bd->resize_mode = E_POINTER_RESIZE_BL; GRAV_SET(bd, ECORE_X_GRAVITY_NE); } } @@ -4086,16 +3948,16 @@ e_border_act_resize_begin(E_Border *bd, { if (bd->mouse.current.my < (bd->y + bd->h / 2)) { - bd->resize_mode = RESIZE_TR; + bd->resize_mode = E_POINTER_RESIZE_TR; GRAV_SET(bd, ECORE_X_GRAVITY_SW); } else { - bd->resize_mode = RESIZE_BR; + bd->resize_mode = E_POINTER_RESIZE_BR; GRAV_SET(bd, ECORE_X_GRAVITY_NW); } } - _e_border_pointer_resize_begin(bd); + e_pointer_mode_push(bd, bd->resize_mode); if (ev) { char source[256]; @@ -4111,14 +3973,15 @@ e_border_act_resize_end(E_Border *bd, { E_OBJECT_CHECK(bd); E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE); - if (bd->resize_mode != RESIZE_NONE) + if (bd->resize_mode != E_POINTER_RESIZE_NONE) { - _e_border_pointer_resize_end(bd); - bd->resize_mode = RESIZE_NONE; + e_pointer_mode_pop(bd, bd->resize_mode); + bd->resize_mode = E_POINTER_RESIZE_NONE; _e_border_resize_end(bd); bd->changes.reset_gravity = 1; - bd->changed = 1; + BD_CHANGED(bd); } + _e_border_action_finish(); } EAPI void @@ -4333,38 +4196,6 @@ e_border_lost_windows_get(E_Zone *zone) { list = eina_list_append(list, bd); } - else if ((!E_CONTAINS(bd->zone->x, bd->zone->y, - bd->zone->w, bd->zone->h, - bd->x, bd->y, bd->w, bd->h)) && - (bd->shaped)) - { - Ecore_X_Rectangle *rect; - int i, num; - - rect = ecore_x_window_shape_rectangles_get(bd->win, &num); - if (rect) - { - int ok; - - ok = 0; - for (i = 0; i < num; i++) - { - if (E_INTERSECTS(bd->zone->x + loss_overlap, - bd->zone->y + loss_overlap, - bd->zone->w - (2 * loss_overlap), - bd->zone->h - (2 * loss_overlap), - rect[i].x, rect[i].y, - (int)rect[i].width, (int)rect[i].height)) - { - ok = 1; - break; - } - } - free(rect); - if (!ok) - list = eina_list_append(list, bd); - } - } } return list; } @@ -4561,7 +4392,7 @@ e_border_resize_cancel(void) } else { - bdresize->resize_mode = RESIZE_NONE; + bdresize->resize_mode = E_POINTER_RESIZE_NONE; _e_border_resize_end(bdresize); } } @@ -4580,9 +4411,9 @@ e_border_frame_recalc(E_Border *bd) bd->w += (bd->client_inset.l + bd->client_inset.r); bd->h += (bd->client_inset.t + bd->client_inset.b); - bd->changed = 1; + BD_CHANGED(bd); bd->changes.size = 1; - if ((bd->shaped) || (bd->client.shaped)) + if (bd->client.shaped) { bd->need_shape_merge = 1; bd->need_shape_export = 1; @@ -4628,10 +4459,10 @@ e_border_signal_move_begin(E_Border *bd, E_OBJECT_CHECK(bd); E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE); - if ((bd->resize_mode != RESIZE_NONE) || (bd->moving)) return; + if ((bd->resize_mode != E_POINTER_RESIZE_NONE) || (bd->moving)) return; if (!_e_border_move_begin(bd)) return; bd->moving = 1; - _e_border_pointer_move_begin(bd); + e_pointer_mode_push(bd, E_POINTER_MOVE); e_zone_edge_disable(); _e_border_moveinfo_gather(bd, sig); if (bd->cur_mouse_action) @@ -4656,7 +4487,7 @@ e_border_signal_move_end(E_Border *bd, E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE); if (!bd->moving) return; bd->moving = 0; - _e_border_pointer_move_end(bd); + e_pointer_mode_pop(bd, E_POINTER_MOVE); e_zone_edge_enable(); _e_border_move_end(bd); e_zone_flip_coords_handle(bd->zone, -1, -1); @@ -4667,7 +4498,7 @@ e_border_resizing_get(E_Border *bd) { E_OBJECT_CHECK_RETURN(bd, 0); E_OBJECT_TYPE_CHECK_RETURN(bd, E_BORDER_TYPE, 0); - if (bd->resize_mode == RESIZE_NONE) return 0; + if (bd->resize_mode == E_POINTER_RESIZE_NONE) return 0; return 1; } @@ -4678,56 +4509,56 @@ e_border_signal_resize_begin(E_Border *bd, const char *src __UNUSED__) { Ecore_X_Gravity grav = ECORE_X_GRAVITY_NW; - int resize_mode = RESIZE_BR; + int resize_mode = E_POINTER_RESIZE_BR; E_OBJECT_CHECK(bd); E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE); - if ((bd->resize_mode != RESIZE_NONE) || (bd->moving)) return; + if ((bd->resize_mode != E_POINTER_RESIZE_NONE) || (bd->moving)) return; if (!_e_border_resize_begin(bd)) return; if (!strcmp(dir, "tl")) { - resize_mode = RESIZE_TL; + resize_mode = E_POINTER_RESIZE_TL; grav = ECORE_X_GRAVITY_SE; } else if (!strcmp(dir, "t")) { - resize_mode = RESIZE_T; + resize_mode = E_POINTER_RESIZE_T; grav = ECORE_X_GRAVITY_S; } else if (!strcmp(dir, "tr")) { - resize_mode = RESIZE_TR; + resize_mode = E_POINTER_RESIZE_TR; grav = ECORE_X_GRAVITY_SW; } else if (!strcmp(dir, "r")) { - resize_mode = RESIZE_R; + resize_mode = E_POINTER_RESIZE_R; grav = ECORE_X_GRAVITY_W; } else if (!strcmp(dir, "br")) { - resize_mode = RESIZE_BR; + resize_mode = E_POINTER_RESIZE_BR; grav = ECORE_X_GRAVITY_NW; } else if (!strcmp(dir, "b")) { - resize_mode = RESIZE_B; + resize_mode = E_POINTER_RESIZE_B; grav = ECORE_X_GRAVITY_N; } else if (!strcmp(dir, "bl")) { - resize_mode = RESIZE_BL; + resize_mode = E_POINTER_RESIZE_BL; grav = ECORE_X_GRAVITY_NE; } else if (!strcmp(dir, "l")) { - resize_mode = RESIZE_L; + resize_mode = E_POINTER_RESIZE_L; grav = ECORE_X_GRAVITY_E; } bd->resize_mode = resize_mode; - _e_border_pointer_resize_begin(bd); + e_pointer_mode_push(bd, bd->resize_mode); _e_border_moveinfo_gather(bd, sig); GRAV_SET(bd, grav); if (bd->cur_mouse_action) @@ -4751,13 +4582,13 @@ e_border_signal_resize_end(E_Border *bd, { E_OBJECT_CHECK(bd); E_OBJECT_TYPE_CHECK(bd, E_BORDER_TYPE); - if (bd->resize_mode == RESIZE_NONE) return; + if (bd->resize_mode == E_POINTER_RESIZE_NONE) return; _e_border_resize_handle(bd); - _e_border_pointer_resize_end(bd); - bd->resize_mode = RESIZE_NONE; + e_pointer_mode_pop(bd, bd->resize_mode); + bd->resize_mode = E_POINTER_RESIZE_NONE; _e_border_resize_end(bd); bd->changes.reset_gravity = 1; - bd->changed = 1; + BD_CHANGED(bd); } EAPI void @@ -4859,12 +4690,6 @@ e_border_resize_limit(E_Border *bd, static void _e_border_free(E_Border *bd) { - if (warp_timer_border == bd) - { - if (warp_timer) ecore_timer_del(warp_timer); - warp_timer = NULL; - warp_timer_border = NULL; - } #if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8) if (bd->client.e.state.profile.use) { @@ -4911,6 +4736,12 @@ _e_border_free(E_Border *bd) tmp->client.e.state.video_parent_border = NULL; } } + if (bd->internal_ecore_evas) + { + e_canvas_del(bd->internal_ecore_evas); + ecore_evas_free(bd->internal_ecore_evas); + bd->internal_ecore_evas = NULL; + } if (bd->desktop) { efreet_desktop_free(bd->desktop); @@ -4921,11 +4752,7 @@ _e_border_free(E_Border *bd) ecore_idle_enterer_del(bd->post_job); bd->post_job = NULL; } - if (bd->pointer) - { - e_object_del(E_OBJECT(bd->pointer)); - bd->pointer = NULL; - } + if (bdresize == bd) _e_border_resize_end(bd); if (bdmove == bd) @@ -5002,7 +4829,6 @@ _e_border_free(E_Border *bd) focused = NULL; } - E_FREE_LIST(bd->handlers, ecore_event_handler_del); if (bd->remember) { E_Remember *rem; @@ -5079,7 +4905,7 @@ _e_border_free(E_Border *bd) if (bd->client.netwm.icon_name) eina_stringshare_del(bd->client.netwm.icon_name); bd->client.netwm.icon_name = NULL; - e_object_del(E_OBJECT(bd->shape)); + if (bd->shape) e_object_del(E_OBJECT(bd->shape)); bd->shape = NULL; if (bd->internal_icon) eina_stringshare_del(bd->internal_icon); bd->internal_icon = NULL; @@ -5089,16 +4915,10 @@ _e_border_free(E_Border *bd) bd->icon_object = NULL; evas_object_del(bd->bg_object); bd->bg_object = NULL; - e_canvas_del(bd->bg_ecore_evas); - ecore_evas_free(bd->bg_ecore_evas); - bd->bg_ecore_evas = NULL; - ecore_x_window_free(bd->client.shell_win); - bd->client.shell_win = 0; e_focus_setdown(bd); e_bindings_mouse_ungrab(E_BINDING_CONTEXT_WINDOW, bd->win); e_bindings_wheel_ungrab(E_BINDING_CONTEXT_WINDOW, bd->win); eina_hash_del(borders_hash, e_util_winid_str_get(bd->client.win), bd); - eina_hash_del(borders_hash, e_util_winid_str_get(bd->bg_win), bd); eina_hash_del(borders_hash, e_util_winid_str_get(bd->win), bd); ecore_x_window_free(bd->win); bd->win = 0; @@ -5130,6 +4950,22 @@ _e_border_free(E_Border *bd) */ static void +_e_border_shadow(E_Border *bd) +{ + Eina_Bool on = EINA_FALSE; + if (!bd->bg_object) return; + on = !bd->client.e.state.video; + if (on) + on = !bd->fullscreen; + if (on) + on = !!e_util_strcmp(bd->client.border.name, "borderless"); + if (on) + edje_object_signal_emit(bd->bg_object, "e,state,shadow,on", "e"); + else + edje_object_signal_emit(bd->bg_object, "e,state,shadow,off", "e"); +} + +static void _e_border_del(E_Border *bd) { E_Event_Border_Remove *ev; @@ -5144,9 +4980,17 @@ _e_border_del(E_Border *bd) focusing = NULL; focus_next = eina_list_remove(focus_next, bd); + bd->changed = 0; if (bd->fullscreen) bd->desk->fullscreen_borders--; + if (warp_timer_border == bd) + { + if (warp_timer) ecore_timer_del(warp_timer); + warp_timer = NULL; + warp_timer_border = NULL; + } + if ((drag_border) && (drag_border->data == bd)) { e_object_del(E_OBJECT(drag_border)); @@ -5370,8 +5214,8 @@ _e_border_cb_window_reparent(void *data __UNUSED__, e = ev; bd = e_border_find_by_client_window(e->win); if (!bd) return 1; - if (e->parent == bd->client.shell_win) return 1; - if (ecore_x_window_parent_get(e->win) == bd->client.shell_win) + if (e->parent == bd->win) return 1; + if (ecore_x_window_parent_get(e->win) == bd->win) { return 1; } @@ -5767,18 +5611,18 @@ _e_border_cb_window_property(void *data __UNUSED__, (!bd->client.netwm.fetch.name)) { bd->client.icccm.fetch.title = 1; - bd->changed = 1; + BD_CHANGED(bd); } } else if (e->atom == ECORE_X_ATOM_NET_WM_NAME) { bd->client.netwm.fetch.name = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ECORE_X_ATOM_WM_CLASS) { bd->client.icccm.fetch.name_class = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ECORE_X_ATOM_WM_ICON_NAME) { @@ -5786,33 +5630,33 @@ _e_border_cb_window_property(void *data __UNUSED__, (!bd->client.netwm.fetch.icon_name)) { bd->client.icccm.fetch.icon_name = 1; - bd->changed = 1; + BD_CHANGED(bd); } } else if (e->atom == ECORE_X_ATOM_NET_WM_ICON_NAME) { bd->client.netwm.fetch.icon_name = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ECORE_X_ATOM_WM_CLIENT_MACHINE) { bd->client.icccm.fetch.machine = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ECORE_X_ATOM_WM_PROTOCOLS) { bd->client.icccm.fetch.protocol = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ECORE_X_ATOM_WM_HINTS) { bd->client.icccm.fetch.hints = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ECORE_X_ATOM_WM_NORMAL_HINTS) { bd->client.icccm.fetch.size_pos_hints = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ECORE_X_ATOM_MOTIF_WM_HINTS) { @@ -5822,7 +5666,7 @@ _e_border_cb_window_property(void *data __UNUSED__, { */ bd->client.mwm.fetch.hints = 1; - bd->changed = 1; + BD_CHANGED(bd); /* } */ @@ -5830,103 +5674,103 @@ _e_border_cb_window_property(void *data __UNUSED__, else if (e->atom == ECORE_X_ATOM_WM_TRANSIENT_FOR) { bd->client.icccm.fetch.transient_for = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ECORE_X_ATOM_WM_CLIENT_LEADER) { bd->client.icccm.fetch.client_leader = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ECORE_X_ATOM_WM_WINDOW_ROLE) { bd->client.icccm.fetch.window_role = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ECORE_X_ATOM_NET_WM_ICON) { bd->client.netwm.fetch.icon = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ATM__QTOPIA_SOFT_MENU) { bd->client.qtopia.fetch.soft_menu = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ATM__QTOPIA_SOFT_MENUS) { bd->client.qtopia.fetch.soft_menus = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD_STATE) { bd->client.vkbd.fetch.state = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ECORE_X_ATOM_E_VIRTUAL_KEYBOARD) { bd->client.vkbd.fetch.vkbd = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ECORE_X_ATOM_E_ILLUME_CONFORMANT) { bd->client.illume.conformant.fetch.conformant = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_STATE) { bd->client.illume.quickpanel.fetch.state = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ECORE_X_ATOM_E_ILLUME_QUICKPANEL) { bd->client.illume.quickpanel.fetch.quickpanel = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MAJOR) { bd->client.illume.quickpanel.fetch.priority.major = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MINOR) { bd->client.illume.quickpanel.fetch.priority.minor = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ZONE) { bd->client.illume.quickpanel.fetch.zone = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ECORE_X_ATOM_E_ILLUME_DRAG_LOCKED) { bd->client.illume.drag.fetch.locked = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ECORE_X_ATOM_E_ILLUME_DRAG) { bd->client.illume.drag.fetch.drag = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ECORE_X_ATOM_E_ILLUME_WINDOW_STATE) { bd->client.illume.win_state.fetch.state = 1; - bd->changed = 1; + BD_CHANGED(bd); } /* else if (e->atom == ECORE_X_ATOM_NET_WM_USER_TIME) { bd->client.netwm.fetch.user_time = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ECORE_X_ATOM_NET_WM_STRUT) { bd->client.netwm.fetch.strut = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ECORE_X_ATOM_NET_WM_STRUT_PARTIAL) { bd->client.netwm.fetch.strut = 1; - bd->changed = 1; + BD_CHANGED(bd); } */ else if (e->atom == ECORE_X_ATOM_NET_WM_SYNC_REQUEST_COUNTER) @@ -5936,17 +5780,17 @@ _e_border_cb_window_property(void *data __UNUSED__, else if (e->atom == ECORE_X_ATOM_E_VIDEO_POSITION) { bd->client.e.fetch.video_position = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ECORE_X_ATOM_E_VIDEO_PARENT) { bd->client.e.fetch.video_parent = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ECORE_X_ATOM_NET_WM_STATE) { bd->client.netwm.fetch.state = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ECORE_X_ATOM_NET_WM_WINDOW_OPACITY) { @@ -5955,19 +5799,19 @@ _e_border_cb_window_property(void *data __UNUSED__, else { bd->client.netwm.fetch.opacity = 1; - bd->changed = 1; + BD_CHANGED(bd); } } #if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8) else if (e->atom == ECORE_X_ATOM_E_WINDOW_PROFILE_SUPPORTED) { bd->client.e.fetch.profile = 1; - bd->changed = 1; + BD_CHANGED(bd); } else if (e->atom == ECORE_X_ATOM_E_WINDOW_PROFILE_AVAILABLE_LIST) { bd->client.e.fetch.profile = 1; - bd->changed = 1; + BD_CHANGED(bd); } #endif return ECORE_CALLBACK_PASS_ON; @@ -6005,7 +5849,7 @@ _e_border_cb_window_shape(void *data __UNUSED__, bd->need_shape_merge = 1; // YYY bd->shaped_input = 1; bd->changes.shape_input = 1; - bd->changed = 1; + BD_CHANGED(bd); } return ECORE_CALLBACK_PASS_ON; @@ -6014,21 +5858,14 @@ _e_border_cb_window_shape(void *data __UNUSED__, if (bd) { bd->changes.shape = 1; - bd->changed = 1; + BD_CHANGED(bd); return ECORE_CALLBACK_PASS_ON; } bd = e_border_find_by_window(e->win); if (bd) { bd->need_shape_export = 1; - bd->changed = 1; - return ECORE_CALLBACK_PASS_ON; - } - bd = e_border_find_by_frame_window(e->win); - if (bd) - { - bd->need_shape_merge = 1; - bd->changed = 1; + BD_CHANGED(bd); return ECORE_CALLBACK_PASS_ON; } return ECORE_CALLBACK_PASS_ON; @@ -6205,7 +6042,7 @@ _e_border_cb_client_message(void *data __UNUSED__, int ev_type __UNUSED__, void if (e->message_type == ECORE_X_ATOM_NET_WM_WINDOW_OPACITY) { bd->client.netwm.fetch.opacity = 1; - bd->changed = 1; + BD_CHANGED(bd); } #if (ECORE_VERSION_MAJOR > 1) || (ECORE_VERSION_MINOR >= 8) else if (e->message_type == ECORE_X_ATOM_E_WINDOW_PROFILE_CHANGE) @@ -6279,7 +6116,7 @@ _e_border_cb_window_move_resize_request(void *data __UNUSED__, if ((bd->shaded) || (bd->shading) || (bd->fullscreen) || (bd->moving) || - (bd->resize_mode != RESIZE_NONE)) + (bd->resize_mode != E_POINTER_RESIZE_NONE)) return ECORE_CALLBACK_PASS_ON; if ((e->button >= 1) && (e->button <= 3)) @@ -6308,7 +6145,7 @@ _e_border_cb_window_move_resize_request(void *data __UNUSED__, if (!bd->lock_user_stacking) e_border_raise(bd); - if (e->direction == MOVE) + if (e->direction == E_POINTER_MOVE) { bd->cur_mouse_action = e_action_find("window_move"); if (bd->cur_mouse_action) @@ -6330,43 +6167,43 @@ _e_border_cb_window_move_resize_request(void *data __UNUSED__, switch (e->direction) { - case RESIZE_TL: - bd->resize_mode = RESIZE_TL; + case E_POINTER_RESIZE_TL: + bd->resize_mode = E_POINTER_RESIZE_TL; GRAV_SET(bd, ECORE_X_GRAVITY_SE); break; - case RESIZE_T: - bd->resize_mode = RESIZE_T; + case E_POINTER_RESIZE_T: + bd->resize_mode = E_POINTER_RESIZE_T; GRAV_SET(bd, ECORE_X_GRAVITY_S); break; - case RESIZE_TR: - bd->resize_mode = RESIZE_TR; + case E_POINTER_RESIZE_TR: + bd->resize_mode = E_POINTER_RESIZE_TR; GRAV_SET(bd, ECORE_X_GRAVITY_SW); break; - case RESIZE_R: - bd->resize_mode = RESIZE_R; + case E_POINTER_RESIZE_R: + bd->resize_mode = E_POINTER_RESIZE_R; GRAV_SET(bd, ECORE_X_GRAVITY_W); break; - case RESIZE_BR: - bd->resize_mode = RESIZE_BR; + case E_POINTER_RESIZE_BR: + bd->resize_mode = E_POINTER_RESIZE_BR; GRAV_SET(bd, ECORE_X_GRAVITY_NW); break; - case RESIZE_B: - bd->resize_mode = RESIZE_B; + case E_POINTER_RESIZE_B: + bd->resize_mode = E_POINTER_RESIZE_B; GRAV_SET(bd, ECORE_X_GRAVITY_N); break; - case RESIZE_BL: - bd->resize_mode = RESIZE_BL; + case E_POINTER_RESIZE_BL: + bd->resize_mode = E_POINTER_RESIZE_BL; GRAV_SET(bd, ECORE_X_GRAVITY_NE); break; - case RESIZE_L: - bd->resize_mode = RESIZE_L; + case E_POINTER_RESIZE_L: + bd->resize_mode = E_POINTER_RESIZE_L; GRAV_SET(bd, ECORE_X_GRAVITY_E); break; @@ -6465,7 +6302,6 @@ _e_border_cb_sync_alarm(void *data __UNUSED__, bd->changes.pos = 1; _e_border_eval(bd); - evas_render(bd->bg_evas); ecore_x_pointer_xy_get(e_manager_current_get()->root, &bd->mouse.current.mx, @@ -6494,7 +6330,7 @@ _e_border_cb_efreet_cache_update(void *data __UNUSED__, bd->desktop = NULL; } bd->changes.icon = 1; - bd->changed = 1; + BD_CHANGED(bd); } /* e_init_status_set(_("Desktop files scan done")); @@ -6515,7 +6351,7 @@ _e_border_cb_config_icon_theme(void *data __UNUSED__, EINA_LIST_FOREACH(borders, l, bd) { bd->changes.icon = 1; - bd->changed = 1; + BD_CHANGED(bd); } return ECORE_CALLBACK_PASS_ON; } @@ -6583,253 +6419,175 @@ _e_border_cb_signal_bind(void *data, emission, source); } +static void +_e_border_cb_mouse_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) +{ + Evas_Event_Mouse_In *ev = event_info; + E_Border *bd = data; + + if (grabbed) return; + if ((bd == focused) || (bd == focusing)) return; + if (focus_locked && (bd != warp_timer_border)) return; + if (e_object_is_del(E_OBJECT(bd))) return; + if (!bd->iconic) + e_focus_event_mouse_in(bd); + bd->mouse.current.mx = ev->output.x; + bd->mouse.current.my = ev->output.y; + return; +} + static Eina_Bool -_e_border_cb_mouse_in(void *data, - int type __UNUSED__, - void *event) +_e_border_cb_mouse_x_in(void *data EINA_UNUSED, int t EINA_UNUSED, Ecore_X_Event_Mouse_In *ev) { - Ecore_X_Event_Mouse_In *ev; E_Border *bd; - ev = event; - bd = data; -#ifdef INOUTDEBUG_MOUSE - { - time_t t; - char *ct; - - const char *modes[] = { - "MODE_NORMAL", - "MODE_WHILE_GRABBED", - "MODE_GRAB", - "MODE_UNGRAB" - }; - const char *details[] = { - "DETAIL_ANCESTOR", - "DETAIL_VIRTUAL", - "DETAIL_INFERIOR", - "DETAIL_NON_LINEAR", - "DETAIL_NON_LINEAR_VIRTUAL", - "DETAIL_POINTER", - "DETAIL_POINTER_ROOT", - "DETAIL_DETAIL_NONE" - }; - t = time(NULL); - ct = ctime(&t); - ct[strlen(ct) - 1] = 0; - DBG("@@ ->IN 0x%x 0x%x %s md=%s dt=%s", - ev->win, ev->event_win, - ct, - modes[ev->mode], - details[ev->detail]); - } -#endif - if (grabbed) return ECORE_CALLBACK_PASS_ON; - if (focus_locked) return ECORE_CALLBACK_RENEW; - if (ev->event_win == bd->win) - { - if (focus_locked && (bd != warp_timer_border)) return ECORE_CALLBACK_RENEW; - if (!bd->iconic) - e_focus_event_mouse_in(bd); - } - else if (focus_locked) - return ECORE_CALLBACK_RENEW; -#if 0 - if ((ev->win != bd->win) && - (ev->win != bd->event_win) && - (ev->event_win != bd->win) && - (ev->event_win != bd->event_win)) - return ECORE_CALLBACK_PASS_ON; -#else - if (ev->win != bd->event_win) return ECORE_CALLBACK_PASS_ON; -#endif + if (grabbed) return ECORE_CALLBACK_RENEW; + bd = e_border_find_by_window(ev->event_win); + if (!bd) return ECORE_CALLBACK_RENEW; + if ((bd == focused) || (bd == focusing)) return ECORE_CALLBACK_RENEW; + if (focus_locked && (bd != warp_timer_border)) return ECORE_CALLBACK_RENEW; + if (e_object_is_del(E_OBJECT(bd))) return ECORE_CALLBACK_RENEW; + if (!bd->iconic) + e_focus_event_mouse_in(bd); bd->mouse.current.mx = ev->root.x; bd->mouse.current.my = ev->root.y; - if (!bd->bg_evas_in) - { - evas_event_feed_mouse_in(bd->bg_evas, ev->time, NULL); - bd->bg_evas_in = EINA_TRUE; - } - return ECORE_CALLBACK_PASS_ON; + return ECORE_CALLBACK_RENEW; +} + +static void +_e_border_cb_mouse_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) +{ + Evas_Event_Mouse_Out *ev = event_info; + E_Border *bd = data; + + if (grabbed) return; + if (bd->fullscreen) return; + if ((bd != focused) && (bd == focusing)) return; + if (e_object_is_del(E_OBJECT(bd))) return; + if (E_INSIDE(ev->output.x, ev->output.y, bd->x, bd->y, bd->w, bd->h)) return; + if (!bd->iconic) + e_focus_event_mouse_out(bd); + bd->mouse.current.mx = ev->output.x; + bd->mouse.current.my = ev->output.y; } static Eina_Bool -_e_border_cb_mouse_out(void *data, - int type __UNUSED__, - void *event) +_e_border_cb_mouse_x_out(void *data EINA_UNUSED, int t EINA_UNUSED, Ecore_X_Event_Mouse_Out *ev) { - Ecore_X_Event_Mouse_Out *ev; E_Border *bd; - ev = event; - bd = data; -#ifdef INOUTDEBUG_MOUSE - { - time_t t; - char *ct; + if (grabbed) return ECORE_CALLBACK_RENEW; + bd = e_border_find_by_window(ev->event_win); + if (!bd) return ECORE_CALLBACK_RENEW; + if (bd->fullscreen) return ECORE_CALLBACK_RENEW; + if ((bd != focused) && (bd == focusing)) return ECORE_CALLBACK_RENEW; + if (e_object_is_del(E_OBJECT(bd))) return ECORE_CALLBACK_RENEW; + if (E_INSIDE(ev->root.x, ev->root.y, bd->x, bd->y, bd->w, bd->h)) return ECORE_CALLBACK_RENEW; - const char *modes[] = { - "MODE_NORMAL", - "MODE_WHILE_GRABBED", - "MODE_GRAB", - "MODE_UNGRAB" - }; - const char *details[] = { - "DETAIL_ANCESTOR", - "DETAIL_VIRTUAL", - "DETAIL_INFERIOR", - "DETAIL_NON_LINEAR", - "DETAIL_NON_LINEAR_VIRTUAL", - "DETAIL_POINTER", - "DETAIL_POINTER_ROOT", - "DETAIL_DETAIL_NONE" - }; - t = time(NULL); - ct = ctime(&t); - ct[strlen(ct) - 1] = 0; - DBG("@@ <-OUT 0x%x 0x%x %s md=%s dt=%s", - ev->win, ev->event_win, - ct, - modes[ev->mode], - details[ev->detail]); - } -#endif - if (grabbed) return ECORE_CALLBACK_PASS_ON; - if (ev->event_win == bd->win) - { - if (bd->fullscreen) - return ECORE_CALLBACK_PASS_ON; - if ((ev->mode == ECORE_X_EVENT_MODE_UNGRAB) && - (ev->detail == ECORE_X_EVENT_DETAIL_INFERIOR)) - return ECORE_CALLBACK_PASS_ON; - if (ev->mode == ECORE_X_EVENT_MODE_GRAB) - return ECORE_CALLBACK_PASS_ON; - if ((ev->mode == ECORE_X_EVENT_MODE_NORMAL) && - (ev->detail == ECORE_X_EVENT_DETAIL_INFERIOR)) - return ECORE_CALLBACK_PASS_ON; - if (!bd->iconic) - e_focus_event_mouse_out(bd); - } -#if 0 - if ((ev->win != bd->win) && - (ev->win != bd->event_win) && - (ev->event_win != bd->win) && - (ev->event_win != bd->event_win)) + if ((ev->mode == ECORE_X_EVENT_MODE_UNGRAB) && + (ev->detail == ECORE_X_EVENT_DETAIL_INFERIOR)) return ECORE_CALLBACK_PASS_ON; -#else - if (ev->win != bd->event_win) return ECORE_CALLBACK_PASS_ON; -#endif + if (ev->mode == ECORE_X_EVENT_MODE_GRAB) + return ECORE_CALLBACK_PASS_ON; + if ((ev->mode == ECORE_X_EVENT_MODE_NORMAL) && + (ev->detail == ECORE_X_EVENT_DETAIL_INFERIOR)) + return ECORE_CALLBACK_PASS_ON; + if (!bd->iconic) + e_focus_event_mouse_out(bd); bd->mouse.current.mx = ev->root.x; bd->mouse.current.my = ev->root.y; - if (bd->bg_evas_in) + return ECORE_CALLBACK_RENEW; +} + +static void +_e_border_cb_mouse_wheel_helper(E_Border *bd, Evas_Point *output, E_Binding_Event_Wheel *ev) +{ + bd->mouse.current.mx = output->x; + bd->mouse.current.my = output->y; + if (!bd->cur_mouse_action) { - if (!((evas_event_down_count_get(bd->bg_evas) > 0) && - (!((ev->mode == ECORE_X_EVENT_MODE_GRAB) && - (ev->detail == ECORE_X_EVENT_DETAIL_NON_LINEAR))))) - { - if (ev->mode == ECORE_X_EVENT_MODE_GRAB) - evas_event_feed_mouse_cancel(bd->bg_evas, ev->time, NULL); - evas_event_feed_mouse_out(bd->bg_evas, ev->time, NULL); - bd->bg_evas_in = EINA_FALSE; - } + e_bindings_wheel_event_handle(E_BINDING_CONTEXT_WINDOW, + E_OBJECT(bd), ev); } - return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_border_cb_mouse_wheel(void *data, - int type __UNUSED__, - void *event) +_e_border_cb_mouse_x_wheel(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Wheel *ev) { - Ecore_Event_Mouse_Wheel *ev; E_Border *bd; + E_Binding_Event_Wheel ev2; - ev = event; - bd = data; - if ((ev->event_window == bd->win) || - (ev->event_window == bd->event_win)) + if (action_input_win) + bd = action_border; + else { - bd->mouse.current.mx = ev->root.x; - bd->mouse.current.my = ev->root.y; - if (!bd->cur_mouse_action) - { - E_Binding_Event_Wheel ev2; - - e_bindings_ecore_event_mouse_wheel_convert(ev, &ev2); - e_bindings_wheel_event_handle(E_BINDING_CONTEXT_WINDOW, - E_OBJECT(bd), &ev2); - } + bd = e_border_find_by_client_window(ev->window); + if (!bd) return ECORE_CALLBACK_RENEW; + /* event_window here should be bd->win if it isn't the same as window, not sure if this can NOT happen */ + if ((ev->window != ev->event_window) && (bd->win != ev->event_window)) + return ECORE_CALLBACK_RENEW; } - evas_event_feed_mouse_wheel(bd->bg_evas, ev->direction, ev->z, ev->timestamp, NULL); - return ECORE_CALLBACK_PASS_ON; + e_bindings_ecore_event_mouse_wheel_convert(ev, &ev2); + _e_border_cb_mouse_wheel_helper(bd, (Evas_Point*)&ev->root, &ev2); + return ECORE_CALLBACK_RENEW; } -static Eina_Bool -_e_border_cb_mouse_down(void *data, - int type __UNUSED__, - void *event) +static void +_e_border_cb_mouse_wheel(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) { - Ecore_Event_Mouse_Button *ev; - E_Border *bd; + Evas_Event_Mouse_Wheel *ev = event_info; + E_Border *bd = data; + E_Binding_Event_Wheel ev2; - ev = event; - bd = data; - if ((ev->event_window == bd->win) || - (ev->event_window == bd->event_win)) - { - if ((ev->buttons >= 1) && (ev->buttons <= 3)) - { - bd->mouse.last_down[ev->buttons - 1].mx = ev->root.x; - bd->mouse.last_down[ev->buttons - 1].my = ev->root.y; - bd->mouse.last_down[ev->buttons - 1].x = bd->x + bd->fx.x; - bd->mouse.last_down[ev->buttons - 1].y = bd->y + bd->fx.y; - bd->mouse.last_down[ev->buttons - 1].w = bd->w; - bd->mouse.last_down[ev->buttons - 1].h = bd->h; - } - else - { - bd->moveinfo.down.x = bd->x + bd->fx.x; - bd->moveinfo.down.y = bd->y + bd->fx.y; - bd->moveinfo.down.w = bd->w; - bd->moveinfo.down.h = bd->h; - } - bd->mouse.current.mx = ev->root.x; - bd->mouse.current.my = ev->root.y; - if (!bd->cur_mouse_action) - { - E_Binding_Event_Mouse_Button ev2; + if (action_border) return; // already existing border doing something + e_bindings_evas_event_mouse_wheel_convert(ev, &ev2); + _e_border_cb_mouse_wheel_helper(bd, &ev->output, &ev2); +} - e_bindings_ecore_event_mouse_button_convert(ev, &ev2); - bd->cur_mouse_action = - e_bindings_mouse_down_event_handle(E_BINDING_CONTEXT_WINDOW, - E_OBJECT(bd), &ev2); - if (bd->cur_mouse_action) - { - if ((!bd->cur_mouse_action->func.end_mouse) && - (!bd->cur_mouse_action->func.end)) - bd->cur_mouse_action = NULL; - if (bd->cur_mouse_action) - e_object_ref(E_OBJECT(bd->cur_mouse_action)); - } - } - e_focus_event_mouse_down(bd); +static void +_e_border_cb_mouse_down_helper(E_Border *bd, int button, Evas_Point *output, E_Binding_Event_Mouse_Button *ev) +{ + if ((button >= 1) && (button <= 3)) + { + bd->mouse.last_down[button - 1].mx = output->x; + bd->mouse.last_down[button - 1].my = output->y; + bd->mouse.last_down[button - 1].x = bd->x + bd->fx.x; + bd->mouse.last_down[button - 1].y = bd->y + bd->fx.y; + bd->mouse.last_down[button - 1].w = bd->w; + bd->mouse.last_down[button - 1].h = bd->h; } - if (ev->window != ev->event_window) + else { - return 1; + bd->moveinfo.down.x = bd->x + bd->fx.x; + bd->moveinfo.down.y = bd->y + bd->fx.y; + bd->moveinfo.down.w = bd->w; + bd->moveinfo.down.h = bd->h; } - if ((ev->window != bd->event_win) && (ev->event_window != bd->win)) + bd->mouse.current.mx = output->x; + bd->mouse.current.my = output->y; + if (!bd->cur_mouse_action) { - return 1; + bd->cur_mouse_action = + e_bindings_mouse_down_event_handle(E_BINDING_CONTEXT_WINDOW, + E_OBJECT(bd), ev); + if (bd->cur_mouse_action) + { + if ((!bd->cur_mouse_action->func.end_mouse) && + (!bd->cur_mouse_action->func.end)) + bd->cur_mouse_action = NULL; + if (bd->cur_mouse_action) + e_object_ref(E_OBJECT(bd->cur_mouse_action)); + } } - if ((ev->buttons >= 1) && (ev->buttons <= 3)) + e_focus_event_mouse_down(bd); + if ((button >= 1) && (button <= 3)) { - bd->mouse.last_down[ev->buttons - 1].mx = ev->root.x; - bd->mouse.last_down[ev->buttons - 1].my = ev->root.y; - bd->mouse.last_down[ev->buttons - 1].x = bd->x + bd->fx.x; - bd->mouse.last_down[ev->buttons - 1].y = bd->y + bd->fx.y; - bd->mouse.last_down[ev->buttons - 1].w = bd->w; - bd->mouse.last_down[ev->buttons - 1].h = bd->h; + bd->mouse.last_down[button - 1].mx = output->x; + bd->mouse.last_down[button - 1].my = output->y; + bd->mouse.last_down[button - 1].x = bd->x + bd->fx.x; + bd->mouse.last_down[button - 1].y = bd->y + bd->fx.y; + bd->mouse.last_down[button - 1].w = bd->w; + bd->mouse.last_down[button - 1].h = bd->h; } else { @@ -6838,87 +6596,122 @@ _e_border_cb_mouse_down(void *data, bd->moveinfo.down.w = bd->w; bd->moveinfo.down.h = bd->h; } - bd->mouse.current.mx = ev->root.x; - bd->mouse.current.my = ev->root.y; + bd->mouse.current.mx = output->x; + bd->mouse.current.my = output->y; /* if (bd->moving) { } - else if (bd->resize_mode != RESIZE_NONE) + else if (bd->resize_mode != E_POINTER_RESIZE_NONE) { } else */ - { - Evas_Button_Flags flags = EVAS_BUTTON_NONE; - - if (ev->double_click) flags |= EVAS_BUTTON_DOUBLE_CLICK; - if (ev->triple_click) flags |= EVAS_BUTTON_TRIPLE_CLICK; - evas_event_feed_mouse_down(bd->bg_evas, ev->buttons, flags, ev->timestamp, NULL); - } - return ECORE_CALLBACK_PASS_ON; } static Eina_Bool -_e_border_cb_mouse_up(void *data, - int type __UNUSED__, - void *event) +_e_border_cb_mouse_x_down(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Button *ev) { - Ecore_Event_Mouse_Button *ev; E_Border *bd; + E_Binding_Event_Mouse_Button ev2; - ev = event; - bd = data; - if ((ev->event_window == bd->win) || - (ev->event_window == bd->event_win)) + if (action_input_win) + bd = action_border; + else { - if ((ev->buttons >= 1) && (ev->buttons <= 3)) - { - bd->mouse.last_up[ev->buttons - 1].mx = ev->root.x; - bd->mouse.last_up[ev->buttons - 1].my = ev->root.y; - bd->mouse.last_up[ev->buttons - 1].x = bd->x + bd->fx.x; - bd->mouse.last_up[ev->buttons - 1].y = bd->y + bd->fx.y; - } - bd->mouse.current.mx = ev->root.x; - bd->mouse.current.my = ev->root.y; - /* also we dont pass the same params that went in - then again that */ - /* should be ok as we are just ending the action if it has an end */ - if (bd->cur_mouse_action) - { - E_Binding_Event_Mouse_Button ev2; + bd = e_border_find_by_client_window(ev->window); + if (!bd) return ECORE_CALLBACK_RENEW; + /* event_window here should be bd->win if it isn't the same as window, not sure if this can NOT happen */ + if ((ev->window != ev->event_window) && (bd->win != ev->event_window)) + return ECORE_CALLBACK_RENEW; + } + e_bindings_ecore_event_mouse_button_convert(ev, &ev2); + _e_border_cb_mouse_down_helper(bd, ev->buttons, (Evas_Point*)&ev->root, &ev2); + return ECORE_CALLBACK_RENEW; +} - e_bindings_ecore_event_mouse_button_convert(ev, &ev2); - if (bd->cur_mouse_action->func.end_mouse) - bd->cur_mouse_action->func.end_mouse(E_OBJECT(bd), "", &ev2); - else if (bd->cur_mouse_action->func.end) - bd->cur_mouse_action->func.end(E_OBJECT(bd), ""); - e_object_unref(E_OBJECT(bd->cur_mouse_action)); - bd->cur_mouse_action = NULL; - } - else - { - E_Binding_Event_Mouse_Button ev2; +static void +_e_border_cb_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) +{ + Evas_Event_Mouse_Down *ev = event_info; + E_Border *bd = data; + E_Binding_Event_Mouse_Button ev2; - e_bindings_ecore_event_mouse_button_convert(ev, &ev2); - if (!e_bindings_mouse_up_event_handle(E_BINDING_CONTEXT_WINDOW, E_OBJECT(bd), &ev2)) - e_focus_event_mouse_up(bd); - } + if (action_border) return; // already existing border doing something + e_bindings_evas_event_mouse_button_convert(ev, &ev2); + _e_border_cb_mouse_down_helper(bd, ev->button, &ev->output, &ev2); +} + +static void +_e_border_cb_mouse_up_helper(E_Border *bd, int button, Evas_Point *output, E_Binding_Event_Mouse_Button* ev) +{ + if ((button >= 1) && (button <= 3)) + { + bd->mouse.last_up[button - 1].mx = output->x; + bd->mouse.last_up[button - 1].my = output->y; + bd->mouse.last_up[button - 1].x = bd->x + bd->fx.x; + bd->mouse.last_up[button - 1].y = bd->y + bd->fx.y; } - if (ev->window != bd->event_win) return ECORE_CALLBACK_PASS_ON; - if ((ev->buttons >= 1) && (ev->buttons <= 3)) + bd->mouse.current.mx = output->x; + bd->mouse.current.my = output->y; + /* also we dont pass the same params that went in - then again that */ + /* should be ok as we are just ending the action if it has an end */ + if (bd->cur_mouse_action) { - bd->mouse.last_up[ev->buttons - 1].mx = ev->root.x; - bd->mouse.last_up[ev->buttons - 1].my = ev->root.y; - bd->mouse.last_up[ev->buttons - 1].x = bd->x + bd->fx.x; - bd->mouse.last_up[ev->buttons - 1].y = bd->y + bd->fx.y; + if (bd->cur_mouse_action->func.end_mouse) + bd->cur_mouse_action->func.end_mouse(E_OBJECT(bd), "", ev); + else if (bd->cur_mouse_action->func.end) + bd->cur_mouse_action->func.end(E_OBJECT(bd), ""); + e_object_unref(E_OBJECT(bd->cur_mouse_action)); + bd->cur_mouse_action = NULL; + } + else + { + if (!e_bindings_mouse_up_event_handle(E_BINDING_CONTEXT_WINDOW, E_OBJECT(bd), ev)) + e_focus_event_mouse_up(bd); + } + if ((button >= 1) && (button <= 3)) + { + bd->mouse.last_up[button - 1].mx = output->x; + bd->mouse.last_up[button - 1].my = output->y; + bd->mouse.last_up[button - 1].x = bd->x + bd->fx.x; + bd->mouse.last_up[button - 1].y = bd->y + bd->fx.y; } - bd->mouse.current.mx = ev->root.x; - bd->mouse.current.my = ev->root.y; bd->drag.start = 0; +} - evas_event_feed_mouse_up(bd->bg_evas, ev->buttons, EVAS_BUTTON_NONE, ev->timestamp, NULL); - return ECORE_CALLBACK_PASS_ON; +static Eina_Bool +_e_border_cb_mouse_x_up(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Button *ev) +{ + E_Border *bd; + E_Binding_Event_Mouse_Button ev2; + + if (action_input_win) + bd = action_border; + else + { + bd = e_border_find_by_client_window(ev->window); + if (!bd) return ECORE_CALLBACK_RENEW; + /* event_window here should be bd->win if it isn't the same as window, not sure if this can NOT happen */ + if ((ev->window != ev->event_window) && (bd->win != ev->event_window)) + return ECORE_CALLBACK_RENEW; + } + e_bindings_ecore_event_mouse_button_convert(ev, &ev2); + _e_border_cb_mouse_up_helper(bd, ev->buttons, (Evas_Point*)&ev->root, &ev2); + return ECORE_CALLBACK_RENEW; +} + +static void +_e_border_cb_mouse_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) +{ + Evas_Event_Mouse_Down *ev = event_info; + E_Border *bd = data; + E_Binding_Event_Mouse_Button ev2; + + if (action_border) return; // already existing border doing something + e_bindings_evas_event_mouse_button_convert(ev, &ev2); + _e_border_cb_mouse_up_helper(bd, ev->button, &ev->output, &ev2); } static void @@ -6973,20 +6766,12 @@ _e_border_stay_within_container(E_Border *bd, int x, int y, int *new_x, int *new } } -static Eina_Bool -_e_border_cb_mouse_move(void *data, - int type __UNUSED__, - void *event) +static void +_e_border_cb_mouse_move_helper(E_Border *bd, Evas_Point *output) { - Ecore_Event_Mouse_Move *ev; - E_Border *bd; - ev = event; - bd = data; - if ((ev->window != bd->event_win) && - (ev->event_window != bd->win)) return ECORE_CALLBACK_PASS_ON; - bd->mouse.current.mx = ev->root.x; - bd->mouse.current.my = ev->root.y; + bd->mouse.current.mx = output->x; + bd->mouse.current.my = output->y; if (bd->moving) { int x, y, new_x, new_y; @@ -6998,7 +6783,7 @@ _e_border_cb_mouse_move(void *data, bd->client.netwm.sync.wait = 0; if ((bd->client.netwm.sync.request) && (bd->client.netwm.sync.alarm) && - (bd->client.netwm.sync.wait > 1)) return ECORE_CALLBACK_PASS_ON; + (bd->client.netwm.sync.wait > 1)) return; #endif if ((bd->moveinfo.down.button >= 1) && (bd->moveinfo.down.button <= 3)) { @@ -7031,9 +6816,9 @@ _e_border_cb_mouse_move(void *data, bd->shelf_fix.y = 0; bd->shelf_fix.modified = 0; e_border_move(bd, new_x, new_y); - e_zone_flip_coords_handle(bd->zone, ev->root.x, ev->root.y); + e_zone_flip_coords_handle(bd->zone, output->x, output->y); } - else if (bd->resize_mode != RESIZE_NONE) + else if (bd->resize_mode != E_POINTER_RESIZE_NONE) { if ((bd->client.netwm.sync.request) && (bd->client.netwm.sync.alarm)) @@ -7046,7 +6831,7 @@ _e_border_cb_mouse_move(void *data, { bd->changes.pos = 1; bd->changes.size = 1; - bd->changed = 1; + BD_CHANGED(bd); _e_border_client_move_resize_send(bd); } EINA_LIST_FREE(bd->pending_move_resize, pnd) @@ -7065,59 +6850,71 @@ _e_border_cb_mouse_move(void *data, else _e_border_resize_handle(bd); } - else + else if (bd->drag.start) { - if (bd->drag.start) + if ((bd->drag.x == -1) && (bd->drag.y == -1)) { - if ((bd->drag.x == -1) && (bd->drag.y == -1)) - { - bd->drag.x = ev->root.x; - bd->drag.y = ev->root.y; - } - else - { - int dx, dy; + bd->drag.x = output->x; + bd->drag.y = output->y; + } + else + { + int dx, dy; - dx = bd->drag.x - ev->root.x; - dy = bd->drag.y - ev->root.y; - if (((dx * dx) + (dy * dy)) > - (e_config->drag_resist * e_config->drag_resist)) + dx = bd->drag.x - output->x; + dy = bd->drag.y - output->y; + if (((dx * dx) + (dy * dy)) > + (e_config->drag_resist * e_config->drag_resist)) + { + /* start drag! */ + if (bd->icon_object) { - /* start drag! */ - if (bd->icon_object) + Evas_Object *o = NULL; + Evas_Coord x, y, w, h; + const char *drag_types[] = { "enlightenment/border" }; + + e_object_ref(E_OBJECT(bd)); + evas_object_geometry_get(bd->icon_object, + &x, &y, &w, &h); + drag_border = e_drag_new(bd->zone->container, + x, y, + drag_types, 1, bd, -1, + NULL, + _e_border_cb_drag_finished); + o = e_border_icon_add(bd, drag_border->evas); + if (!o) { - Evas_Object *o = NULL; - Evas_Coord x, y, w, h; - const char *drag_types[] = { "enlightenment/border" }; - - e_object_ref(E_OBJECT(bd)); - evas_object_geometry_get(bd->icon_object, - &x, &y, &w, &h); - drag_border = e_drag_new(bd->zone->container, - bd->x + bd->fx.x + x, - bd->y + bd->fx.y + y, - drag_types, 1, bd, -1, - NULL, - _e_border_cb_drag_finished); - o = e_border_icon_add(bd, drag_border->evas); - if (!o) - { - /* FIXME: fallback icon for drag */ - o = evas_object_rectangle_add(drag_border->evas); - evas_object_color_set(o, 255, 255, 255, 255); - } - e_drag_object_set(drag_border, o); - - e_drag_resize(drag_border, w, h); - e_drag_start(drag_border, bd->drag.x, bd->drag.y); + /* FIXME: fallback icon for drag */ + o = evas_object_rectangle_add(drag_border->evas); + evas_object_color_set(o, 255, 255, 255, 255); } - bd->drag.start = 0; + e_drag_object_set(drag_border, o); + + e_drag_resize(drag_border, w, h); + e_drag_start(drag_border, bd->drag.x, bd->drag.y); } + bd->drag.start = 0; } } - evas_event_feed_mouse_move(bd->bg_evas, ev->x, ev->y, ev->timestamp, NULL); } - return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool +_e_border_cb_mouse_x_move(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Move *ev) +{ + if (!action_input_win) return ECORE_CALLBACK_RENEW; + _e_border_cb_mouse_move_helper(action_border, (Evas_Point*)&ev->root); + return ECORE_CALLBACK_RENEW; +} + +static void +_e_border_cb_mouse_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) +{ + Evas_Event_Mouse_Move *ev = event_info; + E_Border *bd = data; + + if (action_border) return; // already existing border doing something + _e_border_cb_mouse_move_helper(bd, &ev->cur.output); } static Eina_Bool @@ -7181,7 +6978,7 @@ _e_border_cb_desk_window_profile_change(void *data __UNUSED__, if (!e_object_is_del(E_OBJECT(bd))) { bd->client.e.fetch.profile = 1; - bd->changed = 1; + BD_CHANGED(bd); } } return ECORE_CALLBACK_PASS_ON; @@ -7228,17 +7025,20 @@ _e_border_post_move_resize_job(void *data) else if ((bd->post_move) && (bd->post_resize)) { ecore_x_window_move_resize(bd->win, - bd->x + bd->fx.x, - bd->y + bd->fx.y, - bd->w, bd->h); + bd->x + bd->fx.x + bd->client_inset.l, + bd->y + bd->fx.y + bd->client_inset.t, + bd->w - (bd->client_inset.l + bd->client_inset.r), + bd->h - (bd->client_inset.t + bd->client_inset.b)); } else if (bd->post_move) { - ecore_x_window_move(bd->win, bd->x + bd->fx.x, bd->y + bd->fx.y); + ecore_x_window_move(bd->win, bd->x + bd->fx.x + bd->client_inset.l, bd->y + bd->fx.y + bd->client_inset.t); } else if (bd->post_resize) { - ecore_x_window_resize(bd->win, bd->w, bd->h); + ecore_x_window_resize(bd->win, + bd->w - (bd->client_inset.l + bd->client_inset.r), + bd->h - (bd->client_inset.t + bd->client_inset.b)); } if (bd->client.e.state.video) @@ -7598,7 +7398,7 @@ _e_border_eval0(E_Border *bd) // if (bd->client.icccm.step_w < 1) bd->client.icccm.step_w = 1; // if (bd->client.icccm.step_h < 1) bd->client.icccm.step_h = 1; // if doing a resize, fix it up - if (bd->resize_mode != RESIZE_NONE) + if (bd->resize_mode != E_POINTER_RESIZE_NONE) { int x, y, w, h, new_w, new_h; @@ -7609,13 +7409,13 @@ _e_border_eval0(E_Border *bd) new_w = w; new_h = h; e_border_resize_limit(bd, &new_w, &new_h); - if ((bd->resize_mode == RESIZE_TL) || - (bd->resize_mode == RESIZE_L) || - (bd->resize_mode == RESIZE_BL)) + if ((bd->resize_mode == E_POINTER_RESIZE_TL) || + (bd->resize_mode == E_POINTER_RESIZE_L) || + (bd->resize_mode == E_POINTER_RESIZE_BL)) x += (w - new_w); - if ((bd->resize_mode == RESIZE_TL) || - (bd->resize_mode == RESIZE_T) || - (bd->resize_mode == RESIZE_TR)) + if ((bd->resize_mode == E_POINTER_RESIZE_TL) || + (bd->resize_mode == E_POINTER_RESIZE_T) || + (bd->resize_mode == E_POINTER_RESIZE_TR)) y += (h - new_h); e_border_move_resize(bd, x, y, new_w, new_h); } @@ -7692,7 +7492,7 @@ _e_border_eval0(E_Border *bd) bd->parent->lock_close = 1; if (!bd->parent->client.lock_win) { - bd->parent->client.lock_win = ecore_x_window_input_new(bd->parent->client.shell_win, 0, 0, bd->parent->client.w, bd->parent->client.h); + bd->parent->client.lock_win = ecore_x_window_input_new(bd->parent->win, 0, 0, bd->parent->client.w, bd->parent->client.h); ecore_x_window_show(bd->parent->client.lock_win); } } @@ -8273,7 +8073,7 @@ _e_border_eval0(E_Border *bd) { if (!bd->internal) ecore_x_window_save_set_add(bd->client.win); - ecore_x_window_reparent(bd->client.win, bd->client.shell_win, 0, 0); + ecore_x_window_reparent(bd->client.win, bd->win, bd->client_inset.l, bd->client_inset.t); if (bd->visible) { if ((bd->new_client) && (bd->internal) && @@ -8329,7 +8129,7 @@ _e_border_eval0(E_Border *bd) if ((!bd->client.border.name) || (strcmp(bd->client.border.name, bordername))) { - Evas_Object *o; + Evas_Object *o, *pbg = bd->bg_object; char buf[4096]; int ok; @@ -8338,12 +8138,15 @@ _e_border_eval0(E_Border *bd) if (bd->bg_object) { + int w, h; + + w = bd->w, h = bd->h; bd->w -= (bd->client_inset.l + bd->client_inset.r); bd->h -= (bd->client_inset.t + bd->client_inset.b); - bd->changes.size = 1; + if ((bd->w != w) || (h != bd->h)) bd->changes.size = 1; evas_object_del(bd->bg_object); } - o = edje_object_add(bd->bg_evas); + o = edje_object_add(e_comp_get(bd)->evas); snprintf(buf, sizeof(buf), "e/widgets/border/%s/border", bd->client.border.name); ok = e_theme_edje_object_set(o, "base/theme/borders", buf); if ((!ok) && (strcmp(bd->client.border.name, "borderless"))) @@ -8366,67 +8169,76 @@ _e_border_eval0(E_Border *bd) } } - bd->shaped = 0; if (ok) { - const char *shape_option, *argb_option; - int use_argb = 0; - bd->bg_object = o; - if ((!e_config->use_shaped_win) && (!bd->client.argb)) - { - argb_option = edje_object_data_get(o, "argb"); - if ((argb_option) && (!strcmp(argb_option, "1"))) - use_argb = 1; - - o = bd->bg_object; - if (use_argb != bd->argb) - _e_border_frame_replace(bd, use_argb); - - if (bd->icon_object != o) - { - if (bd->bg_object) - { - evas_object_show(bd->icon_object); - edje_object_part_swallow(bd->bg_object, "e.swallow.icon", bd->icon_object); - } - else - evas_object_hide(bd->icon_object); - } - o = bd->bg_object; - } - - if (!bd->argb) - { - shape_option = edje_object_data_get(o, "shaped"); - if ((shape_option) && (!strcmp(shape_option, "1"))) - bd->shaped = 1; - } - if (bd->client.netwm.name) edje_object_part_text_set(o, "e.text.title", bd->client.netwm.name); else if (bd->client.icccm.title) edje_object_part_text_set(o, "e.text.title", bd->client.icccm.title); + bd->theme_shadow = !!edje_object_data_get(o, "shadow"); + _e_border_shadow(bd); } else { + if (strcmp(bordername, "borderless")) + /* it should never happen that a theme fails to set the edje + * unless it's using borderless + */ + CRI("USER IS USING A SHITTY THEME! ABORT!!!!"); evas_object_del(o); bd->bg_object = NULL; + E_FREE_FUNC(bd->icon_object, evas_object_del); + o = bd->cw ? bd->cw->obj : NULL; + } + if (bd->cw) e_comp_win_reshadow(bd->cw); + /* FIXME: it's theoretically possible that o is NULL here if first border eval occurs for a fullscreen + * borderless window before its comp win has been set up; + * E19 material imo + */ + if (o) + { + if (bd->cw && (o == bd->cw->obj)) + { + /* TODO: set these on cw->effect_obj...always. */ + evas_object_event_callback_del_full(o, EVAS_CALLBACK_MOUSE_IN, _e_border_cb_mouse_in, bd); + evas_object_event_callback_del_full(o, EVAS_CALLBACK_MOUSE_MOVE, _e_border_cb_mouse_move, bd); + evas_object_event_callback_del_full(o, EVAS_CALLBACK_MOUSE_OUT, _e_border_cb_mouse_out, bd); + evas_object_event_callback_del_full(o, EVAS_CALLBACK_MOUSE_DOWN, _e_border_cb_mouse_down, bd); + evas_object_event_callback_del_full(o, EVAS_CALLBACK_MOUSE_UP, _e_border_cb_mouse_up, bd); + evas_object_event_callback_del_full(o, EVAS_CALLBACK_MOUSE_WHEEL, _e_border_cb_mouse_wheel, bd); + } + evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_IN, _e_border_cb_mouse_in, bd); + evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_MOVE, _e_border_cb_mouse_move, bd); + evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_OUT, _e_border_cb_mouse_out, bd); + evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, _e_border_cb_mouse_down, bd); + evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, _e_border_cb_mouse_up, bd); + evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_WHEEL, _e_border_cb_mouse_wheel, bd); } - _e_border_client_inset_calc(bd); + { + // previously calculated + Eina_Bool calc = bd->client_inset.calc; + // previously was borderless + Eina_Bool inset, pinset = !!(bd->client_inset.l + bd->client_inset.r + bd->client_inset.t + bd->client_inset.b); + + _e_border_client_inset_calc(bd); + inset = !!(bd->client_inset.l + bd->client_inset.r + bd->client_inset.t + bd->client_inset.b); + if (calc && (inset != pinset) && (pbg || (!bd->bg_object))) + { + if (inset) + bd->x -= bd->client_inset.l, bd->y -= bd->client_inset.t; + else + bd->x += bd->client_inset.l, bd->y += bd->client_inset.t; + } + } bd->w += (bd->client_inset.l + bd->client_inset.r); bd->h += (bd->client_inset.t + bd->client_inset.b); - ecore_evas_shaped_set(bd->bg_ecore_evas, bd->shaped); bd->changes.size = 1; - /* really needed ? */ - ecore_x_window_move(bd->client.shell_win, - bd->client_inset.l, - bd->client_inset.t); if (bd->maximized != E_MAXIMIZE_NONE) { @@ -8462,10 +8274,6 @@ _e_border_eval0(E_Border *bd) // FIXME: in eval -do differently // edje_object_message_signal_process(bd->bg_object); // e_border_frame_recalc(bd); - - evas_object_move(bd->bg_object, 0, 0); - evas_object_resize(bd->bg_object, bd->w, bd->h); - evas_object_show(bd->bg_object); } } bd->client.border.changed = 0; @@ -8808,45 +8616,45 @@ _e_border_eval(E_Border *bd) if ((bd->changes.shading)) { /* show at start of unshade (but don't hide until end of shade) */ - if (bd->shaded) - ecore_x_window_raise(bd->client.shell_win); + //if (bd->shaded) + //ecore_x_window_raise(bd->win); bd->changes.shading = 0; rem_change = 1; } if ((bd->changes.shaded) && (bd->changes.pos) && (bd->changes.size)) { - if (bd->shaded) - ecore_x_window_lower(bd->client.shell_win); - else - ecore_x_window_raise(bd->client.shell_win); + //if (bd->shaded) + //ecore_x_window_lower(bd->win); + //else + //ecore_x_window_raise(bd->win); bd->changes.shaded = 0; rem_change = 1; } else if ((bd->changes.shaded) && (bd->changes.pos)) { - if (bd->shaded) - ecore_x_window_lower(bd->client.shell_win); - else - ecore_x_window_raise(bd->client.shell_win); + //if (bd->shaded) + //ecore_x_window_lower(bd->win); + //else + //ecore_x_window_raise(bd->win); bd->changes.size = 1; bd->changes.shaded = 0; rem_change = 1; } else if ((bd->changes.shaded) && (bd->changes.size)) { - if (bd->shaded) - ecore_x_window_lower(bd->client.shell_win); - else - ecore_x_window_raise(bd->client.shell_win); + //if (bd->shaded) + //ecore_x_window_lower(bd->win); + //else + //ecore_x_window_raise(bd->win); bd->changes.shaded = 0; rem_change = 1; } else if (bd->changes.shaded) { - if (bd->shaded) - ecore_x_window_lower(bd->client.shell_win); - else - ecore_x_window_raise(bd->client.shell_win); + //if (bd->shaded) + //ecore_x_window_lower(bd->win); + //else + //ecore_x_window_raise(bd->win); bd->changes.size = 1; bd->changes.shaded = 0; rem_change = 1; @@ -8854,30 +8662,24 @@ _e_border_eval(E_Border *bd) if (bd->changes.size) { - int x = 0, y = 0, xx = 0, yy = 0; + int x, y, w = 0, h = 0; - if ((bd->shaded) && (!bd->shading)) - { - evas_obscured_clear(bd->bg_evas); - } - else + x = bd->x + bd->client_inset.l; + y = bd->y + bd->client_inset.t; + if ((!bd->shaded) || (bd->shading)) { - xx = bd->w - (bd->client_inset.l + bd->client_inset.r); - yy = bd->h - (bd->client_inset.t + bd->client_inset.b); - - evas_obscured_clear(bd->bg_evas); - evas_obscured_rectangle_add(bd->bg_evas, - bd->client_inset.l, bd->client_inset.t, xx, yy); + w = bd->w - (bd->client_inset.l + bd->client_inset.r); + h = bd->h - (bd->client_inset.t + bd->client_inset.b); if (bd->shading) { if (bd->shade.dir == E_DIRECTION_UP) { - y = yy - bd->client.h; + y = h - bd->client.h; } else if (bd->shade.dir == E_DIRECTION_LEFT) { - x = xx - bd->client.w; + x = w - bd->client.w; } } } @@ -8909,36 +8711,26 @@ _e_border_eval(E_Border *bd) E_Border *tmp; Eina_List *l; - ecore_x_window_move_resize(bd->win, - bd->x + bd->fx.x, - bd->y + bd->fx.y, - bd->w, bd->h); - EINA_LIST_FOREACH(bd->client.e.state.video_child, l, tmp) ecore_x_window_move(tmp->win, bd->x + bd->fx.x + bd->client_inset.l + tmp->client.e.state.video_position.x, bd->y + bd->fx.y + bd->client_inset.t + tmp->client.e.state.video_position.y); } - ecore_x_window_move_resize(bd->event_win, 0, 0, bd->w, bd->h); - if ((!bd->shaded) || (bd->shading)) - ecore_x_window_move_resize(bd->client.shell_win, - bd->client_inset.l, bd->client_inset.t, xx, yy); + ecore_x_window_move_resize(bd->win, x, y, w, h); if (bd->internal_ecore_evas) - ecore_evas_move_resize(bd->internal_ecore_evas, x, y, bd->client.w, bd->client.h); + ecore_evas_move_resize(bd->internal_ecore_evas, 0, 0, w, h); else if (!bd->client.e.state.video) { - ecore_x_window_move_resize(bd->client.win, x, y, bd->client.w, bd->client.h); - ecore_x_window_move_resize(bd->client.lock_win, x, y, bd->client.w, bd->client.h); + ecore_x_window_move_resize(bd->client.win, 0, 0, bd->client.w, bd->client.h); + ecore_x_window_move_resize(bd->client.lock_win, 0, 0, bd->client.w, bd->client.h); } - ecore_evas_move_resize(bd->bg_ecore_evas, 0, 0, bd->w, bd->h); - evas_object_resize(bd->bg_object, bd->w, bd->h); - e_container_shape_resize(bd->shape, bd->w, bd->h); + e_container_shape_resize(bd->shape, w, h); if (bd->changes.pos) - e_container_shape_move(bd->shape, bd->x + bd->fx.x, bd->y + bd->fx.y); + e_container_shape_move(bd->shape, x, y); _e_border_client_move_resize_send(bd); @@ -8952,7 +8744,7 @@ _e_border_eval(E_Border *bd) bd->post_job = ecore_idle_enterer_add(_e_border_post_move_resize_job, bd); bd->post_move = 1; - e_container_shape_move(bd->shape, bd->x + bd->fx.x, bd->y + bd->fx.y); + e_container_shape_move(bd->shape, bd->x + bd->fx.x + bd->client_inset.l, bd->y + bd->fx.y + bd->client_inset.t); _e_border_client_move_resize_send(bd); @@ -8970,37 +8762,33 @@ _e_border_eval(E_Border *bd) if (bd->need_shape_merge) { _e_border_shape_input_rectangle_set(bd); - if ((bd->shaped) || (bd->client.shaped)) + if (bd->client.shaped) { Ecore_X_Window twin, twin2; int x, y; + Ecore_X_Rectangle rects[4]; twin = ecore_x_window_override_new (bd->zone->container->scratch_win, 0, 0, bd->w, bd->h); - if (bd->shaped) - ecore_x_window_shape_window_set(twin, bd->bg_win); - else - { - Ecore_X_Rectangle rects[4]; - - rects[0].x = 0; - rects[0].y = 0; - rects[0].width = bd->w; - rects[0].height = bd->client_inset.t; - rects[1].x = 0; - rects[1].y = bd->client_inset.t; - rects[1].width = bd->client_inset.l; - rects[1].height = bd->h - bd->client_inset.t - bd->client_inset.b; - rects[2].x = bd->w - bd->client_inset.r; - rects[2].y = bd->client_inset.t; - rects[2].width = bd->client_inset.r; - rects[2].height = bd->h - bd->client_inset.t - bd->client_inset.b; - rects[3].x = 0; - rects[3].y = bd->h - bd->client_inset.b; - rects[3].width = bd->w; - rects[3].height = bd->client_inset.b; - ecore_x_window_shape_rectangles_set(twin, rects, 4); - } + + + rects[0].x = 0; + rects[0].y = 0; + rects[0].width = bd->w; + rects[0].height = bd->client_inset.t; + rects[1].x = 0; + rects[1].y = bd->client_inset.t; + rects[1].width = bd->client_inset.l; + rects[1].height = bd->h - bd->client_inset.t - bd->client_inset.b; + rects[2].x = bd->w - bd->client_inset.r; + rects[2].y = bd->client_inset.t; + rects[2].width = bd->client_inset.r; + rects[2].height = bd->h - bd->client_inset.t - bd->client_inset.b; + rects[3].x = 0; + rects[3].y = bd->h - bd->client_inset.b; + rects[3].width = bd->w; + rects[3].height = bd->client_inset.b; + ecore_x_window_shape_rectangles_set(twin, rects, 4); twin2 = ecore_x_window_override_new (bd->zone->container->scratch_win, 0, 0, bd->w - bd->client_inset.l - bd->client_inset.r, @@ -9123,7 +8911,7 @@ _e_border_eval(E_Border *bd) { bd->x = x - (bd->w >> 1); bd->y = y - (bd->client_inset.t >> 1); - bd->changed = 1; + BD_CHANGED(bd); bd->changes.pos = 1; _e_border_client_move_resize_send(bd); @@ -9220,7 +9008,7 @@ _e_border_eval(E_Border *bd) bd->desktop->orig_path); } - bd->icon_object = e_border_icon_add(bd, bd->bg_evas); + bd->icon_object = e_border_icon_add(bd, e_comp_get(bd)->evas); if ((bd->focused) && (bd->icon_object)) edje_object_signal_emit(bd->icon_object, "e,state,focused", "e"); if (bd->bg_object) @@ -9349,9 +9137,9 @@ _e_border_resize_handle(E_Border *bd) w = bd->w; h = bd->h; - if ((bd->resize_mode == RESIZE_TR) || - (bd->resize_mode == RESIZE_R) || - (bd->resize_mode == RESIZE_BR)) + if ((bd->resize_mode == E_POINTER_RESIZE_TR) || + (bd->resize_mode == E_POINTER_RESIZE_R) || + (bd->resize_mode == E_POINTER_RESIZE_BR)) { if ((bd->moveinfo.down.button >= 1) && (bd->moveinfo.down.button <= 3)) @@ -9360,9 +9148,9 @@ _e_border_resize_handle(E_Border *bd) else w = bd->moveinfo.down.w + (bd->mouse.current.mx - bd->moveinfo.down.mx); } - else if ((bd->resize_mode == RESIZE_TL) || - (bd->resize_mode == RESIZE_L) || - (bd->resize_mode == RESIZE_BL)) + else if ((bd->resize_mode == E_POINTER_RESIZE_TL) || + (bd->resize_mode == E_POINTER_RESIZE_L) || + (bd->resize_mode == E_POINTER_RESIZE_BL)) { if ((bd->moveinfo.down.button >= 1) && (bd->moveinfo.down.button <= 3)) @@ -9372,9 +9160,9 @@ _e_border_resize_handle(E_Border *bd) w = bd->moveinfo.down.w - (bd->mouse.current.mx - bd->moveinfo.down.mx); } - if ((bd->resize_mode == RESIZE_TL) || - (bd->resize_mode == RESIZE_T) || - (bd->resize_mode == RESIZE_TR)) + if ((bd->resize_mode == E_POINTER_RESIZE_TL) || + (bd->resize_mode == E_POINTER_RESIZE_T) || + (bd->resize_mode == E_POINTER_RESIZE_TR)) { if ((bd->moveinfo.down.button >= 1) && (bd->moveinfo.down.button <= 3)) @@ -9383,9 +9171,9 @@ _e_border_resize_handle(E_Border *bd) else h = bd->moveinfo.down.h - (bd->mouse.current.my - bd->moveinfo.down.my); } - else if ((bd->resize_mode == RESIZE_BL) || - (bd->resize_mode == RESIZE_B) || - (bd->resize_mode == RESIZE_BR)) + else if ((bd->resize_mode == E_POINTER_RESIZE_BL) || + (bd->resize_mode == E_POINTER_RESIZE_B) || + (bd->resize_mode == E_POINTER_RESIZE_BR)) { if ((bd->moveinfo.down.button >= 1) && (bd->moveinfo.down.button <= 3)) @@ -9398,13 +9186,13 @@ _e_border_resize_handle(E_Border *bd) tw = bd->w; th = bd->h; - if ((bd->resize_mode == RESIZE_TL) || - (bd->resize_mode == RESIZE_L) || - (bd->resize_mode == RESIZE_BL)) + if ((bd->resize_mode == E_POINTER_RESIZE_TL) || + (bd->resize_mode == E_POINTER_RESIZE_L) || + (bd->resize_mode == E_POINTER_RESIZE_BL)) x += (tw - w); - if ((bd->resize_mode == RESIZE_TL) || - (bd->resize_mode == RESIZE_T) || - (bd->resize_mode == RESIZE_TR)) + if ((bd->resize_mode == E_POINTER_RESIZE_TL) || + (bd->resize_mode == E_POINTER_RESIZE_T) || + (bd->resize_mode == E_POINTER_RESIZE_TR)) y += (th - h); skiplist = eina_list_append(skiplist, bd); @@ -9417,13 +9205,13 @@ _e_border_resize_handle(E_Border *bd) w = new_w; h = new_h; e_border_resize_limit(bd, &new_w, &new_h); - if ((bd->resize_mode == RESIZE_TL) || - (bd->resize_mode == RESIZE_L) || - (bd->resize_mode == RESIZE_BL)) + if ((bd->resize_mode == E_POINTER_RESIZE_TL) || + (bd->resize_mode == E_POINTER_RESIZE_L) || + (bd->resize_mode == E_POINTER_RESIZE_BL)) new_x += (w - new_w); - if ((bd->resize_mode == RESIZE_TL) || - (bd->resize_mode == RESIZE_T) || - (bd->resize_mode == RESIZE_TR)) + if ((bd->resize_mode == E_POINTER_RESIZE_TL) || + (bd->resize_mode == E_POINTER_RESIZE_T) || + (bd->resize_mode == E_POINTER_RESIZE_TR)) new_y += (h - new_h); e_border_move_resize(bd, new_x, new_y, new_w, new_h); @@ -9526,7 +9314,7 @@ _e_border_shade_animator(void *data) bd->changes.pos = 1; } - if ((bd->shaped) || (bd->client.shaped)) + if (bd->client.shaped) { bd->need_shape_merge = 1; bd->need_shape_export = 1; @@ -9536,7 +9324,7 @@ _e_border_shade_animator(void *data) bd->need_shape_merge = 1; } bd->changes.size = 1; - bd->changed = 1; + BD_CHANGED(bd); /* we're done */ if (val == 1) @@ -9548,7 +9336,7 @@ _e_border_shade_animator(void *data) bd->changes.size = 1; bd->changes.shaded = 1; bd->changes.shading = 1; - bd->changed = 1; + BD_CHANGED(bd); bd->shade.anim = NULL; if (bd->shaded) @@ -9886,7 +9674,7 @@ _e_border_resize_end(E_Border *bd) /* resize to last geometry if sync alarm for it was not yet handled */ if (bd->pending_move_resize) { - bd->changed = 1; + BD_CHANGED(bd); bd->changes.pos = 1; bd->changes.size = 1; _e_border_client_move_resize_send(bd); @@ -10033,96 +9821,6 @@ _e_border_cb_kill_timer(void *data) return ECORE_CALLBACK_CANCEL; } -static void -_e_border_pointer_resize_begin(E_Border *bd) -{ - switch (bd->resize_mode) - { - case RESIZE_TL: - e_pointer_type_push(bd->pointer, bd, "resize_tl"); - break; - - case RESIZE_T: - e_pointer_type_push(bd->pointer, bd, "resize_t"); - break; - - case RESIZE_TR: - e_pointer_type_push(bd->pointer, bd, "resize_tr"); - break; - - case RESIZE_R: - e_pointer_type_push(bd->pointer, bd, "resize_r"); - break; - - case RESIZE_BR: - e_pointer_type_push(bd->pointer, bd, "resize_br"); - break; - - case RESIZE_B: - e_pointer_type_push(bd->pointer, bd, "resize_b"); - break; - - case RESIZE_BL: - e_pointer_type_push(bd->pointer, bd, "resize_bl"); - break; - - case RESIZE_L: - e_pointer_type_push(bd->pointer, bd, "resize_l"); - break; - } -} - -static void -_e_border_pointer_resize_end(E_Border *bd) -{ - switch (bd->resize_mode) - { - case RESIZE_TL: - e_pointer_type_pop(bd->pointer, bd, "resize_tl"); - break; - - case RESIZE_T: - e_pointer_type_pop(bd->pointer, bd, "resize_t"); - break; - - case RESIZE_TR: - e_pointer_type_pop(bd->pointer, bd, "resize_tr"); - break; - - case RESIZE_R: - e_pointer_type_pop(bd->pointer, bd, "resize_r"); - break; - - case RESIZE_BR: - e_pointer_type_pop(bd->pointer, bd, "resize_br"); - break; - - case RESIZE_B: - e_pointer_type_pop(bd->pointer, bd, "resize_b"); - break; - - case RESIZE_BL: - e_pointer_type_pop(bd->pointer, bd, "resize_bl"); - break; - - case RESIZE_L: - e_pointer_type_pop(bd->pointer, bd, "resize_l"); - break; - } -} - -static void -_e_border_pointer_move_begin(E_Border *bd) -{ - e_pointer_type_push(bd->pointer, bd, "move"); -} - -static void -_e_border_pointer_move_end(E_Border *bd) -{ - e_pointer_type_pop(bd->pointer, bd, "move"); -} - static Eina_List *_e_border_hooks = NULL; static int _e_border_hooks_delete = 0; static int _e_border_hooks_walking = 0; diff --git a/src/bin/e_border.h b/src/bin/e_border.h index 19a4358ca2..fd4dac4fe8 100644 --- a/src/bin/e_border.h +++ b/src/bin/e_border.h @@ -125,7 +125,7 @@ typedef struct _E_Event_Border_Simple E_Event_Border_Move; typedef struct _E_Event_Border_Simple E_Event_Border_Add; typedef struct _E_Event_Border_Simple E_Event_Border_Remove; typedef struct _E_Event_Border_Simple E_Event_Border_Show; -typedef struct _E_Event_Border_Simple E_Event_Border_Hide; +typedef struct _E_Event_Border_Hide E_Event_Border_Hide; typedef struct _E_Event_Border_Simple E_Event_Border_Iconify; typedef struct _E_Event_Border_Simple E_Event_Border_Uniconify; typedef struct _E_Event_Border_Simple E_Event_Border_Stick; @@ -170,12 +170,10 @@ struct _E_Border } down; } moveinfo; - Ecore_X_Window win; int x, y, w, h; int ref; E_Zone *zone; E_Desk *desk; - Eina_List *handlers; struct { @@ -190,26 +188,22 @@ struct _E_Border struct { int l, r, t, b; + Eina_Bool calc : 1; // inset has been calculated } client_inset; E_Comp_Win *cw; - Ecore_Evas *bg_ecore_evas; - Evas *bg_evas; - Ecore_X_Window bg_win; + Ecore_X_Window win; Evas_Object *bg_object; Evas_Object *icon_object; - Ecore_X_Window event_win; Eina_Stringshare *internal_icon; Eina_Stringshare *internal_icon_key; - Eina_Bool bg_evas_in : 1; struct { - Ecore_X_Window shell_win; Ecore_X_Window lock_win; Ecore_X_Window win; - int x, y, w, h; + int w, h; struct { @@ -516,7 +510,6 @@ struct _E_Border unsigned int iconic : 1; unsigned int deskshow : 1; unsigned int sticky : 1; - unsigned int shaped : 1; unsigned int shaped_input : 1; unsigned int need_shape_merge : 1; unsigned int need_shape_export : 1; @@ -566,6 +559,7 @@ struct _E_Border unsigned int internal_no_remember : 1; unsigned int internal_no_reopen : 1; unsigned int stolen : 1; + Eina_Bool theme_shadow : 1; Ecore_Evas *internal_ecore_evas; @@ -659,7 +653,6 @@ struct _E_Border Eina_List *transients; Efreet_Desktop *desktop; - E_Pointer *pointer; unsigned char comp_hidden : 1; @@ -692,6 +685,12 @@ struct _E_Border_Hook unsigned char delete_me : 1; }; +struct _E_Event_Border_Hide +{ + E_Border *border; + int manage; +}; + struct _E_Event_Border_Simple { E_Border *border; @@ -762,7 +761,6 @@ EAPI void e_border_pinned_set(E_Border *bd, int set); EAPI E_Border *e_border_find_by_client_window(Ecore_X_Window win); EAPI E_Border *e_border_find_all_by_client_window(Ecore_X_Window win); -EAPI E_Border *e_border_find_by_frame_window(Ecore_X_Window win); EAPI E_Border *e_border_find_by_window(Ecore_X_Window win); EAPI E_Border *e_border_find_by_alarm(Ecore_X_Sync_Alarm alarm); EAPI E_Border *e_border_focused_get(void); @@ -844,5 +842,12 @@ extern EAPI int E_EVENT_BORDER_PROPERTY; extern EAPI int E_EVENT_BORDER_FULLSCREEN; extern EAPI int E_EVENT_BORDER_UNFULLSCREEN; +/* macro for finding misuse of changed flag */ +#if 0 +# define BD_CHANGED(BD) BD->changed = 1; INF("%s:%d - BD CHANGED: %p", __FILE__, __LINE__, BD) +#else +# define BD_CHANGED(BD) BD->changed = 1 +#endif + #endif #endif diff --git a/src/bin/e_comp.c b/src/bin/e_comp.c index e2b9ce07b1..ca72ab71ea 100644 --- a/src/bin/e_comp.c +++ b/src/bin/e_comp.c @@ -81,6 +81,7 @@ static int _e_comp_log_dom = -1; #define CRI(f, x ...) #endif +static Eina_Bool _e_comp_win_do_shadow(E_Comp_Win *cw); static void _e_comp_win_ready_timeout_setup(E_Comp_Win *cw); static void _e_comp_render_queue(E_Comp *c); static void _e_comp_win_damage(E_Comp_Win *cw, int x, int y, int w, int h, Eina_Bool dmg); @@ -201,9 +202,10 @@ _e_comp_fullscreen_check(E_Comp *c) { if ((!cw->visible) || (cw->input_only) || (cw->invalid) || (cw->real_obj)) continue; + if (!cw->bd) continue; if ((cw->x == 0) && (cw->y == 0) && - ((cw->x + cw->w) >= c->man->w) && - ((cw->y + cw->h) >= c->man->h) && + ((cw->bd->client.w) >= c->man->w) && + ((cw->bd->client.h) >= c->man->h) && (!cw->argb) && (!cw->shaped) && (!cw->bg_win) ) { @@ -455,10 +457,11 @@ _e_comp_win_restack(E_Comp_Win *cw) } EINA_LIST_FOREACH(cw->stack_below, l, cwp) { - e_layout_child_lower_below(cwp->shobj, cw->shobj); + e_layout_child_lower_below(cwp->effect_obj, cw->effect_obj); cw->c->wins = eina_inlist_remove(cw->c->wins, EINA_INLIST_GET(cwp)); - cw->c->wins = eina_inlist_prepend_relative(cw->c->wins, EINA_INLIST_GET(cwp), EINA_INLIST_GET(cw)); + cw->c->wins = eina_inlist_prepend_relative(cw->c->wins, EINA_INLIST_GET(cwp), EINA_INLIST_GET(cw)); } + _e_comp_shapes_update(cw->c, NULL, E_CONTAINER_SHAPE_MOVE); } static void @@ -466,12 +469,16 @@ _e_comp_win_geometry_update(E_Comp_Win *cw) { int x, y, w, h; - if (cw->visible) + if (cw->bd) + x = cw->bd->x, y = cw->bd->y; + else if (cw->visible) x = cw->x, y = cw->y; else x = cw->hidden.x, y = cw->hidden.y; if (cw->real_obj) w = cw->w, h = cw->h; + else if (cw->bd) + w = cw->bd->w, h = cw->bd->h; else w = cw->pw, h = cw->ph; if (cw->not_in_layout) @@ -865,10 +872,10 @@ _e_comp_win_update(E_Comp_Win *cw) { if (pshaped != cw->shaped) { - if (cw->shaped) - edje_object_signal_emit(cw->shobj, "e,state,shadow,off", "e"); - else + if (_e_comp_win_do_shadow(cw)) edje_object_signal_emit(cw->shobj, "e,state,shadow,on", "e"); + else + edje_object_signal_emit(cw->shobj, "e,state,shadow,off", "e"); } } @@ -1006,6 +1013,7 @@ _e_comp_win_adopt(E_Comp_Win *cw) cw->c->updates = eina_list_append(cw->c->updates, cw); } cw->redirected = 1; + if (cw->bd) e_comp_win_reshadow(cw); e_comp_render_update_resize(cw->up, cw->pw, cw->ph); e_comp_render_update_add(cw->up, 0, 0, cw->pw, cw->ph); _e_comp_win_damage(cw, 0, 0, cw->w, cw->h, 0); @@ -1442,6 +1450,7 @@ static Eina_Bool _e_comp_win_do_shadow(E_Comp_Win *cw) { if (cw->shaped) return 0; + if (cw->bd && cw->bd->theme_shadow) return 0; if (cw->real_obj) { return ((!!cw->pop) || (!!cw->menu)); @@ -1812,17 +1821,16 @@ _e_comp_win_shadow_setup(E_Comp_Win *cw) } break; } - if (reshadow) return; - edje_object_part_swallow(cw->shobj, "e.swallow.content", cw->obj); - if (cw->bd && cw->bd->client.e.state.video) - edje_object_signal_emit(cw->shobj, "e,state,shadow,off", "e"); - else + if (reshadow) { - if (_e_comp_win_do_shadow(cw) && (!no_shadow)) - edje_object_signal_emit(cw->shobj, "e,state,shadow,on", "e"); - else - edje_object_signal_emit(cw->shobj, "e,state,shadow,off", "e"); + if (!cw->bd) return; + if (cw->bd->bg_object && (edje_object_part_swallow_get(cw->shobj, "e.swallow.content") == cw->bd->bg_object)) + return; } + if (_e_comp_win_do_shadow(cw) && (!no_shadow)) + edje_object_signal_emit(cw->shobj, "e,state,shadow,on", "e"); + else + edje_object_signal_emit(cw->shobj, "e,state,shadow,off", "e"); if (cw->bd) { @@ -1835,13 +1843,24 @@ _e_comp_win_shadow_setup(E_Comp_Win *cw) else edje_object_signal_emit(cw->shobj, "e,state,urgent,off", "e"); } - if (!cw->visible) + if (cw->visible) + edje_object_signal_emit(cw->shobj, "e,state,visible,on", "e"); + else + edje_object_signal_emit(cw->shobj, "e,state,visible,off", "e"); + + if (cw->bd && cw->bd->bg_object) { - edje_object_signal_emit(cw->shobj, "e,state,visible,off", "e"); - return; + edje_object_part_swallow(cw->bd->bg_object, "e.swallow.client", cw->obj); + edje_object_part_swallow(cw->shobj, "e.swallow.content", cw->bd->bg_object); + no_shadow = 1; + } + else + { + edje_object_part_swallow(cw->shobj, "e.swallow.content", cw->obj); + if (cw->bd) no_shadow = 1; } - edje_object_signal_emit(cw->shobj, "e,state,visible,on", "e"); + if (!cw->visible) return; if (!cw->animating) { @@ -2014,11 +2033,31 @@ _e_comp_win_dummy_add(E_Comp *c, Evas_Object *obj, E_Object *eobj, Eina_Bool nol return cw; } +static void +_e_comp_win_bd_setup(E_Comp_Win *cw, E_Border *bd) +{ + cw->bd = bd; + eina_hash_add(borders, e_util_winid_str_get(cw->bd->client.win), cw); + cw->dfn = e_object_delfn_add(E_OBJECT(cw->bd), _e_comp_object_del, cw); + cw->shape = cw->bd->shape; + cw->bd->cw = cw; + cw->opacity = cw->bd->client.netwm.opacity; + cw->eobj = E_OBJECT(cw->bd); + e_object_ref(cw->eobj); + // setup on show + // _e_comp_win_sync_setup(cw, cw->bd->client.win); + cw->input_only = cw->bd->client.initial_attributes.input_only; + cw->override = cw->bd->client.initial_attributes.override; + cw->vis = cw->bd->client.initial_attributes.visual; + cw->cmap = cw->bd->client.initial_attributes.colormap; + cw->depth = cw->bd->client.initial_attributes.depth; +} + static E_Comp_Win * -_e_comp_win_add(E_Comp *c, Ecore_X_Window win) +_e_comp_win_add(E_Comp *c, Ecore_X_Window win, E_Border *bd) { - Ecore_X_Window_Attributes att; E_Comp_Win *cw; + int w, h; cw = calloc(1, sizeof(E_Comp_Win)); if (!cw) return NULL; @@ -2026,42 +2065,42 @@ _e_comp_win_add(E_Comp *c, Ecore_X_Window win) cw->c = c; cw->real_hid = 1; cw->opacity = 255.0; - cw->bd = e_border_find_by_window(cw->win); if (conf->grab) ecore_x_grab(); - if (cw->bd) + if (bd) { - eina_hash_add(borders, e_util_winid_str_get(cw->bd->client.win), cw); - cw->dfn = e_object_delfn_add(E_OBJECT(cw->bd), _e_comp_object_del, cw); - cw->shape = cw->bd->shape; - cw->bd->cw = cw; - cw->opacity = cw->bd->client.netwm.opacity; - // setup on show - // _e_comp_win_sync_setup(cw, cw->bd->client.win); + _e_comp_win_bd_setup(cw, bd); + w = cw->bd->client.w, h = cw->bd->client.h; } - /* popups handled in _dummy_add */ - /* menus handled in _dummy_add */ - // fixme: could use bd/pop/menu for this too - memset((&att), 0, sizeof(Ecore_X_Window_Attributes)); - if (!ecore_x_window_attributes_get(cw->win, &att)) - { - free(cw->name); - free(cw->clas); - free(cw->role); - free(cw); - if (conf->grab) ecore_x_ungrab(); - return NULL; - } - if ((!att.input_only) && - ((att.depth != 24) && (att.depth != 32))) + else { - // printf("WARNING: window 0x%x not 24/32bpp -> %ibpp", cw->win, att.depth); - // cw->invalid = 1; + Ecore_X_Window_Attributes att; + + memset((&att), 0, sizeof(Ecore_X_Window_Attributes)); + if (!ecore_x_window_attributes_get(cw->win, &att)) + { + free(cw->name); + free(cw->clas); + free(cw->role); + free(cw); + if (conf->grab) ecore_x_ungrab(); + return NULL; + } + if ((!att.input_only) && + ((att.depth != 24) && (att.depth != 32))) + { + // printf("WARNING: window 0x%x not 24/32bpp -> %ibpp", cw->win, att.depth); + // cw->invalid = 1; + } + cw->input_only = att.input_only; + cw->override = att.override; + cw->vis = att.visual; + cw->cmap = att.colormap; + cw->depth = att.depth; + w = att.w, h = att.h; + + if (cw->override && !(att.event_mask.mine & ECORE_X_EVENT_MASK_WINDOW_PROPERTY)) + ecore_x_event_mask_set(cw->win, ECORE_X_EVENT_MASK_WINDOW_PROPERTY); } - cw->input_only = att.input_only; - cw->override = att.override; - cw->vis = att.visual; - cw->cmap = att.colormap; - cw->depth = att.depth; if ((!cw->bd) && (!cw->menu) && (!cw->input_only)) { char *netwm_title = NULL; @@ -2093,7 +2132,10 @@ _e_comp_win_add(E_Comp *c, Ecore_X_Window win) // cw->show_ready = 1; } - cw->argb = ecore_x_window_argb_get(cw->win); + if (cw->bd) + cw->argb = cw->bd->client.argb; + else + cw->argb = ecore_x_window_argb_get(cw->win); eina_hash_add(windows, e_util_winid_str_get(cw->win), cw); cw->inhash = 1; if ((!cw->input_only) && (!cw->invalid)) @@ -2110,9 +2152,6 @@ _e_comp_win_add(E_Comp *c, Ecore_X_Window win) if (cw->argb) evas_object_image_alpha_set(cw->obj, 1); else evas_object_image_alpha_set(cw->obj, 0); - if (cw->override && !(att.event_mask.mine & ECORE_X_EVENT_MASK_WINDOW_PROPERTY)) - ecore_x_event_mask_set(cw->win, ECORE_X_EVENT_MASK_WINDOW_PROPERTY); - _e_comp_win_shadow_setup(cw); edje_object_signal_callback_add(cw->shobj, "e,action,show,done", "e", _e_comp_show_done, cw); @@ -2129,9 +2168,9 @@ _e_comp_win_add(E_Comp *c, Ecore_X_Window win) for (i = 0; i < num; i++) E_RECTS_CLIP_TO_RECT(rects[i].x, rects[i].y, - rects[i].width, rects[i].height, 0, 0, (int)att.w, (int)att.h); + rects[i].width, rects[i].height, 0, 0, w, h); - if (_e_comp_shaped_check(att.w, att.h, rects, num)) + if (_e_comp_shaped_check(w, h, rects, num)) cw->shape_changed = 1; free(rects); @@ -2155,7 +2194,6 @@ _e_comp_win_add(E_Comp *c, Ecore_X_Window win) else evas_object_name_set(cw->shobj, "cw->shobj::WINDOW"); - evas_object_pass_events_set(cw->obj, 1); evas_object_name_set(cw->obj, "cw->obj"); cw->pending_count++; @@ -2168,7 +2206,6 @@ _e_comp_win_add(E_Comp *c, Ecore_X_Window win) evas_object_color_set(cw->shobj, 0, 0, 0, 0); } - evas_object_pass_events_set(cw->shobj, 1); evas_object_data_set(cw->shobj, "win", (void *)((unsigned long)cw->win)); evas_object_data_set(cw->shobj, "comp_win", cw); @@ -2197,7 +2234,7 @@ _e_comp_win_del(E_Comp_Win *cw) { Evas_Object *o; - if (cw->real_obj && cw->eobj) + if (cw->eobj) { e_object_unref(E_OBJECT(cw->eobj)); cw->eobj = NULL; @@ -2740,7 +2777,7 @@ _e_comp_win_configure(E_Comp_Win *cw, int x, int y, int w, int h, int border) /* need to block move/resize of the edje for real objects so the external object doesn't * accidentally get shown and block our show callback */ - if ((moved || resized) && ((!cw->real_obj) || cw->visible)) _e_comp_win_geometry_update(cw); + if ((cw->real_obj && cw->visible) || moved || resized) _e_comp_win_geometry_update(cw); // add pending manager comp event count to match below config send cw->pending_count++; _e_comp_event_source_configure(cw); @@ -2810,17 +2847,18 @@ _e_comp_create(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) { Ecore_X_Event_Window_Create *ev = event; E_Comp_Win *cw; - E_Comp *c = _e_comp_find(ev->parent); + E_Comp *c; + + c = _e_comp_find(ev->parent); if (!c) return ECORE_CALLBACK_PASS_ON; if (_e_comp_win_find(ev->win)) return ECORE_CALLBACK_PASS_ON; if (c->win == ev->win) return ECORE_CALLBACK_PASS_ON; if (c->ee_win == ev->win) return ECORE_CALLBACK_PASS_ON; if (c->man->root == ev->win) return ECORE_CALLBACK_PASS_ON; if (_e_comp_ignore_find(ev->win)) return ECORE_CALLBACK_PASS_ON; - cw = _e_comp_win_add(c, ev->win); + cw = _e_comp_win_add(c, ev->win, NULL); if (!cw) return ECORE_CALLBACK_RENEW; _e_comp_win_configure(cw, ev->x, ev->y, ev->w, ev->h, ev->border); - if (cw->free_shape) { Eina_List *l; @@ -3282,9 +3320,70 @@ static Eina_Bool _e_comp_bd_add(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) { E_Event_Border_Add *ev = event; - E_Comp_Win *cw = _e_comp_win_find(ev->border->win); - if (!cw) return ECORE_CALLBACK_PASS_ON; - // fimxe: add/enable compositing here not in show event for borders + E_Comp_Win *cw; + E_Container *con; + int x; + + cw = ev->border->cw; + if (!cw) + { + cw = _e_comp_win_find(ev->border->win); + if (cw) + { + _e_comp_win_bd_setup(cw, ev->border); + evas_object_data_set(cw->shobj, "border", cw->bd); + evas_object_data_set(cw->effect_obj, "border", cw->bd); + evas_object_name_set(cw->shobj, "cw->shobj::BORDER"); + evas_object_name_set(cw->effect_obj, "cw->effect_obj::BORDER"); + e_comp_win_reshadow(cw); + } + else + cw = _e_comp_win_add(e_comp_get(ev->border), ev->border->win, ev->border); + } + _e_comp_win_configure(cw, ev->border->x, ev->border->y, + ev->border->w, ev->border->h, + ev->border->client.initial_attributes.border); + if (cw->shape) cw->shape->comp_win = cw; + con = cw->bd->zone->container; + /* we previously ignored potential stacking requests before the border setup, + * so we have to manually stack it here */ + for (x = 0; x < E_CONTAINER_LAYER_COUNT; x++) + { + Eina_List *l; + E_Border *bd; + E_Comp_Win *cw2; + + if (!con->layers[x].clients) continue; + l = eina_list_data_find_list(con->layers[x].clients, cw->bd); + if (!l) continue; + if (l->prev) + { + bd = eina_list_data_get(l->prev); + cw2 = _e_comp_win_find(bd->win); + if (cw2) + { + _e_comp_win_raise_above(cw, cw2); + break; + } + } + if (l->next) + { + bd = eina_list_data_get(l->next); + cw2 = _e_comp_win_find(bd->win); + if (cw2) + { + _e_comp_win_lower_below(cw, cw2); + break; + } + } + cw2 = _e_comp_win_find(con->layers[x].win); + if (cw2) _e_comp_win_raise_above(cw, cw2); + break; + } + //if (cw->bd->visible) + //{ + //_e_comp_win_show(cw); + //} return ECORE_CALLBACK_PASS_ON; } @@ -3293,8 +3392,7 @@ _e_comp_bd_del(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) { E_Event_Border_Remove *ev = event; E_Comp_Win *cw = _e_comp_win_find(ev->border->win); - if (!cw) return ECORE_CALLBACK_PASS_ON; - if (cw->bd == ev->border) _e_comp_object_del(cw, ev->border); + if (cw) e_comp_win_del(cw); return ECORE_CALLBACK_PASS_ON; } @@ -3303,9 +3401,7 @@ _e_comp_bd_show(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) { E_Event_Border_Show *ev = event; E_Comp_Win *cw = _e_comp_win_find(ev->border->win); - if (!cw) return ECORE_CALLBACK_PASS_ON; - if (cw->visible) return ECORE_CALLBACK_PASS_ON; - _e_comp_win_show(cw); + if (cw) _e_comp_win_show(cw); return ECORE_CALLBACK_PASS_ON; } @@ -3313,10 +3409,9 @@ static Eina_Bool _e_comp_bd_hide(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) { E_Event_Border_Hide *ev = event; + if (ev->manage == 2) return ECORE_CALLBACK_RENEW; //desk hide E_Comp_Win *cw = _e_comp_win_find(ev->border->win); - if (!cw) return ECORE_CALLBACK_PASS_ON; - if (!cw->visible) return ECORE_CALLBACK_PASS_ON; - _e_comp_win_hide(cw); + if (cw) _e_comp_win_hide(cw); return ECORE_CALLBACK_PASS_ON; } @@ -3403,39 +3498,15 @@ _e_comp_bd_property(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) return ECORE_CALLBACK_PASS_ON; } -static void -_e_comp_reshadow(E_Comp_Win *cw) -{ - if (cw->visible) evas_object_hide(cw->shobj); - _e_comp_win_shadow_setup(cw); - // evas_object_move(cw->shobj, cw->x, cw->y); - // evas_object_resize(cw->shobj, cw->pw, cw->ph); - _e_comp_win_geometry_update(cw); - if (cw->visible) - { - evas_object_show(cw->shobj); - if (cw->show_ready) - { - cw->defer_hide = 0; - if (!cw->hidden_override) _e_comp_child_show(cw); - edje_object_signal_emit(cw->shobj, "e,state,visible,on", "e"); - if (!cw->animating) - { - cw->c->animating++; - } - cw->animating = 1; - _e_comp_win_render_queue(cw); - } - } -} - static Eina_Bool _e_comp_bd_fullscreen(void *data EINA_UNUSED, int type EINA_UNUSED, void *event) { E_Event_Border_Property *ev = event; E_Comp_Win *cw = _e_comp_win_find(ev->border->win); if (!cw) return ECORE_CALLBACK_PASS_ON; - _e_comp_reshadow(cw); + e_comp_win_reshadow(cw); + /* bd->bg_object deletion pending */ + edje_object_part_swallow(cw->shobj, "e.swallow.content", cw->obj); return ECORE_CALLBACK_PASS_ON; } @@ -3445,7 +3516,7 @@ _e_comp_bd_unfullscreen(void *data EINA_UNUSED, int type EINA_UNUSED, void *even E_Event_Border_Property *ev = event; E_Comp_Win *cw = _e_comp_win_find(ev->border->win); if (!cw) return ECORE_CALLBACK_PASS_ON; - _e_comp_reshadow(cw); + e_comp_win_reshadow(cw); return ECORE_CALLBACK_PASS_ON; } @@ -3610,7 +3681,7 @@ _e_comp_shapes_update_comp_win_shape_comp_helper(E_Comp_Win *cw, Eina_Tiler *tb) * propagated to the comp_win :/ */ if (cw->bd) - x = cw->bd->x, y = cw->bd->y, w = cw->bd->w, h = cw->bd->h; + x = cw->bd->x + cw->bd->client_inset.l, y = cw->bd->y + cw->bd->client_inset.t, w = cw->bd->client.w, h = cw->bd->client.h; else if (cw->pop) x = cw->pop->x + cw->pop->zone->x, y = cw->pop->y + cw->pop->zone->y, w = cw->pop->w, h = cw->pop->h; //else if (cw->menu) @@ -3634,8 +3705,24 @@ _e_comp_shapes_update_comp_win_shape_comp_helper(E_Comp_Win *cw, Eina_Tiler *tb) } else { - eina_tiler_rect_del(tb, &(Eina_Rectangle){x, y, w, h}); - SHAPE_INF("DEL: %d,%d@%dx%d", x, y, w, h); + if (cw->bd) + { + /* add the frame */ + eina_tiler_rect_add(tb, &(Eina_Rectangle){cw->bd->x, cw->bd->y, cw->bd->w, cw->bd->h}); + SHAPE_INF("ADD: %d,%d@%dx%d", cw->bd->x, cw->bd->y, cw->bd->w, cw->bd->h); + + if (!cw->bd->shaded) + { + /* delete the client if not shaded */ + eina_tiler_rect_del(tb, &(Eina_Rectangle){x, y, w, h}); + SHAPE_INF("DEL: %d,%d@%dx%d", x, y, w, h); + } + } + else + { + eina_tiler_rect_del(tb, &(Eina_Rectangle){x, y, w, h}); + SHAPE_INF("DEL: %d,%d@%dx%d", x, y, w, h); + } } } @@ -3780,8 +3867,8 @@ _e_comp_shapes_update(void *data, E_Container_Shape *es, E_Container_Shape_Chang */ if (!es->visible) return; } + SHAPE_INF("RESHAPE %u: %s", es->comp_win->win, change_text[change]); } - SHAPE_INF("RESHAPE %u: %s", es->comp_win->win, change_text[change]); if (!c->shape_job) c->shape_job = ecore_job_add((Ecore_Cb)_e_comp_shapes_update_job, c); } @@ -3881,7 +3968,10 @@ _e_comp_populate(E_Comp *c) free(wname); free(wclass); wname = wclass = NULL; - cw = _e_comp_win_add(c, wins[i]); + if (e_comp_win_find(wins[i]) || + e_comp_win_find_client_win(wins[i]) || + e_border_find_by_client_window(wins[i])) continue; + cw = _e_comp_win_add(c, wins[i], NULL); if (!cw) continue; ecore_x_window_geometry_get(cw->win, &x, &y, &w, &h); border = ecore_x_window_border_width_get(cw->win); @@ -3903,7 +3993,7 @@ _e_comp_populate(E_Comp *c) e_container_shape_move(cw->shape, x, y); e_container_shape_resize(cw->shape, w, h); } - if (ecore_x_window_visible_get(wins[i])) + if ((!cw->bd) && (ecore_x_window_visible_get(wins[i]))) _e_comp_win_show(cw); } free(wins); @@ -4038,6 +4128,7 @@ _e_comp_add(E_Manager *man) ecore_evas_show(c->ee); c->ee_win = ecore_evas_window_get(c->ee); + c->pointer = e_pointer_window_new(c->ee_win, 0); ecore_x_composite_redirect_subwindows (c->man->root, ECORE_X_COMPOSITE_UPDATE_MANUAL); @@ -4059,8 +4150,7 @@ _e_comp_del(E_Comp *c) { E_Comp_Win *cw; E_Comp_Zone *cz; - Eina_List *l, *hide_bd = NULL; - E_Border *bd; + Eina_List *l; E_Container *con; c->man->comp = NULL; @@ -4068,15 +4158,11 @@ _e_comp_del(E_Comp *c) edje_freeze(); EINA_LIST_FOREACH(c->man->containers, l, con) e_container_shape_change_callback_del(con, _e_comp_shapes_update, c); - EINA_LIST_FOREACH(e_border_client_list(), l, bd) - { - if (!bd->visible) - hide_bd = eina_list_append(hide_bd, bd); - } E_FREE_FUNC(c->fps_fg, evas_object_del); E_FREE_FUNC(c->fps_bg, evas_object_del); E_FREE_FUNC(c->shape_job, ecore_job_del); + E_FREE_FUNC(c->pointer, e_object_del); ecore_x_window_key_ungrab(c->man->root, "F", ECORE_EVENT_MODIFIER_SHIFT | ECORE_EVENT_MODIFIER_CTRL | @@ -4137,12 +4223,6 @@ _e_comp_del(E_Comp *c) ecore_x_e_comp_sync_supported_set(c->man->root, 0); ecore_x_screen_is_composited_set(c->man->num, 0); - EINA_LIST_FREE(hide_bd, bd) - { - e_border_show(bd); - e_border_hide(bd, 1); - } - free(c); } @@ -4880,6 +4960,32 @@ e_comp_win_hidden_set(E_Comp_Win *cw, Eina_Bool hidden) } } +EAPI void +e_comp_win_reshadow(E_Comp_Win *cw) +{ + if (cw->visible) evas_object_hide(cw->effect_obj); + _e_comp_win_shadow_setup(cw); + // evas_object_move(cw->effect_obj, cw->x, cw->y); + // evas_object_resize(cw->effect_obj, cw->pw, cw->ph); + _e_comp_win_geometry_update(cw); + if (cw->visible) + { + evas_object_show(cw->effect_obj); + if (cw->show_ready) + { + cw->defer_hide = 0; + if (!cw->hidden_override) _e_comp_child_show(cw); + edje_object_signal_emit(cw->shobj, "e,state,visible,on", "e"); + if (!cw->animating) + { + cw->c->animating++; + } + cw->animating = 1; + _e_comp_win_render_queue(cw); + } + } +} + EAPI E_Comp * e_comp_get(void *o) { @@ -5168,7 +5274,7 @@ e_comp_win_show(E_Comp_Win *cw) _e_comp_win_show(cw); } -EAPI void +EAPI E_Comp_Win * e_comp_canvas_layer_set(Evas_Object *obj, E_Comp_Canvas_Layer comp_layer, E_Layer layer, E_Comp_Canvas_Stack stack) { E_Comp_Win *cw; @@ -5188,6 +5294,7 @@ e_comp_canvas_layer_set(Evas_Object *obj, E_Comp_Canvas_Layer comp_layer, E_Laye _e_comp_win_raise(cw); else if (stack == E_COMP_CANVAS_STACK_UNDER) _e_comp_win_lower(cw); + return cw; } EAPI void @@ -5195,10 +5302,11 @@ e_comp_util_wins_print(const E_Comp *c) { E_Comp_Win *cw; + if (!c) c = e_comp_get(NULL); EINA_INLIST_FOREACH(c->wins, cw) { if (cw->bd) - fprintf(stderr, "COMP BD: %p - %s\n", cw, cw->bd->client.icccm.name); + fprintf(stderr, "COMP BD: %p - %u '%s:%s'\n", cw, cw->win, cw->bd->client.icccm.name, cw->bd->client.icccm.class); else if (cw->pop) fprintf(stderr, "COMP POP: %p - %s\n", cw, cw->pop->name); else if (cw->menu) @@ -5297,7 +5405,6 @@ e_comp_block_window_del(void) } } - EAPI unsigned int e_comp_e_object_layer_get(const E_Object *obj) { diff --git a/src/bin/e_comp.h b/src/bin/e_comp.h index 808b9157f5..b3d56b377e 100644 --- a/src/bin/e_comp.h +++ b/src/bin/e_comp.h @@ -56,6 +56,7 @@ struct _E_Comp Evas_Object *layout; Eina_List *zones; E_Manager *man; + E_Pointer *pointer; Eina_List *debug_rects; Eina_List *ignore_wins; @@ -248,6 +249,7 @@ EAPI void e_comp_win_moveresize(E_Comp_Win *cw, Evas_Coord x, Evas_Coord y, int EAPI void e_comp_win_hide(E_Comp_Win *cw); EAPI void e_comp_win_show(E_Comp_Win *cw); EAPI void e_comp_win_del(E_Comp_Win *cw); +EAPI void e_comp_win_reshadow(E_Comp_Win *cw); EAPI void e_comp_ignore_win_add(Ecore_X_Window win); @@ -258,7 +260,7 @@ EAPI void e_comp_ignore_win_add(Ecore_X_Window win); #define E_LAYER_LAYOUT_ADD_UNDER(obj, layer) e_comp_canvas_layer_set(obj, E_COMP_CANVAS_LAYER_LAYOUT, layer, E_COMP_CANVAS_STACK_UNDER) #define E_LAYER_LAYOUT_ADD_ABOVE(obj, layer) e_comp_canvas_layer_set(obj, E_COMP_CANVAS_LAYER_LAYOUT, layer, E_COMP_CANVAS_STACK_ABOVE) -EAPI void e_comp_canvas_layer_set(Evas_Object *obj, E_Comp_Canvas_Layer comp_layer, E_Layer layer, E_Comp_Canvas_Stack stack); +EAPI E_Comp_Win *e_comp_canvas_layer_set(Evas_Object *obj, E_Comp_Canvas_Layer comp_layer, E_Layer layer, E_Comp_Canvas_Stack stack); EAPI unsigned int e_comp_e_object_layer_get(const E_Object *obj); static inline E_Comp * diff --git a/src/bin/e_container.c b/src/bin/e_container.c index e676efa13b..724d2da6e8 100644 --- a/src/bin/e_container.c +++ b/src/bin/e_container.c @@ -907,7 +907,7 @@ _e_container_cb_mouse_in(E_Container *con EINA_UNUSED, Evas *e EINA_UNUSED, Evas E_Border *bd; bd = e_border_focused_get(); - if (bd) e_focus_event_mouse_out(bd); + if (bd && (!bd->border_menu)) e_focus_event_mouse_out(bd); } static void diff --git a/src/bin/e_container.h b/src/bin/e_container.h index a2ae088653..4b9c2724a0 100644 --- a/src/bin/e_container.h +++ b/src/bin/e_container.h @@ -26,6 +26,8 @@ typedef void (*E_Container_Shape_Cb)(void *data, E_Container_Shape *es, E_Contai #define E_CONTAINER_TYPE (int) 0xE0b01003 #define E_CONTAINER_SHAPE_TYPE (int) 0xE0b01004 +#define E_CONTAINER_LAYER_COUNT 12 + struct _E_Container { E_Object e_obj_inherit; @@ -52,7 +54,7 @@ struct _E_Container struct { Ecore_X_Window win; Eina_List *clients; /* E_Border */ - } layers[12]; + } layers[E_CONTAINER_LAYER_COUNT]; Ecore_X_Window scratch_win; }; diff --git a/src/bin/e_desklock.c b/src/bin/e_desklock.c index 87e4e2ecea..bc77c7976b 100644 --- a/src/bin/e_desklock.c +++ b/src/bin/e_desklock.c @@ -472,9 +472,9 @@ _e_desklock_popup_add(E_Zone *zone) evas_object_move(edp->bg_object, zone->x, zone->y); evas_object_resize(edp->bg_object, zone->w, zone->h); + evas_object_show(edp->bg_object); E_LAYER_SET_ABOVE(edp->bg_object, E_COMP_CANVAS_LAYER_DESKLOCK); evas_object_clip_set(edp->bg_object, edp->zone->bg_clip_object); - evas_object_show(edp->bg_object); _e_desklock_login_box_add(edp); evas_event_thaw(evas); @@ -521,11 +521,11 @@ _e_desklock_login_box_add(E_Desklock_Popup_Data *edp) evas_object_move(edp->login_box, zone->x + ((zone->w - mw) / 2), zone->y + ((zone->h - mh) / 2)); + evas_object_show(edp->login_box); E_LAYER_SET_ABOVE(edp->login_box, E_COMP_CANVAS_LAYER_DESKLOCK); } evas_object_clip_set(edp->login_box, edp->zone->bg_clip_object); - evas_object_show(edp->login_box); } static void diff --git a/src/bin/e_dnd.c b/src/bin/e_dnd.c index 42e780d4b7..99c3826645 100644 --- a/src/bin/e_dnd.c +++ b/src/bin/e_dnd.c @@ -664,9 +664,6 @@ _e_drag_win_get(const E_Drop_Handler *h, int xdnd) break; case E_BORDER_TYPE: - hwin = ((E_Border *)(h->obj))->event_win; - break; - case E_ZONE_TYPE: case E_POPUP_TYPE: hwin = e_comp_get(h->obj)->ee_win; diff --git a/src/bin/e_manager.c b/src/bin/e_manager.c index 64eec95bdc..4fdba46f5a 100644 --- a/src/bin/e_manager.c +++ b/src/bin/e_manager.c @@ -566,13 +566,23 @@ _e_manager_cb_window_configure(void *data, int ev_type __UNUSED__, void *ev) static Eina_Bool _e_manager_cb_key_down(void *data, int ev_type __UNUSED__, void *ev) { - E_Manager *man; - Ecore_Event_Key *e; - - man = data; - e = ev; + E_Manager *man = data; + Ecore_Event_Key *e = ev; - if (e->event_window != man->root) return ECORE_CALLBACK_PASS_ON; + if (e->event_window != man->root) + { + E_Border *bd; + + bd = e_border_focused_get(); + /* *block actions when no border is focused (probably something else did a grab here so we'll play nice) + * *block actions when border menu is up + * *block actions when event (grab) window isn't comp window + * *other cases? + */ + if (!bd) return ECORE_CALLBACK_RENEW; + if ((bd->border_menu) || (e->event_window != e_comp_get(bd)->ee_win)) + return ECORE_CALLBACK_PASS_ON; + } if (e->root_window != man->root) man = _e_manager_get_for_root(e->root_window); if (e_bindings_key_down_event_handle(E_BINDING_CONTEXT_MANAGER, E_OBJECT(man), ev)) return ECORE_CALLBACK_DONE; diff --git a/src/bin/e_pointer.c b/src/bin/e_pointer.c index e02a246ee1..d101c6426f 100644 --- a/src/bin/e_pointer.c +++ b/src/bin/e_pointer.c @@ -241,6 +241,97 @@ e_pointer_idler_before(void) } } + +EAPI void +e_pointer_mode_push(void *obj, E_Pointer_Mode mode) +{ + switch (mode) + { + case E_POINTER_RESIZE_TL: + e_pointer_type_push(e_comp_get(obj)->pointer, obj, "resize_tl"); + break; + + case E_POINTER_RESIZE_T: + e_pointer_type_push(e_comp_get(obj)->pointer, obj, "resize_t"); + break; + + case E_POINTER_RESIZE_TR: + e_pointer_type_push(e_comp_get(obj)->pointer, obj, "resize_tr"); + break; + + case E_POINTER_RESIZE_R: + e_pointer_type_push(e_comp_get(obj)->pointer, obj, "resize_r"); + break; + + case E_POINTER_RESIZE_BR: + e_pointer_type_push(e_comp_get(obj)->pointer, obj, "resize_br"); + break; + + case E_POINTER_RESIZE_B: + e_pointer_type_push(e_comp_get(obj)->pointer, obj, "resize_b"); + break; + + case E_POINTER_RESIZE_BL: + e_pointer_type_push(e_comp_get(obj)->pointer, obj, "resize_bl"); + break; + + case E_POINTER_RESIZE_L: + e_pointer_type_push(e_comp_get(obj)->pointer, obj, "resize_l"); + break; + + case E_POINTER_MOVE: + e_pointer_type_push(e_comp_get(obj)->pointer, obj, "move"); + break; + + default: break; + } +} + +EAPI void +e_pointer_mode_pop(void *obj, E_Pointer_Mode mode) +{ + switch (mode) + { + case E_POINTER_RESIZE_TL: + e_pointer_type_pop(e_comp_get(obj)->pointer, obj, "resize_tl"); + break; + + case E_POINTER_RESIZE_T: + e_pointer_type_pop(e_comp_get(obj)->pointer, obj, "resize_t"); + break; + + case E_POINTER_RESIZE_TR: + e_pointer_type_pop(e_comp_get(obj)->pointer, obj, "resize_tr"); + break; + + case E_POINTER_RESIZE_R: + e_pointer_type_pop(e_comp_get(obj)->pointer, obj, "resize_r"); + break; + + case E_POINTER_RESIZE_BR: + e_pointer_type_pop(e_comp_get(obj)->pointer, obj, "resize_br"); + break; + + case E_POINTER_RESIZE_B: + e_pointer_type_pop(e_comp_get(obj)->pointer, obj, "resize_b"); + break; + + case E_POINTER_RESIZE_BL: + e_pointer_type_pop(e_comp_get(obj)->pointer, obj, "resize_bl"); + break; + + case E_POINTER_RESIZE_L: + e_pointer_type_pop(e_comp_get(obj)->pointer, obj, "resize_l"); + break; + + case E_POINTER_MOVE: + e_pointer_type_pop(e_comp_get(obj)->pointer, obj, "move"); + break; + + default: break; + } +} + /* local subsystem functions */ static void _e_pointer_canvas_add(E_Pointer *p) diff --git a/src/bin/e_pointer.h b/src/bin/e_pointer.h index c1fa50dc0d..f96f6ba78a 100644 --- a/src/bin/e_pointer.h +++ b/src/bin/e_pointer.h @@ -2,6 +2,22 @@ typedef struct _E_Pointer E_Pointer; + +typedef enum +{ + /* These are compatible with netwm */ + E_POINTER_RESIZE_TL = 0, + E_POINTER_RESIZE_T = 1, + E_POINTER_RESIZE_TR = 2, + E_POINTER_RESIZE_R = 3, + E_POINTER_RESIZE_BR = 4, + E_POINTER_RESIZE_B = 5, + E_POINTER_RESIZE_BL = 6, + E_POINTER_RESIZE_L = 7, + E_POINTER_MOVE = 8, + E_POINTER_RESIZE_NONE = 11 +} E_Pointer_Mode; + #else #ifndef E_POINTER_H #define E_POINTER_H @@ -45,5 +61,8 @@ EAPI void e_pointer_type_pop(E_Pointer *p, void *obj, const char *type); EAPI void e_pointers_size_set(int size); EAPI void e_pointer_idler_before(void); +EAPI void e_pointer_mode_push(void *obj, E_Pointer_Mode mode); +EAPI void e_pointer_mode_pop(void *obj, E_Pointer_Mode mode); + #endif #endif diff --git a/src/bin/e_shelf.c b/src/bin/e_shelf.c index 0504596a28..ced6fcc01d 100644 --- a/src/bin/e_shelf.c +++ b/src/bin/e_shelf.c @@ -244,6 +244,7 @@ e_shelf_zone_new(E_Zone *zone, const char *name, const char *style, int popup, E else { evas_object_move(es->o_base, es->zone->x + es->x, es->zone->y + es->y); + evas_object_show(es->o_base); E_LAYER_SET(es->o_base, layer); } diff --git a/src/bin/e_win.c b/src/bin/e_win.c index da732b1934..daf0c963e6 100644 --- a/src/bin/e_win.c +++ b/src/bin/e_win.c @@ -2,7 +2,6 @@ /* local subsystem functions */ static void _e_win_free(E_Win *win); -static void _e_win_del(void *obj); static void _e_win_prop_update(E_Win *win); static void _e_win_state_update(E_Win *win); static void _e_win_cb_move(Ecore_Evas *ee); @@ -236,6 +235,17 @@ static const Elm_Win_Trap _elm_win_trap = { }; #endif + +static void +_e_win_hide(void *obj) +{ + E_Win *win = obj; + + if (!win->border) return; + if (win->border->visible) e_border_hide(win->border, 1); + e_object_del(E_OBJECT(win->border)); +} + /* externally accessible functions */ EINTERN int e_win_init(void) @@ -276,8 +286,7 @@ e_win_new(E_Container *con) win = E_OBJECT_ALLOC(E_Win, E_WIN_TYPE, _e_win_free); if (!win) return NULL; - e_object_del_func_set(E_OBJECT(win), _e_win_del); - e_object_delay_del_set(E_OBJECT(win), e_win_hide); + e_object_delay_del_set(E_OBJECT(win), _e_win_hide); win->container = con; win->ecore_evas = e_canvas_new(con->manager->root, 0, 0, 1, 1, 1, 0, @@ -682,27 +691,23 @@ _e_win_free(E_Win *win) if (win->pointer) e_object_del(E_OBJECT(win->pointer)); - e_canvas_del(win->ecore_evas); - ecore_evas_free(win->ecore_evas); if (win->border) { - e_border_hide(win->border, 1); - e_object_del(E_OBJECT(win->border)); + 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); } static void -_e_win_del(void *obj) -{ - E_Win *win; - - win = obj; - if (win->border) e_border_hide(win->border, 1); -} - -static void _e_win_prop_update(E_Win *win) { ecore_x_icccm_size_pos_hints_set(win->evas_win, @@ -736,7 +741,10 @@ _e_win_cb_move(Ecore_Evas *ee) win = ecore_evas_data_get(ee, "E_Win"); if (!win) return; - ecore_evas_geometry_get(win->ecore_evas, &win->x, &win->y, &win->w, &win->h); + if (win->border) + win->x = win->border->x, win->y = win->border->y; + else + ecore_evas_geometry_get(win->ecore_evas, &win->x, &win->y, NULL, NULL); if (win->cb_move) win->cb_move(win); } @@ -747,7 +755,7 @@ _e_win_cb_resize(Ecore_Evas *ee) win = ecore_evas_data_get(ee, "E_Win"); if (!win) return; - ecore_evas_geometry_get(win->ecore_evas, &win->x, &win->y, &win->w, &win->h); + ecore_evas_geometry_get(win->ecore_evas, NULL, NULL, &win->w, &win->h); if (win->cb_resize) win->cb_resize(win); } diff --git a/src/modules/everything/e_mod_main.h b/src/modules/everything/e_mod_main.h index 82006bbd63..d058115695 100644 --- a/src/modules/everything/e_mod_main.h +++ b/src/modules/everything/e_mod_main.h @@ -25,7 +25,6 @@ struct _Evry_Window E_Win *ewin; Evas *evas; E_Zone *zone; - Eina_Bool shaped; Evas_Object *o_main; Eina_Bool request_selection; diff --git a/src/modules/everything/evry.c b/src/modules/everything/evry.c index 4fc593e8c1..e4e6e37094 100644 --- a/src/modules/everything/evry.c +++ b/src/modules/everything/evry.c @@ -64,6 +64,7 @@ static void _evry_view_hide(Evry_Window *win, Evry_View *v, int slide) static void _evry_item_desel(Evry_State *s); static void _evry_item_sel(Evry_State *s, Evry_Item *it); +static Eina_Bool _evry_cb_show(Evry_Window *win, int type __UNUSED__, Ecore_X_Event_Window_Show *ev); static Eina_Bool _evry_cb_key_down(void *data, int type, void *event); static Eina_Bool _evry_cb_selection_notify(void *data, int type, void *event); static Eina_Bool _evry_cb_mouse(void *data, int type, void *event); @@ -177,18 +178,16 @@ evry_show(E_Zone *zone, E_Zone_Edge edge, const char *params, Eina_Bool popup) if (popup) { - e_win_layer_set(win->ewin, E_WIN_LAYER_ABOVE); + //e_win_layer_set(win->ewin, E_WIN_LAYER_ABOVE); ecore_x_netwm_window_type_set(win->ewin->evas_win, ECORE_X_WINDOW_TYPE_UTILITY); ecore_evas_name_class_set(win->ewin->ecore_evas, "E", "everything"); - ecore_evas_show(win->ewin->ecore_evas); + e_win_show(win->ewin); + win->ewin->border->client.netwm.state.skip_taskbar = win->ewin->border->changed = 1; - if (e_grabinput_get(win->ewin->evas_win, 0, win->ewin->evas_win)) - win->grab = 1; - else - ERR("could not acquire grab"); + win->grab = 1; } evry_history_load(); @@ -203,51 +202,25 @@ evry_show(E_Zone *zone, E_Zone_Edge edge, const char *params, Eina_Bool popup) _evry_selector_new(win, EVRY_PLUGIN_ACTION); _evry_selector_new(win, EVRY_PLUGIN_OBJECT); - win->handlers = eina_list_append - (win->handlers, ecore_event_handler_add - (ECORE_EVENT_KEY_DOWN, - _evry_cb_key_down, win)); - - win->handlers = eina_list_append - (win->handlers, ecore_event_handler_add - (ECORE_X_EVENT_SELECTION_NOTIFY, - _evry_cb_selection_notify, win)); - - win->handlers = eina_list_append - (win->handlers, evry_event_handler_add - (EVRY_EVENT_ITEM_CHANGED, - _evry_cb_item_changed, win)); - - win->handlers = eina_list_append - (win->handlers, ecore_event_handler_add - (ECORE_EVENT_MOUSE_BUTTON_DOWN, - _evry_cb_mouse, win)); - - win->handlers = eina_list_append - (win->handlers, ecore_event_handler_add - (ECORE_EVENT_MOUSE_BUTTON_UP, - _evry_cb_mouse, win)); + E_LIST_HANDLER_APPEND(win->handlers, ECORE_EVENT_KEY_DOWN, _evry_cb_key_down, win); + + E_LIST_HANDLER_APPEND(win->handlers, ECORE_X_EVENT_SELECTION_NOTIFY, _evry_cb_selection_notify, win); + E_LIST_HANDLER_APPEND(win->handlers, ECORE_X_EVENT_WINDOW_SHOW, _evry_cb_show, win); + + E_LIST_HANDLER_APPEND(win->handlers, EVRY_EVENT_ITEM_CHANGED, _evry_cb_item_changed, win); + + E_LIST_HANDLER_APPEND(win->handlers, ECORE_EVENT_MOUSE_BUTTON_DOWN, _evry_cb_mouse, win); + + E_LIST_HANDLER_APPEND(win->handlers, ECORE_EVENT_MOUSE_BUTTON_UP, _evry_cb_mouse, win); E_LIST_HANDLER_APPEND(win->handlers, E_EVENT_DESKLOCK, _evry_cb_desklock, win); #if 0 - win->handlers = eina_list_append - (win->handlers, ecore_event_handler_add - (ECORE_EVENT_MOUSE_MOVE, - _evry_cb_mouse, win)); - - win->handlers = eina_list_append - (win->handlers, ecore_event_handler_add - (ECORE_EVENT_MOUSE_WHEEL, - _evry_cb_mouse, win)); - - win->handlers = eina_list_append - (win->handlers, ecore_event_handler_add - (ECORE_X_EVENT_MOUSE_IN, - _evry_cb_mouse_in, win)); - - win->handlers = eina_list_append - (win->handlers, ecore_event_handler_add - (ECORE_X_EVENT_MOUSE_OUT, - _evry_cb_mouse_out, win)); + E_LIST_HANDLER_APPEND(win->handlers, ECORE_EVENT_MOUSE_MOVE, _evry_cb_mouse, win); + + E_LIST_HANDLER_APPEND(win->handlers, ECORE_EVENT_MOUSE_WHEEL, _evry_cb_mouse, win); + + E_LIST_HANDLER_APPEND(win->handlers, ECORE_X_EVENT_MOUSE_IN, _evry_cb_mouse_in, win); + + E_LIST_HANDLER_APPEND(win->handlers, ECORE_X_EVENT_MOUSE_OUT, _evry_cb_mouse_out, win); #endif _evry_selector_plugins_get(SUBJ_SEL, NULL, params); _evry_selector_update(SUBJ_SEL); @@ -783,14 +756,12 @@ _evry_window_new(E_Zone *zone, E_Zone_Edge edge) Evas_Object *o; const char *tmp; int offset_s = 0; - const char *shape_option; win = E_NEW(Evry_Window, 1); win->ewin = e_win_new(zone->container); e_win_borderless_set(win->ewin, 1); e_win_no_remember_set(win->ewin, 1); e_win_placed_set(win->ewin, 1); - e_object_delay_del_set(E_OBJECT(win->ewin), NULL); //prevent deferred delete ecore_evas_override_set(win->ewin->ecore_evas, 1); win->evas = e_win_evas_get(win->ewin); win->zone = zone; @@ -801,27 +772,13 @@ _evry_window_new(E_Zone *zone, E_Zone_Edge edge) e_theme_edje_object_set(o, "base/theme/modules/everything", "e/modules/everything/main"); - if ((shape_option = edje_object_data_get(o, "shaped")) && - (!strcmp(shape_option, "1"))) - { - win->shaped = EINA_TRUE; - - if (!e_config->use_shaped_win) - { - ecore_evas_alpha_set(win->ewin->ecore_evas, 1); - win->ewin->evas_win = ecore_evas_software_x11_window_get(win->ewin->ecore_evas); - edje_object_signal_emit(o, "e,state,composited", "e"); - edje_object_signal_emit(o, "list:e,state,composited", "e"); - edje_object_message_signal_process(o); - edje_object_calc_force(o); - - tmp = edje_object_data_get(o, "shadow_offset"); - offset_s = tmp ? atoi(tmp) : 0; - } - else - ecore_evas_shaped_set(win->ewin->ecore_evas, 1); - } + edje_object_signal_emit(o, "e,state,composited", "e"); + edje_object_signal_emit(o, "list:e,state,composited", "e"); + edje_object_message_signal_process(o); + edje_object_calc_force(o); + tmp = edje_object_data_get(o, "shadow_offset"); + offset_s = tmp ? atoi(tmp) : 0; edje_object_size_min_calc(o, &mw, &mh); if (edge == E_ZONE_EDGE_NONE) @@ -895,8 +852,6 @@ _evry_window_new(E_Zone *zone, E_Zone_Edge edge) win->ewin->w = mw; win->ewin->h = mh; - o = win->o_main; - evas_object_move(o, 0, 0); evas_object_resize(o, mw, mh); evas_object_show(o); @@ -1027,13 +982,7 @@ _evry_cb_mouse(void *data, int type, void *event) static void _evry_window_free(Evry_Window *win) { - if (win->ewin->border) - ecore_x_window_hide(win->ewin->border->win); - else - ecore_x_window_hide(win->ewin->evas_win); - evas_event_freeze(win->evas); - evas_object_del(win->o_main); if (!e_object_is_del(E_OBJECT(win->ewin))) e_object_del(E_OBJECT(win->ewin)); E_FREE(win); @@ -1961,16 +1910,15 @@ _evry_cb_key_down(void *data, int type __UNUSED__, void *event) E_Win *ewin = win->ewin; e_grabinput_release(ewin->evas_win, ewin->evas_win); - if (!win->shaped) - e_win_borderless_set(ewin, 0); - ecore_evas_lower(ewin->ecore_evas); - ewin->border = e_border_new(ewin->container, ewin->evas_win, 1, 1); - // dont need this - special stuff - here it is needed - ewin->border->ignore_first_unmap = 1; - ewin->border->internal = 1; - ewin->border->internal_ecore_evas = ewin->ecore_evas; + e_border_layer_set(ewin->border, E_LAYER_NORMAL); + ecore_x_netwm_window_type_set(ewin->evas_win, + ECORE_X_WINDOW_TYPE_DIALOG); + ewin->border->client.netwm.fetch.type = 1; + ewin->border->client.netwm.state.skip_taskbar = 0; + ewin->border->changed = 1; + ewin->border->client.netwm.update.state = 1; ewin->border->internal_no_remember = 1; - e_border_show(ewin->border); + e_win_borderless_set(ewin, 0); win->grab = 0; return ECORE_CALLBACK_PASS_ON; @@ -3060,6 +3008,15 @@ _evry_plugin_list_insert(Evry_State *s, Evry_Plugin *p) } static Eina_Bool +_evry_cb_show(Evry_Window *win, int type __UNUSED__, Ecore_X_Event_Window_Show *ev) +{ + if (win->ewin->evas_win != ev->event_win) return ECORE_CALLBACK_RENEW; + if (win->grab) + e_grabinput_get(win->ewin->evas_win, 0, win->ewin->evas_win); + return ECORE_CALLBACK_RENEW; +} + +static Eina_Bool _evry_cb_selection_notify(void *data, int type __UNUSED__, void *event) { Ecore_X_Event_Selection_Notify *ev; diff --git a/src/modules/everything/evry_gadget.c b/src/modules/everything/evry_gadget.c index 558a129d6f..37e18e2470 100644 --- a/src/modules/everything/evry_gadget.c +++ b/src/modules/everything/evry_gadget.c @@ -216,7 +216,6 @@ _del_func(void *data, void *obj __UNUSED__) Instance *inst = data; e_gadcon_locked_set(inst->gcc->gadcon, 0); - e_object_delfn_del(E_OBJECT(inst->win->ewin), inst->del_fn); if (inst->hide_animator) ecore_animator_del(inst->hide_animator); inst->del_fn = NULL; @@ -320,28 +319,28 @@ _gadget_popup_show(Instance *inst) case E_GADCON_ORIENT_TOP: case E_GADCON_ORIENT_CORNER_TL: case E_GADCON_ORIENT_CORNER_TR: - e_win_move(ewin, x, y + h); + y += h; inst->hide_y = -1; break; case E_GADCON_ORIENT_BOTTOM: case E_GADCON_ORIENT_CORNER_BR: case E_GADCON_ORIENT_CORNER_BL: - e_win_move(ewin, x, y - ph); + y -= ph; inst->hide_y = 1; break; case E_GADCON_ORIENT_LEFT: case E_GADCON_ORIENT_CORNER_LT: case E_GADCON_ORIENT_CORNER_LB: - e_win_move(ewin, x + w, y); + x += w; inst->hide_x = -1; break; case E_GADCON_ORIENT_RIGHT: case E_GADCON_ORIENT_CORNER_RT: case E_GADCON_ORIENT_CORNER_RB: - e_win_move(ewin, x - pw, y); + x -= pw; inst->hide_x = 1; break; @@ -353,10 +352,12 @@ _gadget_popup_show(Instance *inst) } if (ewin->x + pw > inst->win->zone->w) - e_win_move(ewin, inst->win->zone->w - pw, ewin->y); + x = inst->win->zone->w - pw; if (ewin->y + ph > inst->win->zone->h) - e_win_move(ewin, ewin->x, inst->win->zone->h - ph); + y = inst->win->zone->h - ph; + + e_win_move(ewin, x, y); } static void diff --git a/src/modules/fileman/e_fwin.c b/src/modules/fileman/e_fwin.c index f224799585..cef8dd9b56 100644 --- a/src/modules/fileman/e_fwin.c +++ b/src/modules/fileman/e_fwin.c @@ -489,6 +489,7 @@ e_fwin_zone_new(E_Zone *zone, void *p) evas_object_move(o, x, y); evas_object_resize(o, w, h); E_LAYER_SET_UNDER(o, E_COMP_CANVAS_LAYER_DESKTOP); + evas_object_hide(o); evas_object_show(o); page->scrollframe_obj = page->scr = o; @@ -739,7 +740,6 @@ _e_fwin_free(E_Fwin *fwin) if (fwin->spring_parent) fwin->spring_parent->spring_child = NULL; if (fwin->win) { - e_object_delay_del_set(E_OBJECT(fwin->win), NULL); e_object_del(E_OBJECT(fwin->win)); } free(fwin); diff --git a/src/modules/illume-indicator/e_mod_ind_win.c b/src/modules/illume-indicator/e_mod_ind_win.c index 2f0ef88a10..2b3fe7263c 100644 --- a/src/modules/illume-indicator/e_mod_ind_win.c +++ b/src/modules/illume-indicator/e_mod_ind_win.c @@ -322,8 +322,7 @@ _e_mod_ind_win_cb_mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj _ bd = iwin->win->border; /* reset mouse pointer */ - if (bd->pointer) - e_pointer_type_pop(bd->pointer, bd, "move"); + e_pointer_type_pop(e_comp_get(bd)->pointer, bd, "move"); /* tell edj we are done moving */ edje_object_signal_emit(iwin->o_base, "e,action,move,stop", "e"); @@ -363,9 +362,8 @@ _e_mod_ind_win_cb_mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj iwin->drag.start = 0; /* change mouse pointer to indicate we are dragging */ - if (iwin->win->border->pointer) - e_pointer_type_push(iwin->win->border->pointer, - iwin->win->border, "move"); + e_pointer_type_push(e_comp_get(iwin->win)->pointer, + iwin->win->border, "move"); /* tell edj we are going to start moving */ edje_object_signal_emit(iwin->o_base, "e,action,move,start", "e"); diff --git a/src/modules/shot/e_mod_main.c b/src/modules/shot/e_mod_main.c index 1637f1087a..d72fb6a82a 100644 --- a/src/modules/shot/e_mod_main.c +++ b/src/modules/shot/e_mod_main.c @@ -611,13 +611,14 @@ _shot_now(E_Zone *zone, E_Border *bd) Evas_Object *o, *oa, *op, *ol; int x, y, w, h; Evas_Modifier_Mask mask; - Ecore_X_Window xwin, root; + Ecore_X_Window xwin; E_Radio_Group *rg; Ecore_X_Visual visual; Ecore_X_Display *display; Ecore_X_Screen *scr; Ecore_X_Window_Attributes watt; Ecore_X_Colormap colormap; + int depth; if ((!zone) && (!bd)) return; if (zone) @@ -628,28 +629,24 @@ _shot_now(E_Zone *zone, E_Border *bd) w = sw = sman->w; h = sh = sman->h; x = y = 0; + if (!ecore_x_window_attributes_get(xwin, &watt)) return; + visual = watt.visual; + depth = watt.depth; } else { - root = bd->zone->container->manager->root; - xwin = bd->client.win; - while (xwin != root) - { - if (ecore_x_window_parent_get(xwin) == root) break; - xwin = ecore_x_window_parent_get(xwin); - } - ecore_x_window_geometry_get(xwin, &x, &y, &sw, &sh); + xwin = e_comp_get(bd)->ee_win; + x = bd->x, y = bd->y, sw = bd->w, sh = bd->h; w = sw; h = sh; - xwin = root; - x = E_CLAMP(bd->x, bd->zone->x, bd->zone->x + bd->zone->w); - y = E_CLAMP(bd->y, bd->zone->y, bd->zone->y + bd->zone->h); + x = E_CLAMP(x, bd->zone->x, bd->zone->x + bd->zone->w); + y = E_CLAMP(y, bd->zone->y, bd->zone->y + bd->zone->h); sw = E_CLAMP(sw, 0, bd->zone->x + bd->zone->w - x); sh = E_CLAMP(sh, 0, bd->zone->y + bd->zone->h - y); + visual = bd->client.initial_attributes.visual; + depth = bd->client.initial_attributes.depth; } - if (!ecore_x_window_attributes_get(xwin, &watt)) return; - visual = watt.visual; - img = ecore_x_image_new(w, h, visual, ecore_x_window_depth_get(xwin)); + img = ecore_x_image_new(w, h, visual, depth); ecore_x_image_get(img, xwin, x, y, 0, 0, sw, sh); src = ecore_x_image_data_get(img, &bpl, &rows, &bpp); display = ecore_x_display_get(); diff --git a/src/modules/tasks/e_mod_main.c b/src/modules/tasks/e_mod_main.c index fb8a9049ff..bd9638e14b 100644 --- a/src/modules/tasks/e_mod_main.c +++ b/src/modules/tasks/e_mod_main.c @@ -846,11 +846,13 @@ _tasks_cb_item_mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSE static Eina_Bool _tasks_cb_event_border_add(void *data __UNUSED__, int type __UNUSED__, void *event) { - E_Event_Border_Add *ev; + E_Event_Border_Add *ev = event; - ev = event; - tasks_config->borders = eina_list_append(tasks_config->borders, ev->border); - _tasks_refill_all(); + if ((!tasks_config->borders) || (!eina_list_data_find(tasks_config->borders, ev->border))) + { + tasks_config->borders = eina_list_append(tasks_config->borders, ev->border); + _tasks_refill_all(); + } return EINA_TRUE; } diff --git a/src/modules/winlist/e_winlist.c b/src/modules/winlist/e_winlist.c index 73b0f029cf..c88a9a83ac 100644 --- a/src/modules/winlist/e_winlist.c +++ b/src/modules/winlist/e_winlist.c @@ -259,8 +259,8 @@ e_winlist_hide(void) E_FREE_FUNC(_scroll_timer, ecore_timer_del); E_FREE_FUNC(_animator, ecore_animator_del); - ecore_x_window_free(_input_window); e_grabinput_release(_input_window, _input_window); + ecore_x_window_free(_input_window); _input_window = 0; if (bd) { @@ -1334,10 +1334,11 @@ _e_winlist_cb_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event ev = event; if (ev->window != _input_window) return ECORE_CALLBACK_PASS_ON; - - evas_event_feed_mouse_move(_winlist->evas, ev->x - _winlist->x + - _winlist->zone->x, ev->y - _winlist->y + - _winlist->zone->y, ev->timestamp, NULL); + /* only feed mouse move if it's within the winlist popup */ + if (E_INSIDE(ev->x - _winlist->zone->x, ev->y - _winlist->zone->y, _winlist->x, _winlist->y, _winlist->w, _winlist->h)) + evas_event_feed_mouse_move(_winlist->evas, ev->x - _winlist->x + + _winlist->zone->x, ev->y - _winlist->y + + _winlist->zone->y, ev->timestamp, NULL); return ECORE_CALLBACK_PASS_ON; } |