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
devs/devilhorns/e_wayland
Mike Blumenkrantz 11 years ago
parent b919573644
commit 505cec1d91
  1. 4
      ChangeLog
  2. 1
      NEWS
  3. 63
      data/themes/edc/border.edc
  4. 8
      src/bin/e_actions.c
  5. 1622
      src/bin/e_border.c
  6. 31
      src/bin/e_border.h
  7. 363
      src/bin/e_comp.c
  8. 4
      src/bin/e_comp.h
  9. 2
      src/bin/e_container.c
  10. 4
      src/bin/e_container.h
  11. 4
      src/bin/e_desklock.c
  12. 3
      src/bin/e_dnd.c
  13. 22
      src/bin/e_manager.c
  14. 91
      src/bin/e_pointer.c
  15. 19
      src/bin/e_pointer.h
  16. 1
      src/bin/e_shelf.c
  17. 44
      src/bin/e_win.c
  18. 1
      src/modules/everything/e_mod_main.h
  19. 133
      src/modules/everything/evry.c
  20. 15
      src/modules/everything/evry_gadget.c
  21. 2
      src/modules/fileman/e_fwin.c
  22. 8
      src/modules/illume-indicator/e_mod_ind_win.c
  23. 27
      src/modules/shot/e_mod_main.c
  24. 10
      src/modules/tasks/e_mod_main.c
  25. 11
      src/modules/winlist/e_winlist.c

@ -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.

@ -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,8 +521,23 @@ 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;

@ -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);
}
}

File diff suppressed because it is too large Load Diff

@ -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

@ -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)
{

@ -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 *

@ -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

@ -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;
};

@ -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

@ -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;

@ -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;

@ -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"