change global focus policy, not focus
On Thu, Nov 21, 2013 at 7:26 AM, Sebastian Dransfeld <s...@tango.flipp.net>wrote: > englebass pushed a commit to branch master. > > > http://git.enlightenment.org/core/enlightenment.git/commit/?id=d739ed0e2ecd8eab1bdf4d30b5fd40faba4c0533 > > commit d739ed0e2ecd8eab1bdf4d30b5fd40faba4c0533 > Author: Sebastian Dransfeld <s...@tango.flipp.net> > Date: Thu Nov 21 13:24:46 2013 +0100 > > handle desktop applications better > > Fixes T201 > --- > src/bin/e_border.c | 18 ++++++++++++++++++ > src/bin/e_border.h | 1 + > src/bin/e_focus.c | 14 +++++++------- > 3 files changed, 26 insertions(+), 7 deletions(-) > > diff --git a/src/bin/e_border.c b/src/bin/e_border.c > index 19b49ff..462c8e0 100644 > --- a/src/bin/e_border.c > +++ b/src/bin/e_border.c > @@ -420,6 +420,7 @@ e_border_new(E_Container *con, Ecore_X_Window win, int > first_map, int internal) > ecore_x_window_shadow_tree_flush(); > e_object_del_func_set(E_OBJECT(bd), > E_OBJECT_CLEANUP_FUNC(_e_border_del)); > > + bd->focus_policy = e_config->focus_policy; > bd->w = 1; > bd->h = 1; > /* FIXME: ewww - round trip */ > @@ -7281,6 +7282,21 @@ _e_border_eval0(E_Border *bd) > bd->client.netwm.update.state = 1; > } > } > + else if (bd->client.netwm.type == ECORE_X_WINDOW_TYPE_DESKTOP) > + { > + bd->focus_policy = E_FOCUS_CLICK; > + e_focus_setup(bd); > + if (!bd->client.netwm.state.skip_pager) > + { > + bd->client.netwm.state.skip_pager = 1; > + bd->client.netwm.update.state = 1; > + } > + if (!bd->client.netwm.state.skip_taskbar) > + { > + bd->client.netwm.state.skip_taskbar = 1; > + bd->client.netwm.update.state = 1; > + } > + } > bd->client.netwm.fetch.type = 0; > } > if (bd->client.icccm.fetch.machine) > @@ -8115,6 +8131,8 @@ _e_border_eval0(E_Border *bd) > bordername = bd->bordername; > else if ((bd->client.mwm.borderless) || (bd->borderless)) > bordername = "borderless"; > + else if (bd->client.netwm.type == ECORE_X_WINDOW_TYPE_DESKTOP) > + bordername = "borderless"; > else if (((bd->client.icccm.transient_for != 0) || > (bd->client.netwm.type == ECORE_X_WINDOW_TYPE_DIALOG)) > && > (bd->client.icccm.min_w == bd->client.icccm.max_w) && > diff --git a/src/bin/e_border.h b/src/bin/e_border.h > index 33babaf..0b28fe7 100644 > --- a/src/bin/e_border.h > +++ b/src/bin/e_border.h > @@ -667,6 +667,7 @@ struct _E_Border > Eina_Bool argb; > > int tmp_input_hidden; > + int focus_policy; > }; > > struct _E_Border_Pending_Move_Resize > diff --git a/src/bin/e_focus.c b/src/bin/e_focus.c > index 28fb473..3a45779 100644 > --- a/src/bin/e_focus.c > +++ b/src/bin/e_focus.c > @@ -27,8 +27,8 @@ e_focus_idler_before(void) > EAPI void > e_focus_event_mouse_in(E_Border *bd) > { > - if ((e_config->focus_policy == E_FOCUS_MOUSE) || > - (e_config->focus_policy == E_FOCUS_SLOPPY)) > + if ((bd->focus_policy == E_FOCUS_MOUSE) || > + (bd->focus_policy == E_FOCUS_SLOPPY)) > { > e_border_focus_set(bd, 1, 1); > } > @@ -49,7 +49,7 @@ e_focus_event_mouse_in(E_Border *bd) > EAPI void > e_focus_event_mouse_out(E_Border *bd) > { > - if (e_config->focus_policy == E_FOCUS_MOUSE) > + if (bd->focus_policy == E_FOCUS_MOUSE) > { > if (!bd->lock_focus_in) > { > @@ -65,7 +65,7 @@ e_focus_event_mouse_down(E_Border *bd) > { > if (!bd->focused) > { > - if (e_config->focus_policy == E_FOCUS_CLICK) > + if (bd->focus_policy == E_FOCUS_CLICK) > e_border_focus_set(bd, 1, 1); > else if (e_config->always_click_to_focus) > e_border_focus_set(bd, 1, 1); > @@ -85,7 +85,7 @@ e_focus_event_mouse_up(E_Border *bd __UNUSED__) > EAPI void > e_focus_event_focus_in(E_Border *bd) > { > - if ((e_config->focus_policy == E_FOCUS_CLICK) && > + if ((bd->focus_policy == E_FOCUS_CLICK) && > (!e_config->always_click_to_raise) && > (!e_config->always_click_to_focus)) > { > @@ -104,7 +104,7 @@ e_focus_event_focus_in(E_Border *bd) > EAPI void > e_focus_event_focus_out(E_Border *bd) > { > - if ((e_config->focus_policy == E_FOCUS_CLICK) && > + if ((bd->focus_policy == E_FOCUS_CLICK) && > (!e_config->always_click_to_raise) && > (!e_config->always_click_to_focus)) > { > @@ -128,7 +128,7 @@ e_focus_event_focus_out(E_Border *bd) > EAPI void > e_focus_setup(E_Border *bd) > { > - if ((e_config->focus_policy == E_FOCUS_CLICK) || > + if ((bd->focus_policy == E_FOCUS_CLICK) || > (e_config->always_click_to_raise) || > (e_config->always_click_to_focus)) > { > > -- > > > ------------------------------------------------------------------------------ Shape the Mobile Experience: Free Subscription Software experts and developers: Be at the forefront of tech innovation. Intel(R) Software Adrenaline delivers strategic insight and game-changing conversations that shape the rapidly evolving mobile landscape. Sign up now. http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel