Magellan Linux

Annotation of /trunk/compiz/patches/compiz-0.8.4-kde44.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 990 - (hide annotations) (download)
Tue Mar 2 10:40:58 2010 UTC (14 years, 2 months ago) by niro
File size: 5984 byte(s)
kde44 support

1 niro 990 From: Dennis Kasprzyk <onestone@compiz-fusion.org>
2     Date: Fri, 12 Feb 2010 20:07:41 +0000 (+0100)
3     Subject: Kde 4.4 support.
4     X-Git-Url: http://gitweb.compiz.org/?p=compiz%2Fcore;a=commitdiff_plain;h=04c6a44893a00088c63acd3ba327022f8aa551cc;hp=65ed618a5f36b795dbef69ba04ebde6b911d228c
5    
6     Kde 4.4 support.
7     ---
8    
9     diff --git a/kde/window-decorator-kde4/window.cpp b/kde/window-decorator-kde4/window.cpp
10     index a7cd2d4..99c502d 100644
11     --- a/kde/window-decorator-kde4/window.cpp
12     +++ b/kde/window-decorator-kde4/window.cpp
13     @@ -486,31 +486,39 @@ KWD::Window::showWindowMenu (const QRect &pos)
14     showWindowMenu (pos.bottomLeft ());
15     }
16    
17     -void
18     -KWD::Window::processMousePressEvent (QMouseEvent *qme)
19     +KWD::Options::MouseCommand
20     +KWD::Window::buttonToCommand (Qt::MouseButtons button)
21     {
22     Options::MouseCommand com = Options::MouseNothing;
23     - bool active = isActive ();
24     + bool active = isActive ();
25    
26     if (!mSupportTakeFocus)
27     - active = TRUE;
28     + active = true;
29    
30     - switch (qme->button ()) {
31     + switch (button) {
32     case Qt::LeftButton:
33     com = active ? Decorator::options ()->commandActiveTitlebar1 () :
34     - Decorator::options()->commandInactiveTitlebar1 ();
35     + Decorator::options()->commandInactiveTitlebar1 ();
36     break;
37     case Qt::MidButton:
38     com = active ? Decorator::options ()->commandActiveTitlebar2 () :
39     - Decorator::options()->commandInactiveTitlebar2 ();
40     + Decorator::options()->commandInactiveTitlebar2 ();
41     break;
42     case Qt::RightButton:
43     com = active ? Decorator::options ()->commandActiveTitlebar3 () :
44     - Decorator::options()->commandInactiveTitlebar3 ();
45     + Decorator::options()->commandInactiveTitlebar3 ();
46     default:
47     break;
48     }
49    
50     + return com;
51     +}
52     +
53     +void
54     +KWD::Window::processMousePressEvent (QMouseEvent *qme)
55     +{
56     + Options::MouseCommand com = buttonToCommand (qme->button ());
57     +
58     if (qme->button () == Qt::LeftButton)
59     {
60     // actions where it's not possible to get the matching release event
61     @@ -752,6 +760,96 @@ KWD::Window::compositingActive (void) const
62     return true;
63     }
64    
65     +#if KDE_IS_VERSION(4,3,90)
66     +
67     +QRect
68     +KWD::Window::transparentRect () const
69     +{
70     + return QRect ();
71     +}
72     +
73     +bool
74     +KWD::Window::isClientGroupActive ()
75     +{
76     + return false;
77     +}
78     +
79     +QList<ClientGroupItem>
80     +KWD::Window::clientGroupItems () const
81     +{
82     + QList<ClientGroupItem> items;
83     +
84     + QIcon icon (mIcon);
85     + icon.addPixmap (mMiniIcon);
86     +
87     + items.append (ClientGroupItem (mName, icon));
88     +
89     + return items;
90     +}
91     +
92     +long
93     +KWD::Window::itemId (int index)
94     +{
95     + return (long) mClientId;
96     +}
97     +
98     +int
99     +KWD::Window::visibleClientGroupItem ()
100     +{
101     + return 0;
102     +}
103     +
104     +void
105     +KWD::Window::setVisibleClientGroupItem (int index)
106     +{
107     +}
108     +
109     +void
110     +KWD::Window::moveItemInClientGroup (int index, int before)
111     +{
112     +}
113     +
114     +void
115     +KWD::Window::moveItemToClientGroup (long itemId, int before)
116     +{
117     +}
118     +
119     +void
120     +KWD::Window::removeFromClientGroup (int index, const QRect& newGeom)
121     +{
122     +}
123     +
124     +void
125     +KWD::Window::closeClientGroupItem (int index)
126     +{
127     + closeWindow ();
128     +}
129     +
130     +void
131     +KWD::Window::closeAllInClientGroup ()
132     +{
133     + closeWindow ();
134     +}
135     +
136     +void
137     +KWD::Window::displayClientMenu (int index, const QPoint& pos)
138     +{
139     + showWindowMenu (pos);
140     +}
141     +
142     +KDecorationDefines::WindowOperation
143     +KWD::Window::buttonToWindowOperation(Qt::MouseButtons button)
144     +{
145     + Options::MouseCommand com = buttonToCommand (button);
146     +
147     + if (com == Options::MouseOperationsMenu)
148     + return KDecorationDefines::OperationsOp;
149     +
150     + return KDecorationDefines::NoOp;
151     +}
152     +
153     +#endif
154     +
155     void
156     KWD::Window::createDecoration (void)
157     {
158     @@ -1466,7 +1564,7 @@ KWD::Window::moveWindow (QMouseEvent *qme)
159     NET::Direction direction;
160    
161     direction = positionToDirection (mDecor->mousePosition (qme->pos ()));
162     -
163     +
164     QPoint p (mGeometry.x () - mExtents.left, mGeometry.y () - mExtents.top);
165     p += qme->pos ();
166    
167     @@ -1476,7 +1574,7 @@ KWD::Window::moveWindow (QMouseEvent *qme)
168     Decorator::rootInfo ()->restackRequest (mClientId, NET::FromApplication,
169     None, Above,
170     QX11Info::appTime());
171     -
172     +
173     Decorator::rootInfo ()->moveResizeRequest (mClientId,
174     p.x (),
175     p.y (),
176     diff --git a/kde/window-decorator-kde4/window.h b/kde/window-decorator-kde4/window.h
177     index 40a5076..c2b274b 100644
178     --- a/kde/window-decorator-kde4/window.h
179     +++ b/kde/window-decorator-kde4/window.h
180     @@ -26,6 +26,7 @@
181    
182     #include <kdecorationbridge.h>
183     #include <KDE/KActionCollection>
184     +#include <kdeversion.h>
185    
186     #include <qpixmap.h>
187     #include <qwidget.h>
188     @@ -111,7 +112,24 @@ class Window: public QObject, public KDecorationBridgeUnstable {
189    
190     /* unstable API */
191     virtual bool compositingActive () const;
192     -
193     +#if KDE_IS_VERSION(4,3,90)
194     + virtual QRect transparentRect () const;
195     +
196     + virtual bool isClientGroupActive ();
197     + virtual QList<ClientGroupItem> clientGroupItems () const;
198     + virtual long itemId (int index);
199     + virtual int visibleClientGroupItem ();
200     + virtual void setVisibleClientGroupItem (int index);
201     + virtual void moveItemInClientGroup (int index, int before);
202     + virtual void moveItemToClientGroup (long itemId, int before);
203     + virtual void removeFromClientGroup (int index, const QRect& newGeom);
204     + virtual void closeClientGroupItem (int index);
205     + virtual void closeAllInClientGroup ();
206     + virtual void displayClientMenu (int index, const QPoint& pos);
207     +
208     + virtual WindowOperation
209     + buttonToWindowOperation(Qt::MouseButtons button);
210     +#endif
211     virtual bool eventFilter (QObject* o, QEvent* e);
212    
213     void handleActiveChange (void);
214     @@ -191,8 +209,10 @@ class Window: public QObject, public KDecorationBridgeUnstable {
215     int rightOffset);
216     void updateProperty (void);
217     void getWindowProtocols (void);
218     +
219     + Options::MouseCommand buttonToCommand (Qt::MouseButtons button);
220     void performMouseCommand (KWD::Options::MouseCommand command,
221     - QMouseEvent *qme);
222     + QMouseEvent *qme);
223     NET::Direction positionToDirection (int pos);
224     Cursor positionToCursor (QPoint pos);
225