Skip to content

Commit

Permalink
remove offset part of --geometry
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tias committed Jun 14, 2011
1 parent 0651cc7 commit 5ae8c7c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
11 changes: 3 additions & 8 deletions src/gui/gui_x11.cpp
Expand Up @@ -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 );
}
Expand All @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/main_common.hpp
Expand Up @@ -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 <device name or id>] [--precalib <minx> <maxx> <miny> <maxy>] [--misclick <nr of pixels>] [--output-type <auto|xorg.conf.d|hal|xinput>] [--fake] [--geometry <w>x<h>+<x>+<y>]\n", cmd);
fprintf(stderr, "Usage: %s [-h|--help] [-v|--verbose] [--list] [--device <device name or id>] [--precalib <minx> <maxx> <miny> <maxy>] [--misclick <nr of pixels>] [--output-type <auto|xorg.conf.d|hal|xinput>] [--fake] [--geometry <w>x<h>]\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");
Expand All @@ -240,7 +240,7 @@ static void usage(char* cmd, unsigned thr_misclick)
thr_misclick);
fprintf(stderr, "\t--output-type <auto|xorg.conf.d|hal|xinput>: 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);
Expand Down Expand Up @@ -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 ?
Expand Down

0 comments on commit 5ae8c7c

Please sign in to comment.