Commit ff9d5958 authored by Thomas Lübking's avatar Thomas Lübking
Browse files

unlink ExtendedBorderRegion from unstable API

also fix initial mapping state

BUG: 307721
BUG: 308994
FOXED-IN: 4.10
REVIEW: 106715
parent 7f513b9e
......@@ -357,7 +357,7 @@ void Client::updateInputWindow()
{
QRegion region;
if (!noBorder() && dynamic_cast<KDecorationUnstable*>(decoration)) {
if (!noBorder()) {
// This function is implemented as a slot to avoid breaking binary
// compatibility
QMetaObject::invokeMethod(decoration, "region", Qt::DirectConnection,
......@@ -391,6 +391,8 @@ void Client::updateInputWindow()
input_window = XCreateWindow(display(), rootWindow(), bounds.x(), bounds.y(),
bounds.width(), bounds.height(), 0, 0,
InputOnly, 0, CWEventMask | CWOverrideRedirect, &attr);
if (mapping_state == Mapped)
XMapWindow(display(), inputId());
} else {
XMoveResizeWindow(display(), input_window, bounds.x(), bounds.y(),
bounds.width(), bounds.height());
......
......@@ -1180,16 +1180,17 @@ bool Client::buttonPressEvent(Window w, int button, int state, int x, int y, int
XAllowEvents(display(), ReplayPointer, CurrentTime); //xTime());
return true;
}
if (w == decorationId() || w == inputId()) {
if (w == inputId()) {
x = x_root - geometry().x() + padding_left;
y = y_root - geometry().y() + padding_top;
}
if (w == inputId()) {
x = x_root - geometry().x() + padding_left;
y = y_root - geometry().y() + padding_top;
// New API processes core events FIRST and only passes unused ones to the decoration
return processDecorationButtonPress(button, state, x, y, x_root, y_root, true);
}
if (w == decorationId()) {
if (dynamic_cast<KDecorationUnstable*>(decoration))
// New API processes core events FIRST and only passes unused ones to the decoration
return processDecorationButtonPress(button, state, x, y, x_root, y_root, true);
else
return false; // Don't eat old API decoration events
return false;
}
if (w == frameId())
processDecorationButtonPress(button, state, x, y, x_root, y_root);
......
......@@ -516,7 +516,7 @@ KDecoration::WindowOperation KDecorationUnstable::buttonToWindowOperation(Qt::Mo
return static_cast< KDecorationBridgeUnstable* >(bridge_)->buttonToWindowOperation(button);
}
QRegion KDecorationUnstable::region(KDecorationDefines::Region)
QRegion KDecoration::region(KDecorationDefines::Region)
{
return QRegion();
}
......
......@@ -1011,6 +1011,15 @@ protected Q_SLOTS:
* @since 4.10
**/
void setAlphaEnabled(bool enabled);
/**
* This slot can be reimplemented to return the regions defined
* by KDecorationDefines::Region.
*
* The default implementation always returns an empty region.
*
* @since 4.8
*/
QRegion region(KDecorationDefines::Region r);
private:
KDecorationBridge* bridge_;
......@@ -1121,17 +1130,6 @@ public:
* a button press was for window tab dragging or for displaying the client menu.
*/
WindowOperation buttonToWindowOperation(Qt::MouseButtons button);
public Q_SLOTS:
/**
* This slot can be reimplemented to return the regions defined
* by KDecorationDefines::Region.
*
* The default implementation always returns an empty region.
*
* @since 4.8
*/
QRegion region(KDecorationDefines::Region r);
};
inline
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment