diff --git a/src/modules/tiling/e_mod_config.c b/src/modules/tiling/e_mod_config.c index 7a6cf53c1..20b2d6d14 100644 --- a/src/modules/tiling/e_mod_config.c +++ b/src/modules/tiling/e_mod_config.c @@ -166,12 +166,12 @@ _basic_create_widgets(E_Config_Dialog *cfd __UNUSED__, /* General settings */ of = e_widget_framelist_add(evas, _("General"), 0); - e_widget_framelist_object_append(of, - e_widget_check_add(evas, _("Tile dialog windows as well"), - &cfdata->config.tile_dialogs)); e_widget_framelist_object_append(of, e_widget_check_add(evas, _("Show window titles"), &cfdata->config.show_titles)); + e_widget_framelist_object_append(of, + e_widget_check_add(evas, _("Tile dialog windows"), + &cfdata->config.tile_dialogs)); oc = e_widget_list_add(evas, false, true); e_widget_framelist_object_append(of, oc); diff --git a/src/modules/tiling/e_mod_tiling.c b/src/modules/tiling/e_mod_tiling.c index 5a07d1d13..e03a6d0d6 100644 --- a/src/modules/tiling/e_mod_tiling.c +++ b/src/modules/tiling/e_mod_tiling.c @@ -509,6 +509,7 @@ _remove_client(E_Client *ec) } EINA_LIST_REMOVE(_G.tinfo->floating_windows, ec); + EINA_LIST_REMOVE(_G.tinfo->sticky_windows, ec); _reapply_tree(); } @@ -813,18 +814,37 @@ _uniconify_hook(void *data __UNUSED__, int type __UNUSED__, E_Event_Client *even return true; } -static Eina_Bool -_stick_hook(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__) +static void +toggle_sticky(E_Client *ec) { - DBG("TODO"); - return true; + if (!ec) + return; + if (!desk_should_tile_check(ec->desk)) + return; + + if (EINA_LIST_IS_IN(_G.tinfo->sticky_windows, ec)) { + EINA_LIST_REMOVE(_G.tinfo->sticky_windows, ec); + + _add_client(ec); + } else { + _remove_client(ec); + _restore_client(ec); + EINA_LIST_APPEND(_G.tinfo->sticky_windows, ec); + } } static Eina_Bool -_unstick_hook(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__) +_stick_hook(void *data __UNUSED__, int type __UNUSED__, E_Event_Client *event) { - DBG("TODO"); - return true; + toggle_sticky(event->ec); + return true; +} + +static Eina_Bool +_unstick_hook(void *data __UNUSED__, int type __UNUSED__, E_Event_Client *event) +{ + toggle_sticky(event->ec); + return true; } static Eina_Bool diff --git a/src/modules/tiling/e_mod_tiling.h b/src/modules/tiling/e_mod_tiling.h index 2e9132cfb..e112a4d97 100644 --- a/src/modules/tiling/e_mod_tiling.h +++ b/src/modules/tiling/e_mod_tiling.h @@ -53,6 +53,8 @@ struct _Tiling_Info /* List of windows which were toggled floating */ Eina_List *floating_windows; + /* List of sticky windows. */ + Eina_List *sticky_windows; Window_Tree *tree; };