move toggle floating function to layout.c and fix problem when moving with mouse tiled windows

This commit is contained in:
Julien Danjou 2008-01-07 13:38:26 +01:00
parent 8877aae6c9
commit a1205efc20
5 changed files with 27 additions and 24 deletions

View File

@ -258,4 +258,29 @@ uicb_tag_setlayout(int screen, char *arg)
saveawesomeprops(screen);
}
/** Toggle floating state of a client
* \param screen Screen ID
* \param arg unused
* \ingroup ui_callback
*/
void
uicb_client_togglefloating(int screen, char *arg)
{
Client *sel = globalconf.focus->client;
if(!sel)
return;
if((sel->isfloating = !sel->isfloating))
{
if(!arg)
client_resize(sel, sel->f_geometry, False);
}
else if(sel->ismax)
client_resize(sel, sel->m_geometry, False);
client_saveprops(sel);
arrange(screen);
}
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80

View File

@ -43,6 +43,7 @@ void saveawesomeprops(int);
Uicb uicb_client_focusnext;
Uicb uicb_client_focusprev;
Uicb uicb_tag_setlayout;
Uicb uicb_client_togglefloating;
#endif
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80

View File

@ -56,7 +56,7 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused)))
if((curtags[0]->layout->arrange != layout_floating)
&& !c->isfloating)
uicb_client_togglefloating(screen, NULL);
uicb_client_togglefloating(screen, (char *) "be nice");
else
restack(screen);

22
tag.c
View File

@ -210,28 +210,6 @@ uicb_client_tag(int screen, char *arg)
arrange(screen);
}
/** Toggle floating state of a client
* \param screen Screen ID
* \param arg unused
* \ingroup ui_callback
*/
void
uicb_client_togglefloating(int screen, char *arg __attribute__((unused)))
{
Client *sel = globalconf.focus->client;
if(!sel)
return;
if((sel->isfloating = !sel->isfloating))
client_resize(sel, sel->f_geometry, False);
else if(sel->ismax)
client_resize(sel, sel->m_geometry, False);
client_saveprops(sel);
arrange(screen);
}
/** Toggle a tag on client
* \param screen Screen ID
* \param arg Tag name

1
tag.h
View File

@ -36,7 +36,6 @@ void tag_client_with_rules(Client *);
void tag_view(int, int);
Uicb uicb_client_tag;
Uicb uicb_client_togglefloating;
Uicb uicb_client_toggletag;
Uicb uicb_tag_toggleview;
Uicb uicb_tag_view;