Example #1
0
File: focus.c Project: Cougar/pwm
static bool try_focus(WThing *next)
{
	if(WTHING_IS(next, WTHING_WINOBJ) &&
	   !WTHING_IS_UNFOCUSABLE(next) &&
	   on_current_workspace((WWinObj*)next)){
		do_set_focus(next);
		return TRUE;
	}
	
	return FALSE;
}
Example #2
0
void do_switch_workspace(int num)
{
	dodo_switch_workspace(num);

	if(wglobal.current_winobj==NULL ||
	   !on_current_workspace(wglobal.current_winobj)){
		if(circulate(1)==NULL){
			do_set_focus((WThing*)SCREEN);
			wglobal.current_winobj=NULL;
		}
	}
}
Example #3
0
void mainloop()
{
	XEvent ev;
	
	for(;;){
		get_event(&ev);
		handle_event(&ev);
		
		XSync(wglobal.dpy, False);

		if(wglobal.focus_next!=NULL){
			kill_focusenter_events();
			do_set_focus(wglobal.focus_next);
			wglobal.focus_next=NULL;
		}
	}
}
Example #4
0
File: focus.c Project: Cougar/pwm
void set_focus_weak(WThing *thing)
{
	if(wglobal.focus_next==NULL)
		do_set_focus(thing);
}