chiark / gitweb /
When setting focus on commodities, always use top left corner of table
[ypp-sc-tools.db-test.git] / pctb / pages.c
index 010299948d929d3f1ce247d683de11b900bb6697..ecec334e88d24ba51fbc1a29c5041441871a98e6 100644 (file)
@@ -52,6 +52,7 @@ static Display *disp;
 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;
@@ -497,7 +498,7 @@ static void set_focus_commodity(void) {
 
   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);
@@ -543,7 +544,7 @@ static void prepare_ypp_client(void) {
   wait_for_stability(&current,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();