public boolean grant_preference (Client client) {
    if (client.class_hint == null) return false;

    String id = client.class_hint.res + ":";
    Object value;


    // no focus
    if (pref.no_focus (id)) client.state = Puppet.NO_FOCUS;


    // register
    int keysym = '0' + pref.register (id);
    if (keysym >= '0') {
      int keycode = display.input.keysym_to_keycode (keysym);
      client.register = keycode - display.input.min_keycode;
      registers [client.register] = client;
    }


    int max_width = display.default_screen.width;
    int max_height = display.default_screen.height;


    // position      
    Rectangle r = pref.position (id);
    if (r != null) {
      // similar to geometry parameter processing in X toolkit
      r.x = (r.x + max_width) % max_width;
      r.y = (r.y + max_height) % max_height;
      client.move_resize (r);
      return true;		// user-specified position
    }


    return false;
  }