move toggle floating function to layout.c and fix problem when moving with mouse tiled windows
This commit is contained in:
parent
8877aae6c9
commit
a1205efc20
25
layout.c
25
layout.c
|
@ -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
|
||||
|
|
1
layout.h
1
layout.h
|
@ -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
|
||||
|
|
2
mouse.c
2
mouse.c
|
@ -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
22
tag.c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue