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
This commit is contained in:
Mike Blumenkrantz 2013-02-25 14:04:12 +00:00
parent b919573644
commit 505cec1d91
25 changed files with 1213 additions and 1280 deletions

View File

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

1
NEWS
View File

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

View File

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

View File

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

View File

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

View File

@ -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 E_Comp_Win *
_e_comp_win_add(E_Comp *c, Ecore_X_Window win)
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_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))
else
{
free(cw->name);
free(cw->clas);
free(cw->role);
free(cw);
if (conf->grab) ecore_x_ungrab();
return NULL;
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);
}
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;
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)
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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;
E_Manager *man = data;
Ecore_Event_Key *e = ev;
man = data;
e = ev;
if (e->event_window != man->root)
{
E_Border *bd;
if (e->event_window != man->root) return ECORE_CALLBACK_PASS_ON;
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;

View File

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

View File

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

View File

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

View File

@ -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,26 +691,22 @@ _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)
{
@ -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);
}

View File

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

View File

@ -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));
E_LIST_HANDLER_APPEND(win->handlers, 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));
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);
win->handlers = eina_list_append
(win->handlers, evry_event_handler_add
(EVRY_EVENT_ITEM_CHANGED,
_evry_cb_item_changed, win));
E_LIST_HANDLER_APPEND(win->handlers, 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));
E_LIST_HANDLER_APPEND(win->handlers, 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_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));
E_LIST_HANDLER_APPEND(win->handlers, 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));
E_LIST_HANDLER_APPEND(win->handlers, 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));
E_LIST_HANDLER_APPEND(win->handlers, 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_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;
@ -3059,6 +3007,15 @@ _evry_plugin_list_insert(Evry_State *s, Evry_Plugin *p)
s->cur_plugins = eina_list_append(s->cur_plugins, 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)
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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