compiz/kde44-api.patch

205 lines
5.3 KiB
Diff
Raw Normal View History

diff --git a/kde/window-decorator-kde4/window.cpp b/kde/window-decorator-kde4/window.cpp
index a7cd2d4..d7ab93d 100644
--- a/kde/window-decorator-kde4/window.cpp
+++ b/kde/window-decorator-kde4/window.cpp
@@ -486,31 +486,39 @@ KWD::Window::showWindowMenu (const QRect &pos)
showWindowMenu (pos.bottomLeft ());
}
-void
-KWD::Window::processMousePressEvent (QMouseEvent *qme)
+KWD::Options::MouseCommand
+KWD::Window::buttonToCommand (Qt::MouseButtons button)
{
Options::MouseCommand com = Options::MouseNothing;
- bool active = isActive ();
+ bool active = isActive ();
if (!mSupportTakeFocus)
- active = TRUE;
+ active = true;
- switch (qme->button ()) {
+ switch (button) {
case Qt::LeftButton:
com = active ? Decorator::options ()->commandActiveTitlebar1 () :
- Decorator::options()->commandInactiveTitlebar1 ();
+ Decorator::options()->commandInactiveTitlebar1 ();
break;
case Qt::MidButton:
com = active ? Decorator::options ()->commandActiveTitlebar2 () :
- Decorator::options()->commandInactiveTitlebar2 ();
+ Decorator::options()->commandInactiveTitlebar2 ();
break;
case Qt::RightButton:
com = active ? Decorator::options ()->commandActiveTitlebar3 () :
- Decorator::options()->commandInactiveTitlebar3 ();
+ Decorator::options()->commandInactiveTitlebar3 ();
default:
break;
}
+ return com;
+}
+
+void
+KWD::Window::processMousePressEvent (QMouseEvent *qme)
+{
+ Options::MouseCommand com = buttonToCommand (qme->button ());
+
if (qme->button () == Qt::LeftButton)
{
// actions where it's not possible to get the matching release event
@@ -752,6 +760,92 @@ KWD::Window::compositingActive (void) const
return true;
}
+QRect
+KWD::Window::transparentRect () const
+{
+ return QRect ();
+}
+
+bool
+KWD::Window::isClientGroupActive ()
+{
+ return true;
+}
+
+QList<ClientGroupItem>
+KWD::Window::clientGroupItems () const
+{
+ QList<ClientGroupItem> items;
+
+ QIcon icon (mIcon);
+ icon.addPixmap (mMiniIcon);
+
+ items.append (ClientGroupItem (mName, icon));
+
+ return items;
+}
+
+long
+KWD::Window::itemId (int index)
+{
+ return (long) mClientId;
+}
+
+int
+KWD::Window::visibleClientGroupItem ()
+{
+ return 0;
+}
+
+void
+KWD::Window::setVisibleClientGroupItem (int index)
+{
+}
+
+void
+KWD::Window::moveItemInClientGroup (int index, int before)
+{
+}
+
+void
+KWD::Window::moveItemToClientGroup (long itemId, int before)
+{
+}
+
+void
+KWD::Window::removeFromClientGroup (int index, const QRect& newGeom)
+{
+}
+
+void
+KWD::Window::closeClientGroupItem (int index)
+{
+ closeWindow ();
+}
+
+void
+KWD::Window::closeAllInClientGroup ()
+{
+ closeWindow ();
+}
+
+void
+KWD::Window::displayClientMenu (int index, const QPoint& pos)
+{
+ showWindowMenu (pos);
+}
+
+KDecorationDefines::WindowOperation
+KWD::Window::buttonToWindowOperation(Qt::MouseButtons button)
+{
+ Options::MouseCommand com = buttonToCommand (button);
+
+ if (com == Options::MouseOperationsMenu)
+ return KDecorationDefines::OperationsOp;
+
+ return KDecorationDefines::NoOp;
+}
+
void
KWD::Window::createDecoration (void)
{
@@ -1466,7 +1560,7 @@ KWD::Window::moveWindow (QMouseEvent *qme)
NET::Direction direction;
direction = positionToDirection (mDecor->mousePosition (qme->pos ()));
-
+
QPoint p (mGeometry.x () - mExtents.left, mGeometry.y () - mExtents.top);
p += qme->pos ();
@@ -1476,7 +1570,7 @@ KWD::Window::moveWindow (QMouseEvent *qme)
Decorator::rootInfo ()->restackRequest (mClientId, NET::FromApplication,
None, Above,
QX11Info::appTime());
-
+
Decorator::rootInfo ()->moveResizeRequest (mClientId,
p.x (),
p.y (),
diff --git a/kde/window-decorator-kde4/window.h b/kde/window-decorator-kde4/window.h
index 40a5076..e230a83 100644
--- a/kde/window-decorator-kde4/window.h
+++ b/kde/window-decorator-kde4/window.h
@@ -111,7 +111,23 @@ class Window: public QObject, public KDecorationBridgeUnstable {
/* unstable API */
virtual bool compositingActive () const;
-
+ virtual QRect transparentRect () const;
+
+ virtual bool isClientGroupActive ();
+ virtual QList<ClientGroupItem> clientGroupItems () const;
+ virtual long itemId (int index);
+ virtual int visibleClientGroupItem ();
+ virtual void setVisibleClientGroupItem (int index);
+ virtual void moveItemInClientGroup (int index, int before);
+ virtual void moveItemToClientGroup (long itemId, int before);
+ virtual void removeFromClientGroup (int index, const QRect& newGeom);
+ virtual void closeClientGroupItem (int index);
+ virtual void closeAllInClientGroup ();
+ virtual void displayClientMenu (int index, const QPoint& pos);
+
+ virtual WindowOperation
+ buttonToWindowOperation(Qt::MouseButtons button);
+
virtual bool eventFilter (QObject* o, QEvent* e);
void handleActiveChange (void);
@@ -191,8 +207,10 @@ class Window: public QObject, public KDecorationBridgeUnstable {
int rightOffset);
void updateProperty (void);
void getWindowProtocols (void);
+
+ Options::MouseCommand buttonToCommand (Qt::MouseButtons button);
void performMouseCommand (KWD::Options::MouseCommand command,
- QMouseEvent *qme);
+ QMouseEvent *qme);
NET::Direction positionToDirection (int pos);
Cursor positionToCursor (QPoint pos);