static struct timeval tv_startup;
static unsigned wwidth, wheight;
static int max_relevant_y= -1;
+static Point commod_focus_point;
static XImage *shmim;
static XShmSegmentInfo shminfo;
debugf("PAGING set_focus\n");
- mouse_1_updown(160,160);
+ mouse_1_updown(commod_focus_point.x, commod_focus_point.y);
sync_after_input();
delay(0.5);
debugf("PAGING raise_and_set_focus done.\n");
}
-static CanonImage *convert_page(Snapshot *sn) {
+static CanonImage *convert_page(const Snapshot *sn) {
CanonImage *im;
fwrite_ppmraw(screenshot_file, sn);
- unsigned char *pixel= sn->data;
+ const unsigned char *pixel= sn->data;
CANONICALISE_IMAGE(im, sn->w, sn->h, {
- rgb=
- (pixel[0] << 16) |
- (pixel[1] << 8) |
- (pixel[2] );
- pixel += 3;
+ r= *pixel++;
+ g= *pixel++;
+ b= *pixel++;
});
sysassert(!ferror(screenshot_file));
wait_for_stability(¤t,0,0, "checking current YPP client screen...");
test= convert_page(current);
- find_structure(test, &max_relevant_y);
+ find_structure(test, &max_relevant_y, &commod_focus_point);
check_correct_commodities();
Rect sunshine= find_sunshine_widget();