summaryrefslogtreecommitdiff
path: root/kde
diff options
context:
space:
mode:
authorDennis Kasprzyk <onestone@opencompositing.org>2008-05-20 17:11:40 +0200
committerDennis kasprzyk <onestone@opencompositing.org>2008-05-20 17:11:40 +0200
commitd90f11daa0e5d15f7815307f1ef64376d604e8af (patch)
treeaf131d970c813af0f1673316b502344f04d4aa87 /kde
parent6025dbc43f39f111bf1565c4c4fe0cba57ac7635 (diff)
downloadzcomp-d90f11daa0e5d15f7815307f1ef64376d604e8af.tar.gz
zcomp-d90f11daa0e5d15f7815307f1ef64376d604e8af.tar.bz2
The decorator won't get a button release event after resize and move, so we have to fake one to make qt act correctly.
Diffstat (limited to 'kde')
-rw-r--r--kde/window-decorator-kde4/decorator.cpp9
-rw-r--r--kde/window-decorator-kde4/window.cpp2
-rw-r--r--kde/window-decorator-kde4/window.h12
3 files changed, 23 insertions, 0 deletions
diff --git a/kde/window-decorator-kde4/decorator.cpp b/kde/window-decorator-kde4/decorator.cpp
index 2672ef9..96b818d 100644
--- a/kde/window-decorator-kde4/decorator.cpp
+++ b/kde/window-decorator-kde4/decorator.cpp
@@ -603,8 +603,17 @@ KWD::Decorator::x11EventFilter (XEvent *xevent)
xbe2.y = xbe->y - child->pos ().y ();
}
+ client->setFakeRelease (false);
QApplication::x11ProcessEvent ((XEvent *) &xbe2);
+ /* We won't get a button release event, because of the screengrabs
+ in compiz */
+ if (client->getFakeRelease () && xevent->type == ButtonPress)
+ {
+ xbe2.type = ButtonRelease;
+ QApplication::x11ProcessEvent ((XEvent *) &xbe2);
+ }
+
return true;
}
} break;
diff --git a/kde/window-decorator-kde4/window.cpp b/kde/window-decorator-kde4/window.cpp
index 086c40c..c73f771 100644
--- a/kde/window-decorator-kde4/window.cpp
+++ b/kde/window-decorator-kde4/window.cpp
@@ -1881,6 +1881,8 @@ KWD::Window::moveWindow (QMouseEvent *qme)
qme->globalX (),
qme->globalY (),
direction);
+ mFakeRelease = true;
+
}
#define OPACITY_STEP (0xffff / 10)
diff --git a/kde/window-decorator-kde4/window.h b/kde/window-decorator-kde4/window.h
index 485fe39..0441fbb 100644
--- a/kde/window-decorator-kde4/window.h
+++ b/kde/window-decorator-kde4/window.h
@@ -174,6 +174,17 @@ class Window:public QWidget, public KDecorationBridge {
void showKillProcessDialog (Time timestamp);
void hideKillProcessDialog (void);
+ void setFakeRelease (bool fakeRelease)
+ {
+ mFakeRelease = fakeRelease;
+ }
+
+ bool getFakeRelease ()
+ {
+ return mFakeRelease;
+ }
+
+
private:
void createDecoration (void);
void updateShadow (void);
@@ -240,6 +251,7 @@ class Window:public QWidget, public KDecorationBridge {
QSize mSize;
QProcess *mProcessKiller;
KActionCollection mKeys;
+ bool mFakeRelease;
QAction *mResizeOpAction;
QAction *mMoveOpAction;