Tiling2: Added untested support for sticky windows.

Just don't tile them.
This commit is contained in:
Tom Hacohen 2014-01-16 11:59:42 +00:00
parent 8ab30821fb
commit bfdb22b0b8
3 changed files with 32 additions and 10 deletions

View File

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

View File

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

View File

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