I planned to post an article about the state of Compiz Fusion today. It is not finished yet because instead of just complaining I actually fixed a couple of issues I have had with it:
-
040-decorator.patch
This patch implements metacity-like raising and lowering of windows by pressing the left or middle mouse button on a window’s decoration. Useful if you don’t use raise-on-click or auto-raise.
References: Ubuntu bug, OpenCompositing bug -
041-shadow_offset.patch
This patches makes the shadow x/y offset settings work, they had no effect up to now. The patch also pushes the upper limit for the shadow radius to 48.0 because that is what the decorator can handle.
References: Ubuntu bug, OpenCompositing bug -
042-smart_placement.patch
This patch fixes the client size calculation for smart window placement. Without this fix smart placement insists on keeping about 17 pixels of free space on the right viewport edge.
References: Ubuntu bug, OpenCompositing bug
All patches are for Ubuntu’s current compiz packages for Hardy Heron.
As for my original plan, I will post the Compiz article on the weekend!
#include
#define KLEUR 2
#define POS 2
#define NCELLS (KLEUR * POS)
#define NREPS 4
#define NTRIALS (NCELLS * NREPS)
#define NOEF 5
#define NMAP 2
struct {
int ppn;
enum { GL, GR } map;
enum { GROEN, ROOD } kleur;
enum { LINKS, RECHTS } pos;
enum { GEEN, LB, RB } xr, r;
enum { FOUT, GOED } corr;
int rt, re;
} data[NTRIALS];
void initializeer()
{
int i;
for (i = 0; i < NTRIALS; i++) {
data[i].ppn = -1;
data[i].map = -1;
data[i].kleur = -1;
data[i].pos = -1;
data[i].xr = -1;
data[i].r = -1;
data[i].corr = -1;
data[i].rt = -1;
data[i].re = -1;
}
}
void schrijf()
{
int i;
for (i = 0; i < NTRIALS; i++) {
printf(“%d “, data[i].ppn);
printf(“%d “, data[i].map);
printf(“\t”);
printf(“%02d “, i);
printf(“%d “, data[i].kleur);
printf(“%d “, data[i].pos);
printf(“\t”);
printf(“%d “, data[i].xr);
printf(“%d “, data[i].r);
printf(“%d “, data[i].corr);
printf(“\t”);
printf(“%4d “, data[i].rt);
printf(“%4d “, data[i].re);
printf(“\n”);
}
}
#ifndef RND_C
int main()
{
initializeer();
schrijf();
return 0;
}
END_OF_MAIN();
#endif
i’m sorry, that wasn’t wright. T-scope is important
#include
//#define TESTRND
#define TR 2 // richting target
#define FR 2 // richting flanker
#define KLEUR 2 // kleur flanker
#define NCELLS (TR*FR*KLEUR)
#define NREP 2
#define NTRIALS (NCELLS*NREP)
#define NOEF 4
#define NMAP 2
struct {
int ppn, half;
enum { COMP, INCOMP } map1, map;
enum { LINKS, RECHTS } target, flanker;
enum { WIT, GRIJS } kleur;
enum { GEEN, LB, RB } xr, r;
enum { FOUT, JUIST } corr;
int rt, re;
} data[NTRIALS];
// ———————————————————————–
void randomiseer(int ppnr, int half)
{
int i, rnd[NTRIALS];
if (0) {
ts_rlist(NCELLS, NREP, rnd);
} else {
for (i = 0; i < NTRIALS; i++)
rnd[i] = i % NCELLS;
}
for (i = 0; i < NTRIALS; i++) {
data[i].ppn = ppnr;
data[i].half = half;
data[i].map1 = ppnr % NMAP;
if (half == 0)
data[i].map = data[i].map1;
else
data[i].map = !data[i].map1;
int tmp = rnd[i];
data[i].target = tmp % TR;
tmp = tmp / TR;
data[i].flanker = tmp % FR;
tmp = tmp / FR;
data[i].kleur = tmp % KLEUR;
if (data[i].map == COMP) {
if (data[i].target == LINKS)
data[i].xr = LB;
else
data[i].xr = RB;
} else {
if (data[i].target == LINKS)
data[i].xr = RB;
else
data[i].xr = LB;
}
}
}
void initialiseer()
{
int i;
for (i = 0; i < NTRIALS; i++) {
data[i].ppn = -1;
data[i].half = -1;
data[i].map1 = -1;
data[i].map = -1;
data[i].target = -1;
data[i].flanker = -1;
data[i].kleur = -1;
data[i].xr = -1;
data[i].r = -1;
data[i].corr = -1;
data[i].rt = -1;
data[i].re = -1;
}
}
void schrijf()
{
int i;
for (i = 0; i < NTRIALS; i++) {
printf(“%02d “, data[i].ppn);
printf(“%d “, data[i].half);
printf(“%d “, data[i].map1);
printf(“%d “, data[i].map);
printf(“%d “, data[i].target);
printf(“%d “, data[i].flanker);
printf(“%d “, data[i].kleur);
printf(“%d “, data[i].xr);
printf(“%d “, data[i].r);
printf(“%d “, data[i].corr);
printf(“%d “, data[i].rt);
printf(“%d “, data[i].re);
printf(“\n”);
}
}
#ifdef TESTRND
int main()
{
int i;
for (i = 0; i < NMAP; i++) {
initialiseer();
randomiseer(i, 0);
schrijf();
initialiseer();
randomiseer(i, 1);
schrijf();
}
return 0;
}
END_OF_MAIN();
#endif
// ———————————————————————–
#define FIX mtt(500)
#define BLANK mtt(500)
#define MAXRT mtt(1200)
#define ITI mtt(1000)
struct {
__int64 junk;
__int64 t1, e1;
__int64 t2, e2;
} tmp;
#define SIZE 5
#define DIST 20
void pijl(int rich, int pos)
{
int x[3], y[3];
if (rich == LINKS) {
x[0] = SIZE + pos * DIST;
x[1] = SIZE + pos * DIST;
x[2] = -SIZE + pos * DIST;
} else {
x[0] = -SIZE + pos * DIST;
x[1] = -SIZE + pos * DIST;
x[2] = SIZE + pos * DIST;
}
y[0] = SIZE;
y[1] = -SIZE;
y[2] = 0;
ts_triangle(x[0], y[0], x[1], y[1], x[2], y[2]);
}
void trial(int i)
{
// fixatie
ts_vsync(&tmp.junk, &tmp.junk);
ts_clrscr();
ts_printf_centre(0, 0, “+”);
ts_wait(FIX);
// blank
ts_vsync(&tmp.junk, &tmp.junk);
ts_clrscr();
ts_wait(BLANK);
// target en flanker
ts_tobuff();
ts_clrbuff();
pijl(data[i].target, 0);
if (data[i].kleur == GRIJS)
ts_fgcolor(GREY50);
pijl(data[i].flanker, -1);
pijl(data[i].flanker, 1);
ts_fgcolor(WHITE);
ts_vsync(&tmp.t1, &tmp.e1);
ts_blitbuff();
ts_toscr();
// respons verwerken
data[i].r = ts_resp(&tmp.t2, &tmp.e2, MAXRT);
ts_clrscr();
if (data[i].r == 3) {
schrijf();
ts_fatal(“escaped”);
}
if (data[i].r == data[i].xr)
data[i].corr = JUIST;
else
data[i].corr = FOUT;
data[i].rt = ttm(tmp.t2 – tmp.t1);
data[i].re = ttmu(tmp.e2 + tmp.e1);
// iti
ts_wait(ITI);
}
void instructies(char *fase)
{
// instructies
ts_printf_centre(0, ay(.5), fase);
if (data[0].map == COMP)
ts_printf_centre(0, 0, “compatibel”);
else
ts_printf_centre(0, 0, “incompatibel”);
ts_button(0, -ay(.5));
ts_clrscr();
}
#ifndef TESTRND
int main()
{
// responsknoppen klaarmaken
ts_defkey(M1);
ts_defkey(M2);
ts_defkey(KEY_ESC);
// buffer aanzetten
ts_doublebuff(ON);
//ts_priority(HIGH);
int i;
// oefenfase 0
initialiseer();
randomiseer(0, 0);
instructies(“oefenfase”);
for (i = 0; i < NOEF; i++)
trial(i);
// exp fase 0
initialiseer();
randomiseer(0, 0);
instructies(“experimentele fase”);
for (i = 0; i < NTRIALS; i++)
trial(i);
schrijf();
// oefenfase 1
initialiseer();
randomiseer(0, 1);
instructies(“oefenfase”);
for (i = 0; i < NOEF; i++)
trial(i);
// exp fase 1
initialiseer();
randomiseer(0, 1);
instructies(“experimentele fase”);
for (i = 0; i < NTRIALS; i++)
trial(i);
schrijf();
// gedaan
ts_printf_centre(0, 0, “gedaan”);
ts_button(0, -ay(.5));
return 0;
}
END_OF_MAIN();
#endif
It’s not that hard!
#include <tscope.h>
[…]
haha, i even typed “wright”. It must have been late.
So long, Frank Lloyd Wright..
:D
I tend to make mistakes like that too when I’m tired…
buy!