diff --git a/CMakeLists.txt b/CMakeLists.txt
index cebb12720c..c2b7cb7673 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -54,7 +54,6 @@ include_directories(BEFORE
${CMAKE_CURRENT_SOURCE_DIR}/libkdecorations
${CMAKE_CURRENT_SOURCE_DIR}/effects
${CMAKE_CURRENT_SOURCE_DIR}/tabbox
- ${KDEBASE_WORKSPACE_SOURCE_DIR}/libs/kephal
${KDEBASE_WORKSPACE_SOURCE_DIR}/libs/kworkspace
)
@@ -174,7 +173,7 @@ qt4_add_dbus_interface( kwin_KDEINIT_SRCS
qt4_add_resources( kwin_KDEINIT_SRCS resources.qrc )
-set(kwinLibs ${KDE4_KDEUI_LIBS} ${KDE4_PLASMA_LIBS} ${QT_QTDECLARATIVE_LIBRARY} kdeclarative kephal kworkspace kdecorations kwineffects ${X11_LIBRARIES} ${X11_Xrandr_LIB} ${X11_Xcomposite_LIB} ${X11_Xdamage_LIB} ${X11_Xrender_LIB} ${X11_Xfixes_LIB})
+set(kwinLibs ${KDE4_KDEUI_LIBS} ${KDE4_PLASMA_LIBS} ${QT_QTDECLARATIVE_LIBRARY} kdeclarative kworkspace kdecorations kwineffects ${X11_LIBRARIES} ${X11_Xrandr_LIB} ${X11_Xcomposite_LIB} ${X11_Xdamage_LIB} ${X11_Xrender_LIB} ${X11_Xfixes_LIB})
find_library(XF86VM_LIBRARY Xxf86vm)
if (XF86VM_LIBRARY)
diff --git a/effects/screenshot/screenshot.h b/effects/screenshot/screenshot.h
index f05d0ec19a..346501b919 100644
--- a/effects/screenshot/screenshot.h
+++ b/effects/screenshot/screenshot.h
@@ -55,7 +55,7 @@ public Q_SLOTS:
/**
* Saves a screenshot of the screen identified by @p screen into a file and returns the path to the file.
* Functionality requires hardware support, if not available a null string is returned.
- * @param screen Number of screen as numbered by kephal
+ * @param screen Number of screen as numbered by QDesktopWidget
* @returns Path to stored screenshot, or null string in failure case.
**/
Q_SCRIPTABLE QString screenshotScreen(int screen);
diff --git a/events.cpp b/events.cpp
index 30350aa26e..cb397b25b1 100644
--- a/events.cpp
+++ b/events.cpp
@@ -41,6 +41,7 @@ along with this program. If not, see .
#include
#include
+#include
#include
@@ -49,8 +50,6 @@ along with this program. If not, see .
#include
#include
-#include
-
namespace KWin
{
@@ -1323,14 +1322,14 @@ void Client::checkQuickTilingMaximizationZones(int xroot, int yroot)
{
QuickTileMode mode = QuickTileNone;
- foreach (Kephal::Screen * screen, Kephal::Screens::self()->screens()) {
+ for (int i=0; iscreenCount(); ++i) {
- const QRect &area = screen->geom();
+ const QRect &area = QApplication::desktop()->screenGeometry(i);
if (!area.contains(QPoint(xroot, yroot)))
continue;
if (options->electricBorderTiling()) {
- if (xroot <= screen->geom().x() + 20)
+ if (xroot <= area.x() + 20)
mode |= QuickTileLeft;
else if (xroot >= area.x() + area.width() - 20)
mode |= QuickTileRight;
diff --git a/geometry.cpp b/geometry.cpp
index 5c176b70ba..277de7cc3b 100644
--- a/geometry.cpp
+++ b/geometry.cpp
@@ -39,11 +39,11 @@ along with this program. If not, see .
#include "geometrytip.h"
#include "rules.h"
#include "effects.h"
+#include
#include
#include
#include
-#include
#include
#include "outline.h"
#ifdef KWIN_BUILD_TILING
@@ -65,7 +65,10 @@ extern bool is_multihead;
*/
void Workspace::desktopResized()
{
- QRect geom = Kephal::ScreenUtils::desktopGeometry();
+ QRect geom;
+ for (int i = 0; i < QApplication::desktop()->screenCount(); i++) {
+ geom |= QApplication::desktop()->screenGeometry(i);
+ }
NETSize desktop_geometry;
desktop_geometry.width = geom.width();
desktop_geometry.height = geom.height();
@@ -105,17 +108,20 @@ void Workspace::saveOldScreenSizes()
void Workspace::updateClientArea(bool force)
{
- int nscreens = Kephal::ScreenUtils::numScreens();
+ int nscreens = QApplication::desktop()->screenCount();
kDebug(1212) << "screens: " << nscreens << "desktops: " << numberOfDesktops();
QVector< QRect > new_wareas(numberOfDesktops() + 1);
QVector< StrutRects > new_rmoveareas(numberOfDesktops() + 1);
QVector< QVector< QRect > > new_sareas(numberOfDesktops() + 1);
QVector< QRect > screens(nscreens);
- QRect desktopArea = Kephal::ScreenUtils::desktopGeometry();
+ QRect desktopArea;
+ for (int i = 0; i < QApplication::desktop()->screenCount(); i++) {
+ desktopArea |= QApplication::desktop()->screenGeometry(i);
+ }
for (int iS = 0;
iS < nscreens;
iS ++) {
- screens [iS] = Kephal::ScreenUtils::screenGeometry(iS);
+ screens [iS] = QApplication::desktop()->screenGeometry(iS);
}
for (int i = 1;
i <= numberOfDesktops();
@@ -257,17 +263,17 @@ QRect Workspace::clientArea(clientAreaOption opt, int screen, int desktop) const
sarea = (!screenarea.isEmpty()
&& screen < screenarea[ desktop ].size()) // screens may be missing during KWin initialization or screen config changes
? screenarea[ desktop ][ screen_number ]
- : Kephal::ScreenUtils::screenGeometry(screen_number);
+ : QApplication::desktop()->screenGeometry(screen_number);
warea = workarea[ desktop ].isNull()
- ? Kephal::ScreenUtils::screenGeometry(screen_number)
+ ? QApplication::desktop()->screenGeometry(screen_number)
: workarea[ desktop ];
} else {
sarea = (!screenarea.isEmpty()
&& screen < screenarea[ desktop ].size()) // screens may be missing during KWin initialization or screen config changes
? screenarea[ desktop ][ screen ]
- : Kephal::ScreenUtils::screenGeometry(screen);
+ : QApplication::desktop()->screenGeometry(screen);
warea = workarea[ desktop ].isNull()
- ? Kephal::ScreenUtils::desktopGeometry()
+ ? QRect(0, 0, displayWidth(), displayHeight())
: workarea[ desktop ];
}
@@ -280,19 +286,16 @@ QRect Workspace::clientArea(clientAreaOption opt, int screen, int desktop) const
case MovementArea:
case ScreenArea:
if (is_multihead)
- return Kephal::ScreenUtils::screenGeometry(screen_number);
+ return QApplication::desktop()->screenGeometry(screen_number);
else
- return Kephal::ScreenUtils::screenGeometry(screen);
+ return QApplication::desktop()->screenGeometry(screen);
case WorkArea:
if (is_multihead)
return sarea;
else
return warea;
case FullArea:
- if (is_multihead)
- return Kephal::ScreenUtils::screenGeometry(screen_number);
- else
- return Kephal::ScreenUtils::desktopGeometry();
+ return QRect(0, 0, displayWidth(), displayHeight());
}
abort();
}
@@ -300,7 +303,7 @@ QRect Workspace::clientArea(clientAreaOption opt, int screen, int desktop) const
QRect Workspace::clientArea(clientAreaOption opt, const QPoint& p, int desktop) const
{
- int screen = Kephal::ScreenUtils::screenId(p);
+ int screen = QApplication::desktop()->screenNumber(p);
return clientArea(opt, screen, desktop);
}
@@ -876,7 +879,7 @@ QRect Client::adjustedClientArea(const QRect &desktopArea, const QRect& area) co
// HACK: workarea handling is not xinerama aware, so if this strut
// reserves place at a xinerama edge that's inside the virtual screen,
// ignore the strut for workspace setting.
- if (area == Kephal::ScreenUtils::desktopGeometry()) {
+ if (area == QRect(0, 0, displayWidth(), displayHeight())) {
if (stareaL.left() < screenarea.left())
stareaL = QRect();
if (stareaR.right() > screenarea.right())
@@ -1011,9 +1014,9 @@ bool Client::hasOffscreenXineramaStrut() const
region += strutRect(StrutAreaLeft);
// Remove all visible areas so that only the invisible remain
- int numScreens = Kephal::ScreenUtils::numScreens();
+ int numScreens = QApplication::desktop()->screenCount();
for (int i = 0; i < numScreens; i ++)
- region -= Kephal::ScreenUtils::screenGeometry(i);
+ region -= QApplication::desktop()->screenGeometry(i);
// If there's anything left then we have an offscreen strut
return !region.isEmpty();
@@ -2356,7 +2359,7 @@ void Client::setFullScreen(bool set, bool user)
void Client::updateFullscreenMonitors(NETFullscreenMonitors topology)
{
- int nscreens = Kephal::ScreenUtils::numScreens();
+ int nscreens = QApplication::desktop()->screenCount();
// kDebug( 1212 ) << "incoming request with top: " << topology.top << " bottom: " << topology.bottom
// << " left: " << topology.left << " right: " << topology.right
@@ -2384,10 +2387,10 @@ QRect Client::fullscreenMonitorsArea(NETFullscreenMonitors requestedTopology) co
{
QRect top, bottom, left, right, total;
- top = Kephal::ScreenUtils::screenGeometry(requestedTopology.top);
- bottom = Kephal::ScreenUtils::screenGeometry(requestedTopology.bottom);
- left = Kephal::ScreenUtils::screenGeometry(requestedTopology.left);
- right = Kephal::ScreenUtils::screenGeometry(requestedTopology.right);
+ top = QApplication::desktop()->screenGeometry(requestedTopology.top);
+ bottom = QApplication::desktop()->screenGeometry(requestedTopology.bottom);
+ left = QApplication::desktop()->screenGeometry(requestedTopology.left);
+ right = QApplication::desktop()->screenGeometry(requestedTopology.right);
total = top.united(bottom.united(left.united(right)));
// kDebug( 1212 ) << "top: " << top << " bottom: " << bottom
@@ -3142,12 +3145,12 @@ void Client::setQuickTileMode(QuickTileMode mode, bool keyboard)
// If trying to tile to the side that the window is already tiled to move the window to the next
// screen if it exists, otherwise ignore the request to prevent corrupting geom_pretile.
if (quick_tile_mode == mode) {
- const int numScreens = Kephal::ScreenUtils::numScreens();
+ const int numScreens = QApplication::desktop()->screenCount();
const int curScreen = screen();
int nextScreen = curScreen;
QVarLengthArray screens(numScreens);
for (int i = 0; i < numScreens; ++i) // Cache
- screens[i] = Kephal::ScreenUtils::screenGeometry(i);
+ screens[i] = QApplication::desktop()->screenGeometry(i);
for (int i = 0; i < numScreens; ++i) {
if (i == curScreen)
continue;
diff --git a/kcmkwin/kwinoptions/CMakeLists.txt b/kcmkwin/kwinoptions/CMakeLists.txt
index 319ab47efd..41a52b77ea 100644
--- a/kcmkwin/kwinoptions/CMakeLists.txt
+++ b/kcmkwin/kwinoptions/CMakeLists.txt
@@ -2,7 +2,7 @@
set(kcm_kwinoptions_PART_SRCS windows.cpp mouse.cpp main.cpp )
kde4_add_plugin(kcm_kwinoptions ${kcm_kwinoptions_PART_SRCS})
-target_link_libraries(kcm_kwinoptions ${KDE4_KDEUI_LIBS} kephal)
+target_link_libraries(kcm_kwinoptions ${KDE4_KDEUI_LIBS})
install(TARGETS kcm_kwinoptions DESTINATION ${PLUGIN_INSTALL_DIR} )
diff --git a/kcmkwin/kwinoptions/windows.cpp b/kcmkwin/kwinoptions/windows.cpp
index 30c94c0ae1..81eb3e927c 100644
--- a/kcmkwin/kwinoptions/windows.cpp
+++ b/kcmkwin/kwinoptions/windows.cpp
@@ -30,6 +30,7 @@
#include
#include
#include
+#include
#include
#include
@@ -43,8 +44,6 @@
#include "windows.h"
-#include
-
// kwin config keywords
#define KWIN_FOCUS "FocusPolicy"
#define KWIN_PLACEMENT "Placement"
@@ -253,7 +252,7 @@ KFocusConfig::KFocusConfig(bool _standAlone, KConfig *_config, const KComponentD
activeMouseScreen->setWhatsThis(wtstr);
connect(focusCombo, SIGNAL(activated(int)), this, SLOT(updateActiveMouseScreen()));
- if (Kephal::ScreenUtils::numScreens() == 1) { // No Ximerama
+ if (QApplication::desktop()->screenCount() == 1) { // No Ximerama
separateScreenFocus->hide();
activeMouseScreen->hide();
}
diff --git a/kcmkwin/kwintabbox/CMakeLists.txt b/kcmkwin/kwintabbox/CMakeLists.txt
index 42c0a009d1..122f6fa01d 100644
--- a/kcmkwin/kwintabbox/CMakeLists.txt
+++ b/kcmkwin/kwintabbox/CMakeLists.txt
@@ -19,7 +19,7 @@ kde4_add_ui_files( kcm_kwintabbox_PART_SRCS main.ui )
kde4_add_plugin(kcm_kwintabbox ${kcm_kwintabbox_PART_SRCS})
-target_link_libraries(kcm_kwintabbox ${KDE4_KDEUI_LIBS} ${KDE4_KCMUTILS_LIBS} ${KDE4_PLASMA_LIBS} ${X11_LIBRARIES} kephal ${QT_QTDECLARATIVE_LIBRARY} kdeclarative)
+target_link_libraries(kcm_kwintabbox ${KDE4_KDEUI_LIBS} ${KDE4_KCMUTILS_LIBS} ${KDE4_PLASMA_LIBS} ${X11_LIBRARIES} ${QT_QTDECLARATIVE_LIBRARY} kdeclarative)
install(TARGETS kcm_kwintabbox DESTINATION ${PLUGIN_INSTALL_DIR} )
diff --git a/libkdecorations/CMakeLists.txt b/libkdecorations/CMakeLists.txt
index 739698e6f6..aae3c8bfc1 100644
--- a/libkdecorations/CMakeLists.txt
+++ b/libkdecorations/CMakeLists.txt
@@ -9,7 +9,7 @@ set(kdecorations_LIB_SRCS
kde4_add_library(kdecorations SHARED ${kdecorations_LIB_SRCS})
-target_link_libraries(kdecorations ${KDE4_KDEUI_LIBS} kephal)
+target_link_libraries(kdecorations ${KDE4_KDEUI_LIBS})
target_link_libraries(kdecorations LINK_INTERFACE_LIBRARIES ${KDE4_KDEUI_LIBS})
set_target_properties(kdecorations PROPERTIES
diff --git a/libkdecorations/kcommondecoration.cpp b/libkdecorations/kcommondecoration.cpp
index 02a33e916c..13a4c491d3 100644
--- a/libkdecorations/kcommondecoration.cpp
+++ b/libkdecorations/kcommondecoration.cpp
@@ -39,8 +39,6 @@
#include "kdecorationfactory.h"
#include
-#include
-
#include "kcommondecoration.moc"
/** @addtogroup kdecoration */
diff --git a/libkwineffects/CMakeLists.txt b/libkwineffects/CMakeLists.txt
index 9cd2a6b186..1394a4ff73 100644
--- a/libkwineffects/CMakeLists.txt
+++ b/libkwineffects/CMakeLists.txt
@@ -11,7 +11,7 @@ set(kwin_EFFECTSLIB_SRCS
kde4_add_library(kwineffects SHARED ${kwin_EFFECTSLIB_SRCS})
target_link_libraries(kwineffects ${KDE4_KDEUI_LIBS} ${QT_QTGUI_LIBRARY}
- ${X11_LIBRARIES} kephal
+ ${X11_LIBRARIES}
${X11_Xrender_LIB}
${X11_Xrandr_LIB}
${X11_Xcomposite_LIB}
@@ -33,7 +33,7 @@ set(kwin_GLUTILSLIB_SRCS
macro( KWIN4_ADD_GLUTILS_BACKEND name glinclude )
include_directories(${glinclude})
kde4_add_library(${name} SHARED ${kwin_GLUTILSLIB_SRCS})
- target_link_libraries(${name} ${KDE4_KDEUI_LIBS} ${QT_QTGUI_LIBRARY} ${X11_LIBRARIES} kephal kwineffects)
+ target_link_libraries(${name} ${KDE4_KDEUI_LIBS} ${QT_QTGUI_LIBRARY} ${X11_LIBRARIES} kwineffects)
set_target_properties(${name} PROPERTIES VERSION 1.0.0 SOVERSION 1 )
target_link_libraries(${name} ${ARGN})
target_link_libraries(${name} LINK_INTERFACE_LIBRARIES ${ARGN})
diff --git a/options.cpp b/options.cpp
index 10a11ce49f..a250e79139 100644
--- a/options.cpp
+++ b/options.cpp
@@ -39,8 +39,6 @@ along with this program. If not, see .
#include "compositingprefs.h"
#include
-#include
-
#include
#ifndef KWIN_HAVE_OPENGLES
#ifndef KWIN_NO_XF86VM
diff --git a/scene.cpp b/scene.cpp
index 4e69121387..450402e93f 100644
--- a/scene.cpp
+++ b/scene.cpp
@@ -83,7 +83,6 @@ along with this program. If not, see .
#include "overlaywindow.h"
#include "shadow.h"
-#include
#include "thumbnailitem.h"
namespace KWin
diff --git a/screenedge.cpp b/screenedge.cpp
index 1b08dbce75..858b823e57 100644
--- a/screenedge.cpp
+++ b/screenedge.cpp
@@ -42,9 +42,6 @@ along with this program. If not, see .
#include
#include
-// KDE-Workspace
-#include
-
namespace KWin {
ScreenEdge::ScreenEdge()
@@ -73,7 +70,7 @@ void ScreenEdge::update(bool force)
m_screenEdgeTimeLast = xTime();
m_screenEdgeTimeLastTrigger = xTime();
m_currentScreenEdge = ElectricNone;
- QRect r = Kephal::ScreenUtils::desktopGeometry();
+ QRect r = QRect(0, 0, displayWidth(), displayHeight());
m_screenEdgeTop = r.top();
m_screenEdgeBottom = r.bottom();
m_screenEdgeLeft = r.left();
@@ -120,7 +117,7 @@ void ScreenEdge::restoreSize(ElectricBorder border)
{
if (m_screenEdgeWindows[border] == None)
return;
- QRect r = Kephal::ScreenUtils::desktopGeometry();
+ QRect r(0, 0, displayWidth(), displayHeight());
int xywh[ELECTRIC_COUNT][4] = {
{ r.left() + 1, r.top(), r.width() - 2, 1 }, // Top
{ r.right(), r.top(), 1, 1 }, // Top-right
diff --git a/tabbox/declarative.cpp b/tabbox/declarative.cpp
index c8abf6036c..da67055ee5 100644
--- a/tabbox/declarative.cpp
+++ b/tabbox/declarative.cpp
@@ -25,6 +25,7 @@ along with this program. If not, see .
#include
#include
#include
+#include
#include
#include
#include
@@ -39,7 +40,6 @@ along with this program. If not, see .
#include
#include
#include
-#include
// KWin
#include "thumbnailitem.h"
#include
@@ -160,7 +160,7 @@ void DeclarativeView::showEvent(QShowEvent *event)
}
#endif
updateQmlSource();
- m_currentScreenGeometry = Kephal::ScreenUtils::screenGeometry(tabBox->activeScreen());
+ m_currentScreenGeometry = QApplication::desktop()->screenGeometry(tabBox->activeScreen());
rootObject()->setProperty("screenWidth", m_currentScreenGeometry.width());
rootObject()->setProperty("screenHeight", m_currentScreenGeometry.height());
rootObject()->setProperty("allDesktops", tabBox->config().tabBoxMode() == TabBoxConfig::ClientTabBox &&
diff --git a/workspace.cpp b/workspace.cpp
index 0396dbe97c..b5c801403d 100644
--- a/workspace.cpp
+++ b/workspace.cpp
@@ -29,6 +29,7 @@ along with this program. If not, see .
#include
#include
#include
+#include
#include
#include
#include
@@ -78,8 +79,6 @@ along with this program. If not, see .
#include
#include
-#include
-
namespace KWin
{
@@ -241,10 +240,8 @@ Workspace::Workspace(bool restore)
init();
- connect(Kephal::Screens::self(), SIGNAL(screenAdded(Kephal::Screen*)), &screenChangedTimer, SLOT(start()));
- connect(Kephal::Screens::self(), SIGNAL(screenRemoved(int)), &screenChangedTimer, SLOT(start()));
- connect(Kephal::Screens::self(), SIGNAL(screenResized(Kephal::Screen*,QSize,QSize)), &screenChangedTimer, SLOT(start()));
- connect(Kephal::Screens::self(), SIGNAL(screenMoved(Kephal::Screen*,QPoint,QPoint)), &screenChangedTimer, SLOT(start()));
+ connect(QApplication::desktop(), SIGNAL(screenCountChanged(int)), &screenChangedTimer, SLOT(start()));
+ connect(QApplication::desktop(), SIGNAL(resized(int)), &screenChangedTimer, SLOT(start()));
#ifdef KWIN_BUILD_ACTIVITIES
connect(&activityController_, SIGNAL(currentActivityChanged(QString)), SLOT(updateCurrentActivity(QString)));
@@ -441,7 +438,10 @@ void Workspace::init()
NETPoint* viewports = new NETPoint[numberOfDesktops()];
rootInfo->setDesktopViewport(numberOfDesktops(), *viewports);
delete[] viewports;
- QRect geom = Kephal::ScreenUtils::desktopGeometry();
+ QRect geom;
+ for (int i = 0; i < QApplication::desktop()->screenCount(); i++) {
+ geom |= QApplication::desktop()->screenGeometry(i);
+ }
NETSize desktop_geometry;
desktop_geometry.width = geom.width();
desktop_geometry.height = geom.height();
@@ -1658,7 +1658,7 @@ void Workspace::toggleClientOnActivity(Client* c, const QString &activity, bool
int Workspace::numScreens() const
{
- return Kephal::ScreenUtils::numScreens();
+ return QApplication::desktop()->screenCount();
}
int Workspace::activeScreen() const
@@ -1668,7 +1668,7 @@ int Workspace::activeScreen() const
return activeClient()->screen();
return active_screen;
}
- return Kephal::ScreenUtils::screenId(cursorPos());
+ return QApplication::desktop()->screenNumber(cursorPos());
}
/**
@@ -1689,17 +1689,17 @@ void Workspace::checkActiveScreen(const Client* c)
*/
void Workspace::setActiveScreenMouse(const QPoint& mousepos)
{
- active_screen = Kephal::ScreenUtils::screenId(mousepos);
+ active_screen = QApplication::desktop()->screenNumber(mousepos);
}
QRect Workspace::screenGeometry(int screen) const
{
- return Kephal::ScreenUtils::screenGeometry(screen);
+ return QApplication::desktop()->screenGeometry(screen);
}
int Workspace::screenNumber(const QPoint& pos) const
{
- return Kephal::ScreenUtils::screenId(pos);
+ return QApplication::desktop()->screenNumber(pos);
}
void Workspace::sendClientToScreen(Client* c, int screen)