Fix handling of the -geometry option. Author: Gautam Iyer, see http://bugs.gentoo.org/214353 diff -ruN xkbd-0.8.15/src/xkbd.c xkbd-0.8.15-new/src/xkbd.c --- xkbd-0.8.15/src/xkbd.c 2003-09-29 10:29:35.000000000 -0700 +++ xkbd-0.8.15-new/src/xkbd.c 2008-03-23 02:43:20.000000000 -0700 @@ -307,19 +307,20 @@ 0, BlackPixel(display, screen_num), WhitePixel(display, screen_num)); + wret = DisplayWidth(display, screen_num); + hret = DisplayHeight(display, screen_num)/4; + xret = 0; + yret = DisplayHeight(display, screen_num) - hret; + if (geometry != NULL) { - XParseGeometry(geometry, &xret, &yret, &wret, &hret ); - } - else - { - if (wm_type != WM_MATCHBOX) - { - wret = DisplayWidth(display, screen_num); - hret = DisplayHeight(display, screen_num)/4; - xret = 0; - yret = DisplayHeight(display, screen_num) - hret; - } + int flags; + + flags = XParseGeometry(geometry, &xret, &yret, &wret, &hret ); + if( flags & XNegative ) + xret += DisplayWidth( display, screen_num ) - wret; + if( flags & YNegative ) + yret += DisplayHeight( display, screen_num ) - hret; } /* check for user selected keyboard conf file */