I think I got persuaded that having a direct access to the decorated

window might be useful in very very very rare cases.

svn path=/trunk/kdebase/kwin/; revision=368911
This commit is contained in:
Luboš Luňák 2004-12-06 15:46:27 +00:00
parent 2863e6fa66
commit aa28465df5
7 changed files with 32 additions and 0 deletions

View file

@ -103,6 +103,11 @@ QWidget* Bridge::workspaceWidget() const
return c->workspace()->desktopWidget();
}
WId Bridge::windowId() const
{
return c->window();
}
void Bridge::titlebarDblClickOperation()
{
c->workspace()->performWindowOperation( c, options->operationTitlebarDblClick());

View file

@ -50,6 +50,7 @@ class Bridge : public KDecorationBridge
virtual QRect iconGeometry() const;
virtual QRegion unobscuredRegion( const QRegion& r ) const;
virtual QWidget* workspaceWidget() const;
virtual WId windowId() const;
virtual void closeWindow();
virtual void maximize( MaximizeMode mode );
virtual void minimize();

View file

@ -375,6 +375,11 @@ QWidget* KDecorationPreviewBridge::workspaceWidget() const
return preview;
}
WId KDecorationPreviewBridge::windowId() const
{
return 0; // no decorated window
}
void KDecorationPreviewBridge::closeWindow()
{
}

View file

@ -93,6 +93,7 @@ class KDecorationPreviewBridge
virtual QRect iconGeometry() const;
virtual QRegion unobscuredRegion( const QRegion& r ) const;
virtual QWidget* workspaceWidget() const;
virtual WId windowId() const;
virtual void closeWindow();
virtual void maximize( MaximizeMode mode );
virtual void minimize();

View file

@ -226,6 +226,11 @@ QWidget* KDecoration::workspaceWidget() const
return bridge_->workspaceWidget();
}
WId KDecoration::windowId() const
{
return bridge_->windowId();
}
void KDecoration::closeWindow()
{
bridge_->closeWindow();

View file

@ -519,6 +519,20 @@ class KWIN_EXPORT KDecoration
* allow painting the minimize animation or the transparent move bound on it.
*/
QWidget* workspaceWidget() const;
/**
* Returns the handle of the window that is being decorated. It is possible
* the returned value will be 0.
* IMPORTANT: This function is meant for special purposes, and it
* usually should not be used. The main purpose is finding out additional
* information about the window's state. Also note that different kinds
* of windows are decorated: Toplevel windows managed by the window manager,
* test window in the window manager decoration module, and possibly also
* other cases.
* Careless abuse of this function will usually sooner or later lead
* to problems.
* @since 3.4
*/
WId windowId() const;
/**
* Convenience function that returns the width of the decoration.
*/

View file

@ -89,6 +89,7 @@ class KDecorationBridge : public KDecorationDefines
virtual QRect iconGeometry() const = 0;
virtual QRegion unobscuredRegion( const QRegion& r ) const = 0;
virtual QWidget* workspaceWidget() const = 0;
virtual WId windowId() const = 0;
virtual void closeWindow() = 0;
virtual void maximize( MaximizeMode mode ) = 0;
virtual void minimize() = 0;