dwm.c
changeset 1271 c5ea09e8d2fc
parent 1270 262ee84a2fdb
child 1273 10c33b081850
equal deleted inserted replaced
1270:262ee84a2fdb 1271:c5ea09e8d2fc
   313 	XButtonPressedEvent *ev = &e->xbutton;
   313 	XButtonPressedEvent *ev = &e->xbutton;
   314 
   314 
   315 	click = ClkRootWin;
   315 	click = ClkRootWin;
   316 	if(ev->window == barwin) {
   316 	if(ev->window == barwin) {
   317 		x = 0;
   317 		x = 0;
   318 		for(i = 0; i < LENGTH(tags) && ev->x >= x; i++) {
   318 		for(i = 0; i < LENGTH(tags) && ev->x >= x; i++)
   319 			x += TEXTW(tags[i]);
   319 			x += TEXTW(tags[i]);
   320 			if(i < LENGTH(tags) || ev->x <= x)
   320 		if(i < LENGTH(tags) || ev->x <= x)
   321 				click = i - 1;
   321 			click = i - 1;
   322 			else if(ev->x < x + blw)
   322 		else if(ev->x < x + blw)
   323 				click = ClkLtSymbol;
   323 			click = ClkLtSymbol;
   324 			else if(ev->x > wx + ww - TEXTW(stext))
   324 		else if(ev->x > wx + ww - TEXTW(stext))
   325 				click = ClkStatusText;
   325 			click = ClkStatusText;
   326 			else
   326 		else
   327 				click = ClkWinTitle;
   327 			click = ClkWinTitle;
   328 		}
       
   329 	}
   328 	}
   330 	else if((c = getclient(ev->window)))
   329 	else if((c = getclient(ev->window)))
   331 		click = ClkClientWin;
   330 		click = ClkClientWin;
   332 
   331 
   333 	for(i = 0; i < LENGTH(buttons); i++)
   332 	for(i = 0; i < LENGTH(buttons); i++)
   334 		if(click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button && CLEANMASK(buttons[i].mask) == CLEANMASK(ev->state))
   333 		if(click == buttons[i].click && buttons[i].func && buttons[i].button == ev->button
       
   334 		   && CLEANMASK(buttons[i].mask) == CLEANMASK(ev->state))
   335 			buttons[i].func(&buttons[i].arg);
   335 			buttons[i].func(&buttons[i].arg);
   336 }
   336 }
   337 
   337 
   338 void
   338 void
   339 checkotherwm(void) {
   339 checkotherwm(void) {
  1644 }
  1644 }
  1645 
  1645 
  1646 void
  1646 void
  1647 view(const Arg *arg) {
  1647 view(const Arg *arg) {
  1648 	seltags ^= 1; /* toggle sel tagset */
  1648 	seltags ^= 1; /* toggle sel tagset */
  1649 	if(arg && (arg->ui & TAGMASK) && (arg->ui & TAGMASK) != tagset[seltags ^ 1])
  1649 	if(arg && (arg->ui & TAGMASK))
  1650 		tagset[seltags] = arg->i & TAGMASK;
  1650 		tagset[seltags] = arg->i & TAGMASK;
  1651 	arrange();
  1651 	arrange();
  1652 }
  1652 }
  1653 
  1653 
  1654 /* There's no way to check accesses to destroyed windows, thus those cases are
  1654 /* There's no way to check accesses to destroyed windows, thus those cases are