@since On Tue, Feb 28, 2012 at 7:43 AM, Enlightenment SVN <no-re...@enlightenment.org> wrote: > Log: > booyah. added lots of ecore_evas state stuff and ability to track > state changes too made by a wm - eg getting iconified. > > > > Author: raster > Date: 2012-02-27 22:43:59 -0800 (Mon, 27 Feb 2012) > New Revision: 68493 > Trac: http://trac.enlightenment.org/e/changeset/68493 > > Modified: > trunk/ecore/ChangeLog trunk/ecore/src/lib/ecore_evas/Ecore_Evas.h > trunk/ecore/src/lib/ecore_evas/ecore_evas.c > trunk/ecore/src/lib/ecore_evas/ecore_evas_buffer.c > trunk/ecore/src/lib/ecore_evas/ecore_evas_cocoa.c > trunk/ecore/src/lib/ecore_evas/ecore_evas_directfb.c > trunk/ecore/src/lib/ecore_evas/ecore_evas_ews.c > trunk/ecore/src/lib/ecore_evas/ecore_evas_extn.c > trunk/ecore/src/lib/ecore_evas/ecore_evas_fb.c > trunk/ecore/src/lib/ecore_evas/ecore_evas_private.h > trunk/ecore/src/lib/ecore_evas/ecore_evas_psl1ght.c > trunk/ecore/src/lib/ecore_evas/ecore_evas_sdl.c > trunk/ecore/src/lib/ecore_evas/ecore_evas_wayland_egl.c > trunk/ecore/src/lib/ecore_evas/ecore_evas_wayland_shm.c > trunk/ecore/src/lib/ecore_evas/ecore_evas_win32.c > trunk/ecore/src/lib/ecore_evas/ecore_evas_wince.c > trunk/ecore/src/lib/ecore_evas/ecore_evas_x.c > > Modified: trunk/ecore/ChangeLog > =================================================================== > --- trunk/ecore/ChangeLog 2012-02-28 06:31:25 UTC (rev 68492) > +++ trunk/ecore/ChangeLog 2012-02-28 06:43:59 UTC (rev 68493) > @@ -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() > > Modified: trunk/ecore/src/lib/ecore_evas/Ecore_Evas.h > =================================================================== > --- trunk/ecore/src/lib/ecore_evas/Ecore_Evas.h 2012-02-28 06:31:25 UTC (rev > 68492) > +++ trunk/ecore/src/lib/ecore_evas/Ecore_Evas.h 2012-02-28 06:43:59 UTC (rev > 68493) > @@ -401,6 +401,20 @@ > * @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 @@ > * 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); > > Modified: trunk/ecore/src/lib/ecore_evas/ecore_evas.c > =================================================================== > --- trunk/ecore/src/lib/ecore_evas/ecore_evas.c 2012-02-28 06:31:25 UTC (rev > 68492) > +++ trunk/ecore/src/lib/ecore_evas/ecore_evas.c 2012-02-28 06:43:59 UTC (rev > 68493) > @@ -1132,6 +1132,18 @@ > 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 > @@ -2101,6 +2113,162 @@ > } > > 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) > { > if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS)) > > Modified: trunk/ecore/src/lib/ecore_evas/ecore_evas_buffer.c > =================================================================== > --- trunk/ecore/src/lib/ecore_evas/ecore_evas_buffer.c 2012-02-28 06:31:25 > UTC (rev 68492) > +++ trunk/ecore/src/lib/ecore_evas/ecore_evas_buffer.c 2012-02-28 06:43:59 > UTC (rev 68493) > @@ -513,6 +513,13 @@ > _ecore_evas_buffer_alpha_set, > NULL, //transparent > > + NULL, > + NULL, > + NULL, > + NULL, > + NULL, > + NULL, > + > _ecore_evas_buffer_render, > NULL // screen_geometry_get > }; > > Modified: trunk/ecore/src/lib/ecore_evas/ecore_evas_cocoa.c > =================================================================== > --- trunk/ecore/src/lib/ecore_evas/ecore_evas_cocoa.c 2012-02-28 06:31:25 > UTC (rev 68492) > +++ trunk/ecore/src/lib/ecore_evas/ecore_evas_cocoa.c 2012-02-28 06:43:59 > UTC (rev 68493) > @@ -463,6 +463,14 @@ > NULL, > NULL, > NULL, //transparent > + > + NULL, > + NULL, > + NULL, > + NULL, > + NULL, > + NULL, > + > NULL, // render > NULL > }; > > Modified: trunk/ecore/src/lib/ecore_evas/ecore_evas_directfb.c > =================================================================== > --- trunk/ecore/src/lib/ecore_evas/ecore_evas_directfb.c 2012-02-28 > 06:31:25 UTC (rev 68492) > +++ trunk/ecore/src/lib/ecore_evas/ecore_evas_directfb.c 2012-02-28 > 06:43:59 UTC (rev 68493) > @@ -490,6 +490,13 @@ > NULL, /* alpha */ > NULL, //transparent > > + NULL, > + NULL, > + NULL, > + NULL, > + NULL, > + NULL, > + > NULL, // render > NULL // screen_geometry_get > }; > > Modified: trunk/ecore/src/lib/ecore_evas/ecore_evas_ews.c > =================================================================== > --- trunk/ecore/src/lib/ecore_evas/ecore_evas_ews.c 2012-02-28 06:31:25 > UTC (rev 68492) > +++ trunk/ecore/src/lib/ecore_evas/ecore_evas_ews.c 2012-02-28 06:43:59 > UTC (rev 68493) > @@ -683,6 +683,14 @@ > _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 > }; > > Modified: trunk/ecore/src/lib/ecore_evas/ecore_evas_extn.c > =================================================================== > --- trunk/ecore/src/lib/ecore_evas/ecore_evas_extn.c 2012-02-28 06:31:25 > UTC (rev 68492) > +++ trunk/ecore/src/lib/ecore_evas/ecore_evas_extn.c 2012-02-28 06:43:59 > UTC (rev 68493) > @@ -1104,6 +1104,13 @@ > NULL, > NULL, //transparent > > + NULL, > + NULL, > + NULL, > + NULL, > + NULL, > + NULL, > + > NULL, // render > NULL // screen_geometry_get > }; > @@ -1981,6 +1988,14 @@ > _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 > }; > > Modified: trunk/ecore/src/lib/ecore_evas/ecore_evas_fb.c > =================================================================== > --- trunk/ecore/src/lib/ecore_evas/ecore_evas_fb.c 2012-02-28 06:31:25 > UTC (rev 68492) > +++ trunk/ecore/src/lib/ecore_evas/ecore_evas_fb.c 2012-02-28 06:43:59 > UTC (rev 68493) > @@ -541,6 +541,13 @@ > NULL, > NULL, //transparent > > + NULL, > + NULL, > + NULL, > + NULL, > + NULL, > + NULL, > + > NULL, // render > NULL // screen_geometry_get > }; > > Modified: trunk/ecore/src/lib/ecore_evas/ecore_evas_private.h > =================================================================== > --- trunk/ecore/src/lib/ecore_evas/ecore_evas_private.h 2012-02-28 06:31:25 > UTC (rev 68492) > +++ trunk/ecore/src/lib/ecore_evas/ecore_evas_private.h 2012-02-28 06:43:59 > UTC (rev 68493) > @@ -178,6 +178,13 @@ > 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 @@ > 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 @@ > 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 @@ > 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; > > Modified: trunk/ecore/src/lib/ecore_evas/ecore_evas_psl1ght.c > =================================================================== > --- trunk/ecore/src/lib/ecore_evas/ecore_evas_psl1ght.c 2012-02-28 06:31:25 > UTC (rev 68492) > +++ trunk/ecore/src/lib/ecore_evas/ecore_evas_psl1ght.c 2012-02-28 06:43:59 > UTC (rev 68493) > @@ -396,6 +396,13 @@ > NULL, > NULL, //transparent > > + NULL, > + NULL, > + NULL, > + NULL, > + NULL, > + NULL, > + > NULL, // render > _ecore_evas_screen_geometry_get // screen_geometry_get > }; > > Modified: trunk/ecore/src/lib/ecore_evas/ecore_evas_sdl.c > =================================================================== > --- trunk/ecore/src/lib/ecore_evas/ecore_evas_sdl.c 2012-02-28 06:31:25 > UTC (rev 68492) > +++ trunk/ecore/src/lib/ecore_evas/ecore_evas_sdl.c 2012-02-28 06:43:59 > UTC (rev 68493) > @@ -433,6 +433,13 @@ > NULL, > NULL, //transparent > > + NULL, > + NULL, > + NULL, > + NULL, > + NULL, > + NULL, > + > NULL, // render > NULL // screen_geometry_get > }; > > Modified: trunk/ecore/src/lib/ecore_evas/ecore_evas_wayland_egl.c > =================================================================== > --- trunk/ecore/src/lib/ecore_evas/ecore_evas_wayland_egl.c 2012-02-28 > 06:31:25 UTC (rev 68492) > +++ trunk/ecore/src/lib/ecore_evas/ecore_evas_wayland_egl.c 2012-02-28 > 06:43:59 UTC (rev 68493) > @@ -152,6 +152,14 @@ > 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 > }; > > Modified: trunk/ecore/src/lib/ecore_evas/ecore_evas_wayland_shm.c > =================================================================== > --- trunk/ecore/src/lib/ecore_evas/ecore_evas_wayland_shm.c 2012-02-28 > 06:31:25 UTC (rev 68492) > +++ trunk/ecore/src/lib/ecore_evas/ecore_evas_wayland_shm.c 2012-02-28 > 06:43:59 UTC (rev 68493) > @@ -153,6 +153,14 @@ > 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 > }; > > Modified: trunk/ecore/src/lib/ecore_evas/ecore_evas_win32.c > =================================================================== > --- trunk/ecore/src/lib/ecore_evas/ecore_evas_win32.c 2012-02-28 06:31:25 > UTC (rev 68492) > +++ trunk/ecore/src/lib/ecore_evas/ecore_evas_win32.c 2012-02-28 06:43:59 > UTC (rev 68493) > @@ -982,6 +982,13 @@ > NULL, /* _ecore_evas_x_alpha_set */ > NULL, //transparent > > + NULL, > + NULL, > + NULL, > + NULL, > + NULL, > + NULL, > + > NULL, // render > NULL //screen_geometry_get > }; > > Modified: trunk/ecore/src/lib/ecore_evas/ecore_evas_wince.c > =================================================================== > --- trunk/ecore/src/lib/ecore_evas/ecore_evas_wince.c 2012-02-28 06:31:25 > UTC (rev 68492) > +++ trunk/ecore/src/lib/ecore_evas/ecore_evas_wince.c 2012-02-28 06:43:59 > UTC (rev 68493) > @@ -773,6 +773,13 @@ > NULL, /* _ecore_evas_x_alpha_set */ > NULL, //transparent > > + NULL, > + NULL, > + NULL, > + NULL, > + NULL, > + NULL, > + > NULL, // render > NULL // screen_geometry_get > }; > > Modified: trunk/ecore/src/lib/ecore_evas/ecore_evas_x.c > =================================================================== > --- trunk/ecore/src/lib/ecore_evas/ecore_evas_x.c 2012-02-28 06:31:25 > UTC (rev 68492) > +++ trunk/ecore/src/lib/ecore_evas/ecore_evas_x.c 2012-02-28 06:43:59 > UTC (rev 68493) > @@ -20,6 +20,22 @@ > 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) > { > leader_ref++; > @@ -537,6 +553,7 @@ > { > 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 @@ > { > 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 @@ > 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 @@ > 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 @@ > 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_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_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_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_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_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 @@ > #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 @@ > { > 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 @@ > 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 @@ > _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_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 @@ > // 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 @@ > 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 @@ > 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); > > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > enlightenment-svn mailing list > enlightenment-...@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-svn
------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel