Drop kephal dependency from KWin

Kephal has turned into not being more than a wrapper around
QDesktopWidget and does not even provide syntax sugar.

REVIEW: 104427
This commit is contained in:
Martin Gräßlin 2012-03-27 19:14:53 +02:00
parent a0c6f70a0e
commit 27643f5a9e
15 changed files with 58 additions and 66 deletions

View file

@ -54,7 +54,6 @@ include_directories(BEFORE
${CMAKE_CURRENT_SOURCE_DIR}/libkdecorations ${CMAKE_CURRENT_SOURCE_DIR}/libkdecorations
${CMAKE_CURRENT_SOURCE_DIR}/effects ${CMAKE_CURRENT_SOURCE_DIR}/effects
${CMAKE_CURRENT_SOURCE_DIR}/tabbox ${CMAKE_CURRENT_SOURCE_DIR}/tabbox
${KDEBASE_WORKSPACE_SOURCE_DIR}/libs/kephal
${KDEBASE_WORKSPACE_SOURCE_DIR}/libs/kworkspace ${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 ) 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) find_library(XF86VM_LIBRARY Xxf86vm)
if (XF86VM_LIBRARY) if (XF86VM_LIBRARY)

View file

@ -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. * 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. * 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. * @returns Path to stored screenshot, or null string in failure case.
**/ **/
Q_SCRIPTABLE QString screenshotScreen(int screen); Q_SCRIPTABLE QString screenshotScreen(int screen);

View file

@ -41,6 +41,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QWhatsThis> #include <QWhatsThis>
#include <QApplication> #include <QApplication>
#include <QtGui/QDesktopWidget>
#include <kkeyserver.h> #include <kkeyserver.h>
@ -49,8 +50,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <X11/Xatom.h> #include <X11/Xatom.h>
#include <QX11Info> #include <QX11Info>
#include <kephal/screens.h>
namespace KWin namespace KWin
{ {
@ -1323,14 +1322,14 @@ void Client::checkQuickTilingMaximizationZones(int xroot, int yroot)
{ {
QuickTileMode mode = QuickTileNone; QuickTileMode mode = QuickTileNone;
foreach (Kephal::Screen * screen, Kephal::Screens::self()->screens()) { for (int i=0; i<QApplication::desktop()->screenCount(); ++i) {
const QRect &area = screen->geom(); const QRect &area = QApplication::desktop()->screenGeometry(i);
if (!area.contains(QPoint(xroot, yroot))) if (!area.contains(QPoint(xroot, yroot)))
continue; continue;
if (options->electricBorderTiling()) { if (options->electricBorderTiling()) {
if (xroot <= screen->geom().x() + 20) if (xroot <= area.x() + 20)
mode |= QuickTileLeft; mode |= QuickTileLeft;
else if (xroot >= area.x() + area.width() - 20) else if (xroot >= area.x() + area.width() - 20)
mode |= QuickTileRight; mode |= QuickTileRight;

View file

@ -39,11 +39,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "geometrytip.h" #include "geometrytip.h"
#include "rules.h" #include "rules.h"
#include "effects.h" #include "effects.h"
#include <QtGui/QDesktopWidget>
#include <QPainter> #include <QPainter>
#include <QVarLengthArray> #include <QVarLengthArray>
#include <QX11Info> #include <QX11Info>
#include <kephal/screens.h>
#include <KDE/KGlobalSettings> #include <KDE/KGlobalSettings>
#include "outline.h" #include "outline.h"
#ifdef KWIN_BUILD_TILING #ifdef KWIN_BUILD_TILING
@ -65,7 +65,10 @@ extern bool is_multihead;
*/ */
void Workspace::desktopResized() 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; NETSize desktop_geometry;
desktop_geometry.width = geom.width(); desktop_geometry.width = geom.width();
desktop_geometry.height = geom.height(); desktop_geometry.height = geom.height();
@ -105,17 +108,20 @@ void Workspace::saveOldScreenSizes()
void Workspace::updateClientArea(bool force) void Workspace::updateClientArea(bool force)
{ {
int nscreens = Kephal::ScreenUtils::numScreens(); int nscreens = QApplication::desktop()->screenCount();
kDebug(1212) << "screens: " << nscreens << "desktops: " << numberOfDesktops(); kDebug(1212) << "screens: " << nscreens << "desktops: " << numberOfDesktops();
QVector< QRect > new_wareas(numberOfDesktops() + 1); QVector< QRect > new_wareas(numberOfDesktops() + 1);
QVector< StrutRects > new_rmoveareas(numberOfDesktops() + 1); QVector< StrutRects > new_rmoveareas(numberOfDesktops() + 1);
QVector< QVector< QRect > > new_sareas(numberOfDesktops() + 1); QVector< QVector< QRect > > new_sareas(numberOfDesktops() + 1);
QVector< QRect > screens(nscreens); 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; for (int iS = 0;
iS < nscreens; iS < nscreens;
iS ++) { iS ++) {
screens [iS] = Kephal::ScreenUtils::screenGeometry(iS); screens [iS] = QApplication::desktop()->screenGeometry(iS);
} }
for (int i = 1; for (int i = 1;
i <= numberOfDesktops(); i <= numberOfDesktops();
@ -257,17 +263,17 @@ QRect Workspace::clientArea(clientAreaOption opt, int screen, int desktop) const
sarea = (!screenarea.isEmpty() sarea = (!screenarea.isEmpty()
&& screen < screenarea[ desktop ].size()) // screens may be missing during KWin initialization or screen config changes && screen < screenarea[ desktop ].size()) // screens may be missing during KWin initialization or screen config changes
? screenarea[ desktop ][ screen_number ] ? screenarea[ desktop ][ screen_number ]
: Kephal::ScreenUtils::screenGeometry(screen_number); : QApplication::desktop()->screenGeometry(screen_number);
warea = workarea[ desktop ].isNull() warea = workarea[ desktop ].isNull()
? Kephal::ScreenUtils::screenGeometry(screen_number) ? QApplication::desktop()->screenGeometry(screen_number)
: workarea[ desktop ]; : workarea[ desktop ];
} else { } else {
sarea = (!screenarea.isEmpty() sarea = (!screenarea.isEmpty()
&& screen < screenarea[ desktop ].size()) // screens may be missing during KWin initialization or screen config changes && screen < screenarea[ desktop ].size()) // screens may be missing during KWin initialization or screen config changes
? screenarea[ desktop ][ screen ] ? screenarea[ desktop ][ screen ]
: Kephal::ScreenUtils::screenGeometry(screen); : QApplication::desktop()->screenGeometry(screen);
warea = workarea[ desktop ].isNull() warea = workarea[ desktop ].isNull()
? Kephal::ScreenUtils::desktopGeometry() ? QRect(0, 0, displayWidth(), displayHeight())
: workarea[ desktop ]; : workarea[ desktop ];
} }
@ -280,19 +286,16 @@ QRect Workspace::clientArea(clientAreaOption opt, int screen, int desktop) const
case MovementArea: case MovementArea:
case ScreenArea: case ScreenArea:
if (is_multihead) if (is_multihead)
return Kephal::ScreenUtils::screenGeometry(screen_number); return QApplication::desktop()->screenGeometry(screen_number);
else else
return Kephal::ScreenUtils::screenGeometry(screen); return QApplication::desktop()->screenGeometry(screen);
case WorkArea: case WorkArea:
if (is_multihead) if (is_multihead)
return sarea; return sarea;
else else
return warea; return warea;
case FullArea: case FullArea:
if (is_multihead) return QRect(0, 0, displayWidth(), displayHeight());
return Kephal::ScreenUtils::screenGeometry(screen_number);
else
return Kephal::ScreenUtils::desktopGeometry();
} }
abort(); 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 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); 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 // HACK: workarea handling is not xinerama aware, so if this strut
// reserves place at a xinerama edge that's inside the virtual screen, // reserves place at a xinerama edge that's inside the virtual screen,
// ignore the strut for workspace setting. // ignore the strut for workspace setting.
if (area == Kephal::ScreenUtils::desktopGeometry()) { if (area == QRect(0, 0, displayWidth(), displayHeight())) {
if (stareaL.left() < screenarea.left()) if (stareaL.left() < screenarea.left())
stareaL = QRect(); stareaL = QRect();
if (stareaR.right() > screenarea.right()) if (stareaR.right() > screenarea.right())
@ -1011,9 +1014,9 @@ bool Client::hasOffscreenXineramaStrut() const
region += strutRect(StrutAreaLeft); region += strutRect(StrutAreaLeft);
// Remove all visible areas so that only the invisible remain // 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 ++) 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 // If there's anything left then we have an offscreen strut
return !region.isEmpty(); return !region.isEmpty();
@ -2356,7 +2359,7 @@ void Client::setFullScreen(bool set, bool user)
void Client::updateFullscreenMonitors(NETFullscreenMonitors topology) 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 // kDebug( 1212 ) << "incoming request with top: " << topology.top << " bottom: " << topology.bottom
// << " left: " << topology.left << " right: " << topology.right // << " left: " << topology.left << " right: " << topology.right
@ -2384,10 +2387,10 @@ QRect Client::fullscreenMonitorsArea(NETFullscreenMonitors requestedTopology) co
{ {
QRect top, bottom, left, right, total; QRect top, bottom, left, right, total;
top = Kephal::ScreenUtils::screenGeometry(requestedTopology.top); top = QApplication::desktop()->screenGeometry(requestedTopology.top);
bottom = Kephal::ScreenUtils::screenGeometry(requestedTopology.bottom); bottom = QApplication::desktop()->screenGeometry(requestedTopology.bottom);
left = Kephal::ScreenUtils::screenGeometry(requestedTopology.left); left = QApplication::desktop()->screenGeometry(requestedTopology.left);
right = Kephal::ScreenUtils::screenGeometry(requestedTopology.right); right = QApplication::desktop()->screenGeometry(requestedTopology.right);
total = top.united(bottom.united(left.united(right))); total = top.united(bottom.united(left.united(right)));
// kDebug( 1212 ) << "top: " << top << " bottom: " << bottom // 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 // 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. // screen if it exists, otherwise ignore the request to prevent corrupting geom_pretile.
if (quick_tile_mode == mode) { if (quick_tile_mode == mode) {
const int numScreens = Kephal::ScreenUtils::numScreens(); const int numScreens = QApplication::desktop()->screenCount();
const int curScreen = screen(); const int curScreen = screen();
int nextScreen = curScreen; int nextScreen = curScreen;
QVarLengthArray<QRect> screens(numScreens); QVarLengthArray<QRect> screens(numScreens);
for (int i = 0; i < numScreens; ++i) // Cache 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) { for (int i = 0; i < numScreens; ++i) {
if (i == curScreen) if (i == curScreen)
continue; continue;

View file

@ -2,7 +2,7 @@
set(kcm_kwinoptions_PART_SRCS windows.cpp mouse.cpp main.cpp ) set(kcm_kwinoptions_PART_SRCS windows.cpp mouse.cpp main.cpp )
kde4_add_plugin(kcm_kwinoptions ${kcm_kwinoptions_PART_SRCS}) 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} ) install(TARGETS kcm_kwinoptions DESTINATION ${PLUGIN_INSTALL_DIR} )

View file

@ -30,6 +30,7 @@
#include <KComboBox> #include <KComboBox>
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QFormLayout> #include <QFormLayout>
#include <QtGui/QDesktopWidget>
#include <QtDBus/QtDBus> #include <QtDBus/QtDBus>
#include <KButtonGroup> #include <KButtonGroup>
@ -43,8 +44,6 @@
#include "windows.h" #include "windows.h"
#include <kephal/screens.h>
// kwin config keywords // kwin config keywords
#define KWIN_FOCUS "FocusPolicy" #define KWIN_FOCUS "FocusPolicy"
#define KWIN_PLACEMENT "Placement" #define KWIN_PLACEMENT "Placement"
@ -253,7 +252,7 @@ KFocusConfig::KFocusConfig(bool _standAlone, KConfig *_config, const KComponentD
activeMouseScreen->setWhatsThis(wtstr); activeMouseScreen->setWhatsThis(wtstr);
connect(focusCombo, SIGNAL(activated(int)), this, SLOT(updateActiveMouseScreen())); connect(focusCombo, SIGNAL(activated(int)), this, SLOT(updateActiveMouseScreen()));
if (Kephal::ScreenUtils::numScreens() == 1) { // No Ximerama if (QApplication::desktop()->screenCount() == 1) { // No Ximerama
separateScreenFocus->hide(); separateScreenFocus->hide();
activeMouseScreen->hide(); activeMouseScreen->hide();
} }

View file

@ -19,7 +19,7 @@ kde4_add_ui_files( kcm_kwintabbox_PART_SRCS main.ui )
kde4_add_plugin(kcm_kwintabbox ${kcm_kwintabbox_PART_SRCS}) 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} ) install(TARGETS kcm_kwintabbox DESTINATION ${PLUGIN_INSTALL_DIR} )

View file

@ -9,7 +9,7 @@ set(kdecorations_LIB_SRCS
kde4_add_library(kdecorations SHARED ${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}) target_link_libraries(kdecorations LINK_INTERFACE_LIBRARIES ${KDE4_KDEUI_LIBS})
set_target_properties(kdecorations PROPERTIES set_target_properties(kdecorations PROPERTIES

View file

@ -39,8 +39,6 @@
#include "kdecorationfactory.h" #include "kdecorationfactory.h"
#include <klocale.h> #include <klocale.h>
#include <kephal/screens.h>
#include "kcommondecoration.moc" #include "kcommondecoration.moc"
/** @addtogroup kdecoration */ /** @addtogroup kdecoration */

View file

@ -11,7 +11,7 @@ set(kwin_EFFECTSLIB_SRCS
kde4_add_library(kwineffects SHARED ${kwin_EFFECTSLIB_SRCS}) kde4_add_library(kwineffects SHARED ${kwin_EFFECTSLIB_SRCS})
target_link_libraries(kwineffects ${KDE4_KDEUI_LIBS} ${QT_QTGUI_LIBRARY} target_link_libraries(kwineffects ${KDE4_KDEUI_LIBS} ${QT_QTGUI_LIBRARY}
${X11_LIBRARIES} kephal ${X11_LIBRARIES}
${X11_Xrender_LIB} ${X11_Xrender_LIB}
${X11_Xrandr_LIB} ${X11_Xrandr_LIB}
${X11_Xcomposite_LIB} ${X11_Xcomposite_LIB}
@ -33,7 +33,7 @@ set(kwin_GLUTILSLIB_SRCS
macro( KWIN4_ADD_GLUTILS_BACKEND name glinclude ) macro( KWIN4_ADD_GLUTILS_BACKEND name glinclude )
include_directories(${glinclude}) include_directories(${glinclude})
kde4_add_library(${name} SHARED ${kwin_GLUTILSLIB_SRCS}) 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 ) set_target_properties(${name} PROPERTIES VERSION 1.0.0 SOVERSION 1 )
target_link_libraries(${name} ${ARGN}) target_link_libraries(${name} ${ARGN})
target_link_libraries(${name} LINK_INTERFACE_LIBRARIES ${ARGN}) target_link_libraries(${name} LINK_INTERFACE_LIBRARIES ${ARGN})

View file

@ -39,8 +39,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "compositingprefs.h" #include "compositingprefs.h"
#include <kwinglplatform.h> #include <kwinglplatform.h>
#include <kephal/screens.h>
#include <X11/extensions/Xrandr.h> #include <X11/extensions/Xrandr.h>
#ifndef KWIN_HAVE_OPENGLES #ifndef KWIN_HAVE_OPENGLES
#ifndef KWIN_NO_XF86VM #ifndef KWIN_NO_XF86VM

View file

@ -83,7 +83,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "overlaywindow.h" #include "overlaywindow.h"
#include "shadow.h" #include "shadow.h"
#include <kephal/screens.h>
#include "thumbnailitem.h" #include "thumbnailitem.h"
namespace KWin namespace KWin

View file

@ -42,9 +42,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QtCore/QTextStream> #include <QtCore/QTextStream>
#include <QtDBus/QDBusInterface> #include <QtDBus/QDBusInterface>
// KDE-Workspace
#include <kephal/screens.h>
namespace KWin { namespace KWin {
ScreenEdge::ScreenEdge() ScreenEdge::ScreenEdge()
@ -73,7 +70,7 @@ void ScreenEdge::update(bool force)
m_screenEdgeTimeLast = xTime(); m_screenEdgeTimeLast = xTime();
m_screenEdgeTimeLastTrigger = xTime(); m_screenEdgeTimeLastTrigger = xTime();
m_currentScreenEdge = ElectricNone; m_currentScreenEdge = ElectricNone;
QRect r = Kephal::ScreenUtils::desktopGeometry(); QRect r = QRect(0, 0, displayWidth(), displayHeight());
m_screenEdgeTop = r.top(); m_screenEdgeTop = r.top();
m_screenEdgeBottom = r.bottom(); m_screenEdgeBottom = r.bottom();
m_screenEdgeLeft = r.left(); m_screenEdgeLeft = r.left();
@ -120,7 +117,7 @@ void ScreenEdge::restoreSize(ElectricBorder border)
{ {
if (m_screenEdgeWindows[border] == None) if (m_screenEdgeWindows[border] == None)
return; return;
QRect r = Kephal::ScreenUtils::desktopGeometry(); QRect r(0, 0, displayWidth(), displayHeight());
int xywh[ELECTRIC_COUNT][4] = { int xywh[ELECTRIC_COUNT][4] = {
{ r.left() + 1, r.top(), r.width() - 2, 1 }, // Top { r.left() + 1, r.top(), r.width() - 2, 1 }, // Top
{ r.right(), r.top(), 1, 1 }, // Top-right { r.right(), r.top(), 1, 1 }, // Top-right

View file

@ -25,6 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <QtDeclarative/qdeclarative.h> #include <QtDeclarative/qdeclarative.h>
#include <QtDeclarative/QDeclarativeContext> #include <QtDeclarative/QDeclarativeContext>
#include <QtDeclarative/QDeclarativeEngine> #include <QtDeclarative/QDeclarativeEngine>
#include <QtGui/QDesktopWidget>
#include <QtGui/QGraphicsObject> #include <QtGui/QGraphicsObject>
#include <QtGui/QResizeEvent> #include <QtGui/QResizeEvent>
#include <QX11Info> #include <QX11Info>
@ -39,7 +40,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <KDE/Plasma/Theme> #include <KDE/Plasma/Theme>
#include <KDE/Plasma/WindowEffects> #include <KDE/Plasma/WindowEffects>
#include <kdeclarative.h> #include <kdeclarative.h>
#include <kephal/screens.h>
// KWin // KWin
#include "thumbnailitem.h" #include "thumbnailitem.h"
#include <kwindowsystem.h> #include <kwindowsystem.h>
@ -160,7 +160,7 @@ void DeclarativeView::showEvent(QShowEvent *event)
} }
#endif #endif
updateQmlSource(); updateQmlSource();
m_currentScreenGeometry = Kephal::ScreenUtils::screenGeometry(tabBox->activeScreen()); m_currentScreenGeometry = QApplication::desktop()->screenGeometry(tabBox->activeScreen());
rootObject()->setProperty("screenWidth", m_currentScreenGeometry.width()); rootObject()->setProperty("screenWidth", m_currentScreenGeometry.width());
rootObject()->setProperty("screenHeight", m_currentScreenGeometry.height()); rootObject()->setProperty("screenHeight", m_currentScreenGeometry.height());
rootObject()->setProperty("allDesktops", tabBox->config().tabBoxMode() == TabBoxConfig::ClientTabBox && rootObject()->setProperty("allDesktops", tabBox->config().tabBoxMode() == TabBoxConfig::ClientTabBox &&

View file

@ -29,6 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <kconfig.h> #include <kconfig.h>
#include <kglobal.h> #include <kglobal.h>
#include <klocale.h> #include <klocale.h>
#include <QtGui/QDesktopWidget>
#include <QRegExp> #include <QRegExp>
#include <QPainter> #include <QPainter>
#include <QBitmap> #include <QBitmap>
@ -78,8 +79,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <kwindowsystem.h> #include <kwindowsystem.h>
#include <kwindowinfo.h> #include <kwindowinfo.h>
#include <kephal/screens.h>
namespace KWin namespace KWin
{ {
@ -241,10 +240,8 @@ Workspace::Workspace(bool restore)
init(); init();
connect(Kephal::Screens::self(), SIGNAL(screenAdded(Kephal::Screen*)), &screenChangedTimer, SLOT(start())); connect(QApplication::desktop(), SIGNAL(screenCountChanged(int)), &screenChangedTimer, SLOT(start()));
connect(Kephal::Screens::self(), SIGNAL(screenRemoved(int)), &screenChangedTimer, SLOT(start())); connect(QApplication::desktop(), SIGNAL(resized(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()));
#ifdef KWIN_BUILD_ACTIVITIES #ifdef KWIN_BUILD_ACTIVITIES
connect(&activityController_, SIGNAL(currentActivityChanged(QString)), SLOT(updateCurrentActivity(QString))); connect(&activityController_, SIGNAL(currentActivityChanged(QString)), SLOT(updateCurrentActivity(QString)));
@ -441,7 +438,10 @@ void Workspace::init()
NETPoint* viewports = new NETPoint[numberOfDesktops()]; NETPoint* viewports = new NETPoint[numberOfDesktops()];
rootInfo->setDesktopViewport(numberOfDesktops(), *viewports); rootInfo->setDesktopViewport(numberOfDesktops(), *viewports);
delete[] 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; NETSize desktop_geometry;
desktop_geometry.width = geom.width(); desktop_geometry.width = geom.width();
desktop_geometry.height = geom.height(); desktop_geometry.height = geom.height();
@ -1658,7 +1658,7 @@ void Workspace::toggleClientOnActivity(Client* c, const QString &activity, bool
int Workspace::numScreens() const int Workspace::numScreens() const
{ {
return Kephal::ScreenUtils::numScreens(); return QApplication::desktop()->screenCount();
} }
int Workspace::activeScreen() const int Workspace::activeScreen() const
@ -1668,7 +1668,7 @@ int Workspace::activeScreen() const
return activeClient()->screen(); return activeClient()->screen();
return active_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) void Workspace::setActiveScreenMouse(const QPoint& mousepos)
{ {
active_screen = Kephal::ScreenUtils::screenId(mousepos); active_screen = QApplication::desktop()->screenNumber(mousepos);
} }
QRect Workspace::screenGeometry(int screen) const QRect Workspace::screenGeometry(int screen) const
{ {
return Kephal::ScreenUtils::screenGeometry(screen); return QApplication::desktop()->screenGeometry(screen);
} }
int Workspace::screenNumber(const QPoint& pos) const int Workspace::screenNumber(const QPoint& pos) const
{ {
return Kephal::ScreenUtils::screenId(pos); return QApplication::desktop()->screenNumber(pos);
} }
void Workspace::sendClientToScreen(Client* c, int screen) void Workspace::sendClientToScreen(Client* c, int screen)