Репозитории ALT
5.1: | 3.5.10-alt20.M51.2 |
4.1: | 3.5.10-alt16.M41.1 |
4.0: | 3.5.9-alt1.M40.1 |
3.0: | 3.4.1-alt12 |
+updates: | 3.4.1-alt12.1.M30 |
+backports: | 3.5.6-alt7.0.M30 |
Группа :: Графические оболочки/KDE
Пакет: kdebase
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: rotate-wacom-pointers.diff
Скачать
Скачать
Index: kcontrol/randr/randr.cpp
===================================================================
--- kcontrol/randr/randr.cpp (revision 622289)
+++ kcontrol/randr/randr.cpp (working copy)
@@ -28,6 +28,8 @@
#include <dcopclient.h>
#include <kipc.h>
#include <kactivelabel.h>
+#include <kprocess.h>
+#include <kstandarddirs.h>
#include "ktimerdialog.h"
@@ -120,12 +122,55 @@
m_currentSize = m_proposedSize;
m_currentRotation = m_proposedRotation;
m_currentRefreshRate = m_proposedRefreshRate;
+
+ // search wacom utility and set orientation for available wacom pointers
+ QString xsetwacom = KStandardDirs::findExe("xsetwacom");
+ if (!xsetwacom.isEmpty()) {
+ m_wacomPointers.clear();
+ KProcess *proc = new KProcess;
+ connect(proc, SIGNAL(receivedStdout(KProcess *, char *, int)), SLOT(gotAvailablePointers(KProcess *, char *, int)));
+ *proc << "xsetwacom" << "list";
+ if (!proc->start(KProcess::Block,KProcess::Stdout))
+ kdError("Could not ask xsetwacom for available pointers.");
+ else {
+ for ( QStringList::Iterator it = m_wacomPointers.begin(); it != m_wacomPointers.end(); ++it ) {
+ KProcess *set = new KProcess;
+ *set << "xsetwacom" << "set" << (*it) << "rotate";
+ switch (m_currentRotation) {
+ case RR_Rotate_90:
+ *set << "2";
+ break;
+ case RR_Rotate_180:
+ *set << "3";
+ break;
+ case RR_Rotate_270:
+ *set << "1";
+ break;
+ default:
+ *set << "0";
+ }
+ if (!set->start())
+ kdError("Could not set orientation for wacom pointers.");
+ }
+ }
+ }
+
return true;
}
return false;
}
+void RandRScreen::gotAvailablePointers(KProcess*, char *buffer, int len)
+{
+ QString myBuf = QString::fromLatin1(buffer, len);
+ QStringList lines = QStringList::split('\n', myBuf);
+ for ( QStringList::Iterator it = lines.begin(); it != lines.end(); it++) {
+ QStringList split = QStringList::split(' ', (*it));
+ m_wacomPointers+=split.first();
+ }
+}
+
bool RandRScreen::applyProposedAndConfirm()
{
if (proposedChanged()) {
Index: kcontrol/randr/randr.h
===================================================================
--- kcontrol/randr/randr.h (revision 622289)
+++ kcontrol/randr/randr.h (working copy)
@@ -28,6 +28,7 @@
class KTimerDialog;
class RandRScreenPrivate;
+class KProcess;
class RandRScreen : public QObject
{
@@ -170,11 +171,14 @@
int m_proposedSize;
int m_proposedRefreshRate;
+ QStringList m_wacomPointers;
+
KTimerDialog* m_shownDialog;
private slots:
void desktopResized();
void shownDialogDestroyed();
+ void gotAvailablePointers(KProcess*, char *buffer, int len);
};
typedef QPtrList<RandRScreen> ScreenList;