From d90f11daa0e5d15f7815307f1ef64376d604e8af Mon Sep 17 00:00:00 2001 From: Dennis Kasprzyk Date: Tue, 20 May 2008 17:11:40 +0200 Subject: The decorator won't get a button release event after resize and move, so we have to fake one to make qt act correctly. --- kde/window-decorator-kde4/decorator.cpp | 9 +++++++++ kde/window-decorator-kde4/window.cpp | 2 ++ kde/window-decorator-kde4/window.h | 12 ++++++++++++ 3 files changed, 23 insertions(+) (limited to 'kde/window-decorator-kde4') diff --git a/kde/window-decorator-kde4/decorator.cpp b/kde/window-decorator-kde4/decorator.cpp index 2672ef93..96b818df 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 086c40c1..c73f7711 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 485fe39b..0441fbb1 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; -- cgit v1.2.3