From 874fccacd5c8519c5b80400f9629d3c953a2d8a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 10 Aug 2012 08:52:11 +0200 Subject: [PATCH] Delay maximize operation by one event cycle The result of maximizing a window might be the decoration going away. Because of that we need to delay the handling of maximize and title bar double click by one cycle as had been done for other close operations in 0fea5325 BUG: 304870 FIXED-IN: 4.9.1 REVIEW: 105961 --- clients/aurorae/src/aurorae.cpp | 28 ++++++++++++++++++++++++++++ clients/aurorae/src/aurorae.h | 4 ++++ 2 files changed, 32 insertions(+) diff --git a/clients/aurorae/src/aurorae.cpp b/clients/aurorae/src/aurorae.cpp index 64b4901cf6..c5283e8c4c 100644 --- a/clients/aurorae/src/aurorae.cpp +++ b/clients/aurorae/src/aurorae.cpp @@ -455,6 +455,34 @@ void AuroraeClient::doCloseWindow() KDecorationUnstable::closeWindow(); } +void AuroraeClient::maximize(int button) +{ + // a maximized window does not need to have a window decoration + // in that case we need to delay handling by one cycle + // BUG: 304870 + QMetaObject::invokeMethod(qobject_cast< KDecorationUnstable* >(this), + "doMaximzie", + Qt::QueuedConnection, + Q_ARG(int, button)); +} + +void AuroraeClient::doMaximzie(int button) +{ + KDecorationUnstable::maximize(static_cast(button)); +} + +void AuroraeClient::titlebarDblClickOperation() +{ + // the double click operation can result in a window being maximized + // see maximize + QMetaObject::invokeMethod(qobject_cast< KDecorationUnstable* >(this), "doTitlebarDblClickOperation", Qt::QueuedConnection); +} + +void AuroraeClient::doTitlebarDblClickOperation() +{ + KDecorationUnstable::titlebarDblClickOperation(); +} + } // namespace Aurorae extern "C" diff --git a/clients/aurorae/src/aurorae.h b/clients/aurorae/src/aurorae.h index b3586fd250..46099134c1 100644 --- a/clients/aurorae/src/aurorae.h +++ b/clients/aurorae/src/aurorae.h @@ -145,10 +145,14 @@ public slots: void titleReleased(Qt::MouseButton button, Qt::MouseButtons buttons); void titleMouseMoved(Qt::MouseButton button, Qt::MouseButtons buttons); void closeWindow(); + void titlebarDblClickOperation(); + void maximize(int button); private slots: void themeChanged(); void doCloseWindow(); + void doTitlebarDblClickOperation(); + void doMaximzie(int button); private: QGraphicsView *m_view;