[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdebase/workspace/libs/plasmagenericshell/scripting
From: Aaron J. Seigo <aseigo () kde ! org>
Date: 2010-11-19 2:27:32
Message-ID: 20101119022732.5922AAC8A0 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1198582 by aseigo:
number multiheadScreen
M +24 -0 appinterface.cpp
M +3 -0 appinterface.h
--- trunk/KDE/kdebase/workspace/libs/plasmagenericshell/scripting/appinterface.cpp #1198581:1198582
@@ -29,6 +29,11 @@
#include <Plasma/DataEngineManager>
#include <Plasma/Theme>
+#ifdef Q_WS_X11
+#include <X11/Xlib.h>
+#include <fixx11h.h>
+#endif
+
#include "scriptengine.h"
namespace WorkspaceScripting
@@ -112,6 +117,25 @@
return KGlobalSettings::isMultiHead();
}
+int AppInterface::multiheadScreen() const
+{
+ int id = -1;
+
+#ifdef Q_WS_X11
+ if (KGlobalSettings::isMultiHead()) {
+ // with multihead, we "lie" and say that screen 0 is the default screen, in fact, we pretend
+ // we have only one screen at all
+ Display *dpy = XOpenDisplay(NULL);
+ if (dpy) {
+ id = DefaultScreen(dpy);
+ XCloseDisplay(dpy);
+ }
+ }
+#endif
+
+ return id;
+}
+
void AppInterface::lockCorona(bool locked)
{
m_env->corona()->setImmutability(locked ? Plasma::UserImmutable : Plasma::Mutable);
--- trunk/KDE/kdebase/workspace/libs/plasmagenericshell/scripting/appinterface.h #1198581:1198582
@@ -53,6 +53,7 @@
Q_PROPERTY(QString platformVersion READ platformVersion)
Q_PROPERTY(int scriptingVersion READ scriptingVersion)
Q_PROPERTY(bool multihead READ multihead)
+ Q_PROPERTY(bool multiheadScreen READ multihead)
public:
AppInterface(ScriptEngine *env);
@@ -75,6 +76,8 @@
void setTheme(const QString &name);
bool multihead() const;
+ int multiheadScreen() const;
+
bool coronaLocked() const;
public Q_SLOTS:
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic