~ctwm/ctwm/trunk

320.1.6 by Matthew Fuller
Mechanical rename of twm.h to ctwm.h now that the name is cleared.
1
#include "ctwm.h"
20 by Claude Lecommandeur
CTWM version 3.6
2
#include "screen.h"
338.1.3 by Matthew Fuller
Make sure ctwm.h is at the top of our .h's for each file.
3
#include "clicktofocus.h"
523.1.11 by Matthew Fuller
Inagurate win_ops.c by moving the focus functions from util.c into it.
4
#include "win_ops.h"
338.1.3 by Matthew Fuller
Make sure ctwm.h is at the top of our .h's for each file.
5
492.2.45 by Matthew Fuller
static-ize this function, it's only used here.
6
static TwmWindow *get_last_window(WorkSpace *current)
20 by Claude Lecommandeur
CTWM version 3.6
7
{
304.1.2 by Matthew Fuller
Run 'make indent' to reindent the world.
8
	TwmWindow           *t;
9
	TwmWindow  *first = NULL;
10
11
	if(! current) {
12
		return NULL;
13
	}
14
15
	for(t = Scr->FirstWindow; t != NULL; t = t->next) {
492.2.75 by Matthew Fuller
Convert a bunch of boolean flags in the TwmWindow structure
16
		if(!first && !t->isiconmgr && OCCUPY(t, current) && t->mapped) {
304.1.2 by Matthew Fuller
Run 'make indent' to reindent the world.
17
			first = t;
18
		}
19
		if(t->hasfocusvisible && OCCUPY(t, current)) {
20
			return t;
21
		}
22
	}
23
24
	return first;
20 by Claude Lecommandeur
CTWM version 3.6
25
}
26
238 by Rhialto
Eliminated TwmWindow TwmRoot from struct ScreenInfo. Mostly a mechanical
27
void set_last_window(WorkSpace *current)
20 by Claude Lecommandeur
CTWM version 3.6
28
{
304.1.2 by Matthew Fuller
Run 'make indent' to reindent the world.
29
	TwmWindow *t;
30
31
	t = get_last_window(current);
32
33
	SetFocus(t, CurrentTime);
20 by Claude Lecommandeur
CTWM version 3.6
34
}