dwm

Kris's build of dwm
git clone git clone https://git.krisyotam.com/krisyotam/dwm.git
Log | Files | Refs | README | LICENSE

focusmaster.c (873B)


      1 void
      2 focusmaster(const Arg *arg)
      3 {
      4 	Client *master;
      5 	Monitor *m = selmon;
      6 	#if FOCUSMASTER_RETURN_PATCH
      7 	int i;
      8 	#endif // FOCUSMASTER_RETURN_PATCH
      9 
     10 	if (m->nmaster < 1)
     11 		return;
     12 	#if !FAKEFULLSCREEN_PATCH
     13 	#if FAKEFULLSCREEN_CLIENT_PATCH
     14 	if (!m->sel || (m->sel->isfullscreen && m->sel->fakefullscreen != 1 && lockfullscreen))
     15 		return;
     16 	#else
     17 	if (!m->sel || (m->sel->isfullscreen && lockfullscreen))
     18 		return;
     19 	#endif // FAKEFULLSCREEN_CLIENT_PATCH
     20 	#endif // FAKEFULLSCREEN_PATCH
     21 
     22 	master = nexttiled(m->clients);
     23 
     24 	if (!master)
     25 		return;
     26 
     27 	#if FOCUSMASTER_RETURN_PATCH
     28 	for (i = 0; !(m->tagset[m->seltags] & 1 << i); i++);
     29 	i++;
     30 
     31 	if (m->sel == master) {
     32 		if (m->tagmarked[i] && ISVISIBLE(m->tagmarked[i]))
     33 			focus(m->tagmarked[i]);
     34 	} else {
     35 		m->tagmarked[i] = m->sel;
     36 		focus(master);
     37 	}
     38 	#else
     39 	focus(master);
     40 	#endif // FOCUSMASTER_RETURN_PATCH
     41 	restack(m);
     42 }