booyah. added lots of ecore_evas state stuff and ability to track

state changes too made by a wm - eg getting iconified.



SVN revision: 68493
This commit is contained in:
Carsten Haitzler 2012-02-28 06:43:59 +00:00
parent 1bef88b19c
commit 57c681a33e
17 changed files with 501 additions and 153 deletions

View File

@ -531,4 +531,11 @@
2012-02-28 Carsten Haitzler (The Rasterman)
* Add ecore_x_netwm_icons_set()
* Add ecore_evas_window_group_set() ecore_evas_window_group_get()
ecore_evas_aspect_set() ecore_evas_aspect_get()
ecore_evas_urgent_set() ecore_evas_urgent_get()
ecore_evas_modal_set() ecore_evas_modal_get()
ecore_evas_demand_attention_set()
ecore_evas_demand_attention_get()
ecore_evas_focus_skip_set() ecore_evas_focus_skip_get()
ecore_evas_callback_state_change_set()

View File

@ -401,6 +401,20 @@ EAPI void ecore_evas_fullscreen_set(Ecore_Evas *ee, Eina_Bool on);
* @see ecore_evas_fullscreen_set()
*/
EAPI Eina_Bool ecore_evas_fullscreen_get(const Ecore_Evas *ee);
EAPI void ecore_evas_window_group_set(Ecore_Evas *ee, const Ecore_Evas *ee_group);
EAPI const Ecore_Evas *ecore_evas_window_group_get(const Ecore_Evas *ee);
EAPI void ecore_evas_aspect_set(Ecore_Evas *ee, double aspect);
EAPI double ecore_evas_aspect_get(const Ecore_Evas *ee);
EAPI void ecore_evas_urgent_set(Ecore_Evas *ee, Eina_Bool urgent);
EAPI Eina_Bool ecore_evas_urgent_get(const Ecore_Evas *ee);
EAPI void ecore_evas_modal_set(Ecore_Evas *ee, Eina_Bool modal);
EAPI Eina_Bool ecore_evas_modal_get(const Ecore_Evas *ee);
EAPI void ecore_evas_demand_attention_set(Ecore_Evas *ee, Eina_Bool demand);
EAPI Eina_Bool ecore_evas_demand_attention_get(const Ecore_Evas *ee);
EAPI void ecore_evas_focus_skip_set(Ecore_Evas *ee, Eina_Bool skip);
EAPI Eina_Bool ecore_evas_focus_skip_get(const Ecore_Evas *ee);
/**
* @brief Set if this evas should ignore @b all events.
*
@ -1209,6 +1223,19 @@ EAPI void ecore_evas_callback_post_render_set(Ecore_Evas *ee, Ecore_Evas_
* windowing system.
*/
EAPI void ecore_evas_callback_pre_free_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
/**
* Set a callback for Ecore_Evas state changes.
* @param ee The Ecore_Evas to set callbacks on
* @param func The function to call
* A call to this function will set a callback on an Ecore_Evas, causing
* @p func to be called whenever @p ee changes state.
*
* @warning If and when this function is called depends on the underlying
* windowing system.
*/
EAPI void ecore_evas_callback_state_change_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
EAPI Evas *ecore_evas_get(const Ecore_Evas *ee);
EAPI void ecore_evas_managed_move(Ecore_Evas *ee, int x, int y);
EAPI void ecore_evas_shaped_set(Ecore_Evas *ee, Eina_Bool shaped);

View File

@ -1132,6 +1132,18 @@ ecore_evas_callback_pre_free_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
ee->func.fn_pre_free = func;
}
EAPI void
ecore_evas_callback_state_change_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
"ecore_evas_callback_state_change_set");
return;
}
ee->func.fn_state_change = func;
}
/**
* Get an Ecore_Evas's Evas
* @param ee The Ecore_Evas whose Evas you wish to get
@ -2100,6 +2112,162 @@ ecore_evas_sticky_get(const Ecore_Evas *ee)
return ee->prop.sticky ? EINA_TRUE : EINA_FALSE;
}
EAPI void
ecore_evas_window_group_set(Ecore_Evas *ee, const Ecore_Evas *ee_group)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
"XXX");
return;
}
IFC(ee, fn_window_group_set) (ee, ee_group);
IFE;
}
EAPI const Ecore_Evas *
ecore_evas_window_group_get(const Ecore_Evas *ee)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
"XXX");
return EINA_FALSE;
}
return ee->prop.group_ee;
}
EAPI void
ecore_evas_aspect_set(Ecore_Evas *ee, double aspect)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
"XXX");
return;
}
IFC(ee, fn_aspect_set) (ee, aspect);
IFE;
}
EAPI double
ecore_evas_aspect_get(const Ecore_Evas *ee)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
"XXX");
return EINA_FALSE;
}
return ee->prop.aspect;
}
EAPI void
ecore_evas_urgent_set(Ecore_Evas *ee, Eina_Bool urgent)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
"XXX");
return;
}
IFC(ee, fn_urgent_set) (ee, urgent);
IFE;
}
EAPI Eina_Bool
ecore_evas_urgent_get(const Ecore_Evas *ee)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
"XXX");
return EINA_FALSE;
}
return ee->prop.urgent ? EINA_TRUE : EINA_FALSE;
}
EAPI void
ecore_evas_modal_set(Ecore_Evas *ee, Eina_Bool modal)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
"XXX");
return;
}
IFC(ee, fn_modal_set) (ee, modal);
IFE;
}
EAPI Eina_Bool
ecore_evas_modal_get(const Ecore_Evas *ee)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
"XXX");
return EINA_FALSE;
}
return ee->prop.modal ? EINA_TRUE : EINA_FALSE;
}
EAPI void
ecore_evas_demand_attention_set(Ecore_Evas *ee, Eina_Bool demand)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
"XXX");
return;
}
IFC(ee, fn_demands_attention_set) (ee, demand);
IFE;
}
EAPI Eina_Bool
ecore_evas_demand_attention_get(const Ecore_Evas *ee)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
"XXX");
return EINA_FALSE;
}
return ee->prop.demand_attention ? EINA_TRUE : EINA_FALSE;
}
EAPI void
ecore_evas_focus_skip_set(Ecore_Evas *ee, Eina_Bool skip)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
"XXX");
return;
}
IFC(ee, fn_focus_skip_set) (ee, skip);
IFE;
}
EAPI Eina_Bool
ecore_evas_focus_skip_get(const Ecore_Evas *ee)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
"XXX");
return EINA_FALSE;
}
return ee->prop.focus_skip ? EINA_TRUE : EINA_FALSE;
}
EAPI void
ecore_evas_ignore_events_set(Ecore_Evas *ee, Eina_Bool ignore)
{

View File

@ -513,6 +513,13 @@ static Ecore_Evas_Engine_Func _ecore_buffer_engine_func =
_ecore_evas_buffer_alpha_set,
NULL, //transparent
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
_ecore_evas_buffer_render,
NULL // screen_geometry_get
};

View File

@ -463,6 +463,14 @@ static Ecore_Evas_Engine_Func _ecore_cocoa_engine_func =
NULL,
NULL,
NULL, //transparent
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL, // render
NULL
};

View File

@ -490,6 +490,13 @@ static Ecore_Evas_Engine_Func _ecore_directfb_engine_func =
NULL, /* alpha */
NULL, //transparent
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL, // render
NULL // screen_geometry_get
};

View File

@ -683,6 +683,14 @@ static const Ecore_Evas_Engine_Func _ecore_ews_engine_func =
_ecore_evas_ews_ignore_events_set,
_ecore_evas_ews_alpha_set,
_ecore_evas_ews_transparent_set,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
_ecore_evas_ews_render,
_ecore_evas_ews_screen_geometry_get
};

View File

@ -1104,6 +1104,13 @@ static const Ecore_Evas_Engine_Func _ecore_extn_plug_engine_func =
NULL,
NULL, //transparent
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL, // render
NULL // screen_geometry_get
};
@ -1981,6 +1988,14 @@ static const Ecore_Evas_Engine_Func _ecore_extn_socket_engine_func =
_ecore_evas_extn_socket_alpha_set,
NULL, //transparent
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
_ecore_evas_extn_socket_render, // render
NULL // screen_geometry_get
};

View File

@ -541,6 +541,13 @@ static Ecore_Evas_Engine_Func _ecore_fb_engine_func =
NULL,
NULL, //transparent
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL, // render
NULL // screen_geometry_get
};

View File

@ -178,6 +178,13 @@ struct _Ecore_Evas_Engine_Func
void (*fn_alpha_set) (Ecore_Evas *ee, int alpha);
void (*fn_transparent_set) (Ecore_Evas *ee, int transparent);
void (*fn_window_group_set) (Ecore_Evas *ee, const Ecore_Evas *ee_group);
void (*fn_aspect_set) (Ecore_Evas *ee, double aspect);
void (*fn_urgent_set) (Ecore_Evas *ee, int urgent);
void (*fn_modal_set) (Ecore_Evas *ee, int modal);
void (*fn_demands_attention_set) (Ecore_Evas *ee, int demand);
void (*fn_focus_skip_set) (Ecore_Evas *ee, int skip);
int (*fn_render) (Ecore_Evas *ee);
void (*fn_screen_geometry_get) (const Ecore_Evas *ee, int *x, int *y, int *w, int *h);
};
@ -334,6 +341,9 @@ struct _Ecore_Evas
int layer;
Ecore_Window window;
unsigned char avoid_damage;
Ecore_Evas *group_ee;
Ecore_Window group_ee_win;
double aspect;
char focused : 1;
char iconified : 1;
char borderless : 1;
@ -345,7 +355,11 @@ struct _Ecore_Evas
char request_pos : 1;
char draw_frame : 1;
char hwsurface : 1;
} prop;
char urgent : 1;
char modal : 1;
char demand_attention : 1;
char focus_skip : 1;
} prop;
struct {
void (*fn_resize) (Ecore_Evas *ee);
@ -363,6 +377,7 @@ struct _Ecore_Evas
void (*fn_pre_render) (Ecore_Evas *ee);
void (*fn_post_render) (Ecore_Evas *ee);
void (*fn_pre_free) (Ecore_Evas *ee);
void (*fn_state_change) (Ecore_Evas *ee);
} func;
Ecore_Evas_Engine engine;

View File

@ -396,6 +396,13 @@ static Ecore_Evas_Engine_Func _ecore_psl1ght_engine_func =
NULL,
NULL, //transparent
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL, // render
_ecore_evas_screen_geometry_get // screen_geometry_get
};

View File

@ -433,6 +433,13 @@ static Ecore_Evas_Engine_Func _ecore_sdl_engine_func =
NULL,
NULL, //transparent
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL, // render
NULL // screen_geometry_get
};

View File

@ -152,6 +152,14 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
NULL, // func ignore events set
NULL, // func alpha set
NULL, // func transparent set
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
_ecore_evas_wl_render,
_ecore_evas_wl_screen_geometry_get
};

View File

@ -153,6 +153,14 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
NULL, // func ignore_events set
NULL, // func alpha set
NULL, // func transparent set
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
_ecore_evas_wl_render,
_ecore_evas_wl_screen_geometry_get
};

View File

@ -982,6 +982,13 @@ static Ecore_Evas_Engine_Func _ecore_win32_engine_func =
NULL, /* _ecore_evas_x_alpha_set */
NULL, //transparent
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL, // render
NULL //screen_geometry_get
};

View File

@ -773,6 +773,13 @@ static Ecore_Evas_Engine_Func _ecore_wince_engine_func =
NULL, /* _ecore_evas_x_alpha_set */
NULL, //transparent
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL, // render
NULL // screen_geometry_get
};

View File

@ -19,6 +19,22 @@ static Ecore_Event_Handler *ecore_evas_event_handlers[13];
static int leader_ref = 0;
static Ecore_X_Window leader_win = 0;
static void
_ecore_evas_x_hints_update(Ecore_Evas *ee)
{
ecore_x_icccm_hints_set
(ee->prop.window,
!ee->prop.focus_skip /* accepts_focus */,
ee->prop.iconified ? ECORE_X_WINDOW_STATE_HINT_ICONIC :
ee->prop.withdrawn ? ECORE_X_WINDOW_STATE_HINT_WITHDRAWN :
ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */,
0 /* icon_pixmap */,
0 /* icon_mask */,
0 /* icon_window */,
ee->prop.group_ee_win /* window_group */,
ee->prop.urgent /* is_urgent */);
}
static void
_ecore_evas_x_group_leader_set(Ecore_Evas *ee)
{
@ -537,6 +553,7 @@ _ecore_evas_x_event_property_change(void *data __UNUSED__, int type __UNUSED__,
{
Ecore_Evas *ee;
Ecore_X_Event_Window_Property *e;
int state_change = 0;
e = event;
ee = ecore_event_window_match(e->win);
@ -546,7 +563,6 @@ _ecore_evas_x_event_property_change(void *data __UNUSED__, int type __UNUSED__,
{
unsigned int i, num;
Ecore_X_Window_State *state;
int sticky = 0;
/* TODO: we need to move those to the end, with if statements */
ee->engine.x.state.modal = 0;
@ -560,6 +576,9 @@ _ecore_evas_x_event_property_change(void *data __UNUSED__, int type __UNUSED__,
ee->engine.x.state.above = 0;
ee->engine.x.state.below = 0;
// XXXXXXXXXXXXXXXXXx fixme... handle state change flag properly
state_change = 1;
ecore_x_netwm_window_state_get(e->win, &state, &num);
if (state)
{
@ -568,56 +587,75 @@ _ecore_evas_x_event_property_change(void *data __UNUSED__, int type __UNUSED__,
switch (state[i])
{
case ECORE_X_WINDOW_STATE_MODAL:
ee->engine.x.state.modal = 1;
break;
ee->engine.x.state.modal = 1;
break;
case ECORE_X_WINDOW_STATE_STICKY:
if (ee->prop.sticky && ee->engine.x.state.sticky)
break;
sticky = 1;
ee->prop.sticky = 1;
ee->engine.x.state.sticky = 1;
if (ee->func.fn_sticky) ee->func.fn_sticky(ee);
break;
ee->prop.sticky = 1;
ee->engine.x.state.sticky = 1;
break;
case ECORE_X_WINDOW_STATE_MAXIMIZED_VERT:
ee->engine.x.state.maximized_v = 1;
break;
ee->engine.x.state.maximized_v = 1;
break;
case ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ:
ee->engine.x.state.maximized_h = 1;
break;
ee->engine.x.state.maximized_h = 1;
break;
case ECORE_X_WINDOW_STATE_SHADED:
ee->engine.x.state.shaded = 1;
break;
ee->engine.x.state.shaded = 1;
break;
case ECORE_X_WINDOW_STATE_SKIP_TASKBAR:
ee->engine.x.state.skip_taskbar = 1;
break;
ee->engine.x.state.skip_taskbar = 1;
break;
case ECORE_X_WINDOW_STATE_SKIP_PAGER:
ee->engine.x.state.skip_pager = 1;
break;
ee->engine.x.state.skip_pager = 1;
break;
case ECORE_X_WINDOW_STATE_FULLSCREEN:
ee->prop.fullscreen = 1;
ee->engine.x.state.fullscreen = 1;
break;
ee->prop.fullscreen = 1;
ee->engine.x.state.fullscreen = 1;
break;
case ECORE_X_WINDOW_STATE_ABOVE:
ee->engine.x.state.above = 1;
break;
ee->engine.x.state.above = 1;
break;
case ECORE_X_WINDOW_STATE_BELOW:
ee->engine.x.state.below = 1;
break;
ee->engine.x.state.below = 1;
break;
default:
break;
}
}
free(state);
}
if ((ee->prop.sticky) && (!sticky))
}
else if (e->atom == ECORE_X_ATOM_WM_STATE)
{
Ecore_X_Window_State_Hint state;
// handle WM_STATE changes
state = ecore_x_icccm_state_get(e->win);
switch (state)
{
ee->prop.sticky = 0;
ee->engine.x.state.sticky = 0;
if (ee->func.fn_unsticky) ee->func.fn_unsticky(ee);
case ECORE_X_WINDOW_STATE_HINT_WITHDRAWN:
case ECORE_X_WINDOW_STATE_HINT_ICONIC:
if (!ee->prop.iconified)
{
state_change = 1;
ee->prop.iconified = 1;
}
break;
case ECORE_X_WINDOW_STATE_HINT_NORMAL:
if (ee->prop.iconified)
{
state_change = 1;
ee->prop.iconified = 0;
}
break;
default:
break;
}
}
if (state_change)
{
if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
}
return ECORE_CALLBACK_PASS_ON;
}
@ -1078,8 +1116,8 @@ _ecore_evas_x_size_pos_hints_update(Ecore_Evas *ee)
ee->prop.base.h /* base_h */,
ee->prop.step.w /* step_x */,
ee->prop.step.h /* step_y */,
0 /* min_aspect */,
0 /* max_aspect */);
ee->prop.aspect /* min_aspect */,
ee->prop.aspect /* max_aspect */);
}
/* FIXME, should be in idler */
@ -1089,32 +1127,30 @@ _ecore_evas_x_state_update(Ecore_Evas *ee)
Ecore_X_Window_State state[10];
int num = 0;
/*
if (bd->client.netwm.state.modal)
if (ee->prop.modal)
state[num++] = ECORE_X_WINDOW_STATE_MODAL;
*/
if (ee->engine.x.state.sticky)
if (ee->prop.sticky)
state[num++] = ECORE_X_WINDOW_STATE_STICKY;
/*
if (bd->client.netwm.state.maximized_v)
if (ee->prop.maximized)
state[num++] = ECORE_X_WINDOW_STATE_MAXIMIZED_VERT;
if (bd->client.netwm.state.maximized_h)
if (ee->prop.maximized)
state[num++] = ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ;
if (bd->client.netwm.state.shaded)
state[num++] = ECORE_X_WINDOW_STATE_SHADED;
if (bd->client.netwm.state.skip_taskbar)
// if (bd->client.netwm.state.shaded)
// state[num++] = ECORE_X_WINDOW_STATE_SHADED;
if (ee->prop.focus_skip)
state[num++] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
if (bd->client.netwm.state.skip_pager)
if (ee->prop.focus_skip)
state[num++] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
if (bd->client.netwm.state.hidden)
state[num++] = ECORE_X_WINDOW_STATE_HIDDEN;
*/
// if (bd->client.netwm.state.hidden)
// state[num++] = ECORE_X_WINDOW_STATE_HIDDEN;
if (ee->engine.x.state.fullscreen)
state[num++] = ECORE_X_WINDOW_STATE_FULLSCREEN;
if (ee->engine.x.state.above)
state[num++] = ECORE_X_WINDOW_STATE_ABOVE;
if (ee->engine.x.state.below)
state[num++] = ECORE_X_WINDOW_STATE_BELOW;
if (ee->prop.demand_attention)
state[num++] = ECORE_X_WINDOW_STATE_DEMANDS_ATTENTION;
ecore_x_netwm_window_state_set(ee->prop.window, state, num);
}
@ -1839,14 +1875,7 @@ _ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha)
ecore_x_icccm_title_set(ee->prop.window, ee->prop.title);
ecore_x_netwm_name_set(ee->prop.window, ee->prop.title);
}
ecore_x_icccm_hints_set(ee->prop.window,
1 /* accepts_focus */,
ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */,
0 /* icon_pixmap */,
0 /* icon_mask */,
0 /* icon_window */,
0 /* window_group */,
0 /* is_urgent */);
_ecore_evas_x_hints_update(ee);
_ecore_evas_x_group_leader_update(ee);
ecore_x_window_defaults_set(ee->prop.window);
_ecore_evas_x_protocols_set(ee);
@ -1962,14 +1991,7 @@ _ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha)
ecore_x_icccm_title_set(ee->prop.window, ee->prop.title);
ecore_x_netwm_name_set(ee->prop.window, ee->prop.title);
}
ecore_x_icccm_hints_set(ee->prop.window,
1 /* accepts_focus */,
ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */,
0 /* icon_pixmap */,
0 /* icon_mask */,
0 /* icon_window */,
0 /* window_group */,
0 /* is_urgent */);
_ecore_evas_x_hints_update(ee);
_ecore_evas_x_group_leader_update(ee);
ecore_x_window_defaults_set(ee->prop.window);
_ecore_evas_x_protocols_set(ee);
@ -2048,14 +2070,7 @@ _ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha)
ecore_x_icccm_title_set(ee->prop.window, ee->prop.title);
ecore_x_netwm_name_set(ee->prop.window, ee->prop.title);
}
ecore_x_icccm_hints_set(ee->prop.window,
1 /* accepts_focus */,
ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */,
0 /* icon_pixmap */,
0 /* icon_mask */,
0 /* icon_window */,
0 /* window_group */,
0 /* is_urgent */);
_ecore_evas_x_hints_update(ee);
_ecore_evas_x_group_leader_update(ee);
ecore_x_window_defaults_set(ee->prop.window);
_ecore_evas_x_protocols_set(ee);
@ -2134,14 +2149,7 @@ _ecore_evas_x_alpha_set(Ecore_Evas *ee, int alpha)
ecore_x_icccm_title_set(ee->prop.window, ee->prop.title);
ecore_x_netwm_name_set(ee->prop.window, ee->prop.title);
}
ecore_x_icccm_hints_set(ee->prop.window,
1 /* accepts_focus */,
ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */,
0 /* icon_pixmap */,
0 /* icon_mask */,
0 /* icon_window */,
0 /* window_group */,
0 /* is_urgent */);
_ecore_evas_x_hints_update(ee);
_ecore_evas_x_group_leader_update(ee);
ecore_x_window_defaults_set(ee->prop.window);
_ecore_evas_x_protocols_set(ee);
@ -2182,6 +2190,88 @@ _ecore_evas_x_transparent_set(Ecore_Evas *ee, int transparent)
#endif
}
}
static void
_ecore_evas_x_window_group_set(Ecore_Evas *ee, const Ecore_Evas *group_ee)
{
if (ee->prop.group_ee == group_ee) return;
ee->prop.group_ee = (Ecore_Evas *)group_ee;
if (ee->prop.group_ee)
ee->prop.group_ee_win = group_ee->prop.window;
else
ee->prop.group_ee_win = 0;
_ecore_evas_x_hints_update(ee);
}
static void
_ecore_evas_x_aspect_set(Ecore_Evas *ee, double aspect)
{
if (ee->prop.aspect == aspect) return;
ee->prop.aspect = aspect;
_ecore_evas_x_size_pos_hints_update(ee);
// netwm state
// if (ee->should_be_visible)
// ecore_x_netwm_state_request_send(ee->prop.window, ee->engine.x.win_root,
// ECORE_X_WINDOW_STATE_STICKY, -1, sticky);
// else
// _ecore_evas_x_state_update(ee);
}
static void
_ecore_evas_x_urgent_set(Ecore_Evas *ee, int urgent)
{
if (ee->prop.urgent == urgent) return;
ee->prop.urgent = urgent;
_ecore_evas_x_hints_update(ee);
}
static void
_ecore_evas_x_modal_set(Ecore_Evas *ee, int modal)
{
if (ee->prop.modal == modal) return;
ee->prop.modal = modal;
if (ee->should_be_visible)
ecore_x_netwm_state_request_send(ee->prop.window, ee->engine.x.win_root,
ECORE_X_WINDOW_STATE_MODAL, -1, modal);
else
_ecore_evas_x_state_update(ee);
}
static void
_ecore_evas_x_demand_attention_set(Ecore_Evas *ee, int demand)
{
if (ee->prop.demand_attention == demand) return;
ee->prop.demand_attention = demand;
if (ee->should_be_visible)
ecore_x_netwm_state_request_send(ee->prop.window, ee->engine.x.win_root,
ECORE_X_WINDOW_STATE_DEMANDS_ATTENTION, -1, demand);
else
_ecore_evas_x_state_update(ee);
}
static void
_ecore_evas_x_focus_skip_set(Ecore_Evas *ee, int skip)
{
if (ee->prop.focus_skip == skip) return;
ee->prop.focus_skip = skip;
if (ee->should_be_visible)
{
ecore_x_netwm_state_request_send(ee->prop.window, ee->engine.x.win_root,
ECORE_X_WINDOW_STATE_SKIP_TASKBAR, -1, !skip);
ecore_x_netwm_state_request_send(ee->prop.window, ee->engine.x.win_root,
ECORE_X_WINDOW_STATE_SKIP_PAGER, -1, !skip);
}
else
_ecore_evas_x_state_update(ee);
_ecore_evas_x_hints_update(ee);
}
#endif /* BUILD_ECORE_EVAS_X11 */
#ifdef BUILD_ECORE_EVAS_X11
@ -2369,30 +2459,11 @@ _ecore_evas_x_iconified_set(Ecore_Evas *ee, int on)
{
if (ee->prop.iconified == on) return;
ee->prop.iconified = on;
_ecore_evas_x_hints_update(ee);
if (on)
{
ecore_x_icccm_hints_set(ee->prop.window,
1 /* accepts_focus */,
ECORE_X_WINDOW_STATE_HINT_ICONIC /* initial_state */,
0 /* icon_pixmap */,
0 /* icon_mask */,
0 /* icon_window */,
0 /* window_group */,
0 /* is_urgent */);
ecore_x_icccm_iconic_request_send(ee->prop.window, ee->engine.x.win_root);
}
ecore_x_icccm_iconic_request_send(ee->prop.window, ee->engine.x.win_root);
else
{
ecore_x_icccm_hints_set(ee->prop.window,
1 /* accepts_focus */,
ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */,
0 /* icon_pixmap */,
0 /* icon_mask */,
0 /* icon_window */,
0 /* window_group */,
0 /* is_urgent */);
ecore_evas_show(ee);
}
ecore_evas_show(ee);
}
static void
@ -2408,24 +2479,9 @@ _ecore_evas_x_borderless_set(Ecore_Evas *ee, int on)
static void
_ecore_evas_x_withdrawn_set(Ecore_Evas *ee, int withdrawn)
{
Ecore_X_Window_State_Hint hint;
if (ee->prop.withdrawn == withdrawn) return;
ee->prop.withdrawn = withdrawn;
if (withdrawn)
hint = ECORE_X_WINDOW_STATE_HINT_WITHDRAWN;
else
hint = ECORE_X_WINDOW_STATE_HINT_NORMAL;
ecore_x_icccm_hints_set(ee->prop.window,
1 /* accepts_focus */,
hint /* initial_state */,
0 /* icon_pixmap */,
0 /* icon_mask */,
0 /* icon_window */,
0 /* window_group */,
0 /* is_urgent */);
_ecore_evas_x_hints_update(ee);
}
static void
@ -2762,6 +2818,13 @@ static Ecore_Evas_Engine_Func _ecore_x_engine_func =
_ecore_evas_x_ignore_events_set,
_ecore_evas_x_alpha_set,
_ecore_evas_x_transparent_set,
_ecore_evas_x_window_group_set,
_ecore_evas_x_aspect_set,
_ecore_evas_x_urgent_set,
_ecore_evas_x_modal_set,
_ecore_evas_x_demand_attention_set,
_ecore_evas_x_focus_skip_set,
NULL, // render
_ecore_evas_x_screen_geometry_get
@ -3003,14 +3066,7 @@ ecore_evas_software_x11_new(const char *disp_name, Ecore_X_Window parent,
}
}
ecore_x_icccm_hints_set(ee->prop.window,
1 /* accepts_focus */,
ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */,
0 /* icon_pixmap */,
0 /* icon_mask */,
0 /* icon_window */,
0 /* window_group */,
0 /* is_urgent */);
_ecore_evas_x_hints_update(ee);
_ecore_evas_x_group_leader_set(ee);
ecore_x_window_defaults_set(ee->prop.window);
_ecore_evas_x_protocols_set(ee);
@ -3240,14 +3296,7 @@ ecore_evas_gl_x11_options_new(const char *disp_name, Ecore_X_Window parent,
// putenv((char*)"DESKTOP_STARTUP_ID=");
}
ecore_x_icccm_hints_set(ee->prop.window,
1 /* accepts_focus */,
ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */,
0 /* icon_pixmap */,
0 /* icon_mask */,
0 /* icon_window */,
0 /* window_group */,
0 /* is_urgent */);
_ecore_evas_x_hints_update(ee);
_ecore_evas_x_group_leader_set(ee);
ecore_x_window_defaults_set(ee->prop.window);
_ecore_evas_x_protocols_set(ee);
@ -3571,14 +3620,7 @@ ecore_evas_software_x11_16_new(const char *disp_name, Ecore_X_Window parent,
return NULL;
}
ecore_x_icccm_hints_set(ee->prop.window,
1 /* accepts_focus */,
ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */,
0 /* icon_pixmap */,
0 /* icon_mask */,
0 /* icon_window */,
0 /* window_group */,
0 /* is_urgent */);
_ecore_evas_x_hints_update(ee);
_ecore_evas_x_group_leader_set(ee);
ecore_x_window_defaults_set(ee->prop.window);
_ecore_evas_x_protocols_set(ee);
@ -3895,14 +3937,7 @@ ecore_evas_software_x11_8_new(const char *disp_name, Ecore_X_Window parent,
return NULL;
}
ecore_x_icccm_hints_set(ee->prop.window,
1 /* accepts_focus */,
ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */,
0 /* icon_pixmap */,
0 /* icon_mask */,
0 /* icon_window */,
0 /* window_group */,
0 /* is_urgent */);
_ecore_evas_x_hints_update(ee);
_ecore_evas_x_group_leader_set(ee);
ecore_x_window_defaults_set(ee->prop.window);
_ecore_evas_x_protocols_set(ee);