[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma
From:       Martin Gräßlin <ubuntu () martin-graesslin ! com>
Date:       2009-10-21 10:53:32
Message-ID: 1256122412.624675.11728.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1038531 by graesslin:

Use WindowEffect API to activate present windows effect.

 M  +2 -22     desktop/applets/tasks/taskgroupitem.cpp  
 M  +3 -11     netbook/applets/currentappcontrol/currentappcontrol.cpp  


--- trunk/KDE/kdebase/workspace/plasma/desktop/applets/tasks/taskgroupitem.cpp \
#1038530:1038531 @@ -29,7 +29,6 @@
 #include <QApplication>
 #include <QGraphicsLinearLayout>
 #include <QInputDialog>
-#include <QVarLengthArray>
 
 // KDE
 #include <KAuthorized>
@@ -46,16 +45,12 @@
 #include <Plasma/Corona>
 #include <Plasma/Containment>
 #include <Plasma/Dialog>
+#include <Plasma/WindowEffects>
 
 #include "tasks.h"
 #include "taskitemlayout.h"
 #include "windowtaskitem.h"
 
-#ifdef Q_WS_X11
-#include <X11/Xlib.h>
-#include <QX11Info>
-#endif
-
 TaskGroupItem::TaskGroupItem(QGraphicsWidget *parent, Tasks *applet)
     : AbstractTaskItem(parent, applet),
       m_group(0),
@@ -554,7 +549,6 @@
 void TaskGroupItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
 { //TODO add delay so we can still drag group items
     if ((event->buttons() & Qt::LeftButton) && (event->modifiers() & \
                Qt::ControlModifier)) {
- #ifdef Q_WS_X11
         QList<WId> ids;
         foreach (AbstractGroupableItem *groupable, m_group->members()) {
             if (groupable->isGroupItem()) {
@@ -566,21 +560,7 @@
                 }
             }
         }
-        const int numWindows = ids.count();
-        QVarLengthArray<long, 32> data(numWindows);
-
-        for (int i = 0; i < numWindows; ++i) {
-            data[i] = ids[i];
-        }
-
-        if (!data.isEmpty()) {
-            Display *dpy = QX11Info::display();
-            const WId winId = data[0];
-            Atom atom = XInternAtom(dpy, "_KDE_PRESENT_WINDOWS_GROUP", False);
-            XChangeProperty(dpy, winId, atom, atom, 32, PropModeReplace,
-                            reinterpret_cast<unsigned char *>(data.data()), \
                data.size());
-        }
-#endif
+        Plasma::WindowEffects::presentWindows(m_applet->view()->winId(), ids);
     } else if ((event->buttons() & Qt::LeftButton) && !m_popupLostFocus) {
         if (m_applet->groupManager().sortingStrategy() == \
                TaskManager::GroupManager::ManualSorting ||
             m_applet->groupManager().groupingStrategy() == \
                TaskManager::GroupManager::ManualGrouping) {
--- trunk/KDE/kdebase/workspace/plasma/netbook/applets/currentappcontrol/currentappcontrol.cpp \
#1038530:1038531 @@ -39,10 +39,10 @@
 #include <Plasma/Dialog>
 #include <Plasma/Containment>
 #include <Plasma/Corona>
+#include <Plasma/WindowEffects>
 
 //X
 #ifdef Q_WS_X11
-#include <X11/Xlib.h>
 #include <X11/extensions/XTest.h>
 #include <X11/keysym.h>
 #endif
@@ -219,16 +219,8 @@
 
 void CurrentAppControl::listWindows()
 {
-    if (KWindowSystem::compositingActive()) {
-#ifdef Q_WS_X11
-        QVarLengthArray<long, 32> data(1);
-        data[0] = KWindowSystem::currentDesktop();
-        Display *dpy = QX11Info::display();
-        const WId winId = view()->winId();
-        Atom atom = XInternAtom(dpy, "_KDE_PRESENT_WINDOWS_DESKTOP", False);
-        XChangeProperty(dpy, winId, atom, atom, 32, PropModeReplace,
-                        reinterpret_cast<unsigned char *>(data.data()), \
                data.size());
-#endif
+    if (Plasma::WindowEffects::isEffectAvailable(Plasma::WindowEffects::PresentWindows)) \
{ +        Plasma::WindowEffects::presentWindows(view()->winId() , \
KWindowSystem::currentDesktop());  } else if (!m_listDialog) {
         m_listDialog = new Plasma::Dialog();
         m_listWidget = new QGraphicsWidget(this);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic