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);
|
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
|
// 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_focusnext;
|
||||||
Uicb uicb_client_focusprev;
|
Uicb uicb_client_focusprev;
|
||||||
Uicb uicb_tag_setlayout;
|
Uicb uicb_tag_setlayout;
|
||||||
|
Uicb uicb_client_togglefloating;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80
|
// 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)
|
if((curtags[0]->layout->arrange != layout_floating)
|
||||||
&& !c->isfloating)
|
&& !c->isfloating)
|
||||||
uicb_client_togglefloating(screen, NULL);
|
uicb_client_togglefloating(screen, (char *) "be nice");
|
||||||
else
|
else
|
||||||
restack(screen);
|
restack(screen);
|
||||||
|
|
||||||
|
|
22
tag.c
22
tag.c
|
@ -210,28 +210,6 @@ uicb_client_tag(int screen, char *arg)
|
||||||
arrange(screen);
|
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
|
/** Toggle a tag on client
|
||||||
* \param screen Screen ID
|
* \param screen Screen ID
|
||||||
* \param arg Tag name
|
* \param arg Tag name
|
||||||
|
|
1
tag.h
1
tag.h
|
@ -36,7 +36,6 @@ void tag_client_with_rules(Client *);
|
||||||
void tag_view(int, int);
|
void tag_view(int, int);
|
||||||
|
|
||||||
Uicb uicb_client_tag;
|
Uicb uicb_client_tag;
|
||||||
Uicb uicb_client_togglefloating;
|
|
||||||
Uicb uicb_client_toggletag;
|
Uicb uicb_client_toggletag;
|
||||||
Uicb uicb_tag_toggleview;
|
Uicb uicb_tag_toggleview;
|
||||||
Uicb uicb_tag_view;
|
Uicb uicb_tag_view;
|
||||||
|
|
Loading…
Reference in New Issue