From 5ae8c7ccd589399cb6db57f6c0ee6b5be305d8a9 Mon Sep 17 00:00:00 2001 From: Tias Guns Date: Tue, 14 Jun 2011 10:22:32 +0200 Subject: [PATCH] remove offset part of --geometry the offset part is untested and possibly insufficient (should recalibrate only part of the range?) if somebody needs this and can test it, revert this patch and submit it --- src/gui/gui_x11.cpp | 11 +++-------- src/main_common.hpp | 6 +++--- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/gui/gui_x11.cpp b/src/gui/gui_x11.cpp index bbd5137..f245065 100644 --- a/src/gui/gui_x11.cpp +++ b/src/gui/gui_x11.cpp @@ -144,18 +144,13 @@ GuiCalibratorX11::GuiCalibratorX11(Calibrator* calibrator0) DisplayHeight(display, screen_num)); #endif - // window offsets - int gx = 0; - int gy = 0; - // parse geometry string const char* geo = calibrator->get_geometry(); if (geo != NULL) { int gw,gh; - int res = sscanf(geo,"%dx%d+%d+%d",&gw,&gh,&gx,&gy); - if (res != 4) { + int res = sscanf(geo,"%dx%d",&gw,&gh); + if (res != 2) { fprintf(stderr,"Warning: error parsing geometry string - using defaults.\n"); - gx = gy = 0; } else { set_display_size( gw, gh ); } @@ -167,7 +162,7 @@ GuiCalibratorX11::GuiCalibratorX11(Calibrator* calibrator0) attributes.event_mask = ExposureMask | KeyPressMask | ButtonPressMask; win = XCreateWindow(display, RootWindow(display, screen_num), - gx, gy, display_width, display_height, 0, + 0, 0, display_width, display_height, 0, CopyFromParent, InputOutput, CopyFromParent, CWOverrideRedirect | CWEventMask, &attributes); diff --git a/src/main_common.hpp b/src/main_common.hpp index 9460ae2..a3d25d6 100644 --- a/src/main_common.hpp +++ b/src/main_common.hpp @@ -230,7 +230,7 @@ int find_device(const char* pre_device, bool verbose, bool list_devices, static void usage(char* cmd, unsigned thr_misclick) { - fprintf(stderr, "Usage: %s [-h|--help] [-v|--verbose] [--list] [--device ] [--precalib ] [--misclick ] [--output-type ] [--fake] [--geometry x++]\n", cmd); + fprintf(stderr, "Usage: %s [-h|--help] [-v|--verbose] [--list] [--device ] [--precalib ] [--misclick ] [--output-type ] [--fake] [--geometry x]\n", cmd); fprintf(stderr, "\t-h, --help: print this help message\n"); fprintf(stderr, "\t-v, --verbose: print debug messages during the process\n"); fprintf(stderr, "\t--list: list calibratable input devices and quit\n"); @@ -240,7 +240,7 @@ static void usage(char* cmd, unsigned thr_misclick) thr_misclick); fprintf(stderr, "\t--output-type : type of config to ouput (auto=automatically detect, default: auto)\n"); fprintf(stderr, "\t--fake: emulate a fake device (for testing purposes)\n"); - fprintf(stderr, "\t--geometry: manually provide the geometry for the calibration window\n"); + fprintf(stderr, "\t--geometry: manually provide the geometry (width and height) for the calibration window\n"); } Calibrator* main_common(int argc, char** argv); @@ -341,7 +341,7 @@ Calibrator* main_common(int argc, char** argv) // specify window geometry? if (strcmp("--geometry", argv[i]) == 0) { geometry = argv[++i]; - //sscanf(argv[++i],"%dx%d+%d+%d",&win_width,&win_height,&win_xoff,&win_yoff); + //sscanf(argv[++i],"%dx%d",&win_width,&win_height); } else // Fake calibratable device ?