Пример #1
0
unsigned long SyncSourceConfig::getBeginSyncTime() {
    bool err;
    long ret = getLongProperty(PROPERTY_SYNC_BEGIN, &err);
    if (err || ret < 0) {
        ret = 0;
    }
    return (unsigned long) ret;
}
// return true if the active GUI window is on the whitelist
bool KeyboardPriority::checkForKeyboardPriority()
{
  window_ = RootWindow(display, screen_);
  window_ = getLongProperty("_NET_ACTIVE_WINDOW");

  // Compare the name of the active window to the white list
  std::string window_with_focus(reinterpret_cast<char*>( getStringProperty("WM_CLASS") ));
  for (int i=0; i<keyboard_whitelist_.size(); ++i)
  {
    if ( window_with_focus.find( keyboard_whitelist_[i] ) != std::string::npos )
      return true;
  }
  // Otherwise this app should ignore the keyboard commands

  return false;
}