Пример #1
0
void CursorTheme::setCursorName(qulonglong cursor, const QString &name) const
{
#ifdef HAVE_XFIXES

    if (haveXfixes())
    {
        XFixesSetCursorName(QX11Info::display(), cursor,
                            QFile::encodeName(name));
    }
#endif
}
Пример #2
0
bool applyTheme (const XCursorThemeData &theme) {
  // Require the Xcursor version that shipped with X11R6.9 or greater, since
  // in previous versions the Xfixes code wasn't enabled due to a bug in the
  // build system (freedesktop bug #975).
  if (!haveXfixes()) return false;

  QByteArray themeName = QFile::encodeName(theme.name());

  // Set up the proper launch environment for newly started apps
  //k8:!!!:KToolInvocation::klauncher()->setLaunchEnv("XCURSOR_THEME", themeName);

  // Update the Xcursor X resources
  //k8:!!!:runRdb(0);

  // Reload the standard cursors
  QStringList names;
  // Qt cursors
  names << "left_ptr"       << "up_arrow"      << "cross"      << "wait"
        << "left_ptr_watch" << "ibeam"         << "size_ver"   << "size_hor"
        << "size_bdiag"     << "size_fdiag"    << "size_all"   << "split_v"
        << "split_h"        << "pointing_hand" << "openhand"
        << "closedhand"     << "forbidden"     << "whats_this";
  // X core cursors
  names << "X_cursor"            << "right_ptr"           << "hand1"
        << "hand2"               << "watch"               << "xterm"
        << "crosshair"           << "left_ptr_watch"      << "center_ptr"
        << "sb_h_double_arrow"   << "sb_v_double_arrow"   << "fleur"
        << "top_left_corner"     << "top_side"            << "top_right_corner"
        << "right_side"          << "bottom_right_corner" << "bottom_side"
        << "bottom_left_corner"  << "left_side"           << "question_arrow"
        << "pirate";

  //QX11Info x11Info;
  foreach (const QString &name, names) {
    QCursor cursor = theme.loadCursor(name);
    XFixesChangeCursorByName(QX11Info::display(), cursor.handle(), QFile::encodeName(name));
  }