Use Window wrapper methods for manipulating the frame

And by that it's also mostly ported to XCB.
This commit is contained in:
Martin Gräßlin 2013-09-10 08:37:49 +02:00
parent cfd93246b3
commit 484c61a81e
2 changed files with 10 additions and 10 deletions

View file

@ -273,7 +273,7 @@ void Client::releaseWindow(bool on_shutdown)
hidden = true; // So that it's not considered visible anymore (can't use hideClient(), it would set flags)
if (!on_shutdown)
workspace()->clientHidden(this);
XUnmapWindow(display(), frameId()); // Destroying decoration would cause ugly visual effect
m_frame.unmap(); // Destroying decoration would cause ugly visual effect
destroyDecoration();
cleanGrouping();
if (!on_shutdown) {
@ -1188,7 +1188,7 @@ void Client::map()
discardWindowPixmap();
if (decoration != NULL)
decoration->widget()->show(); // Not really necessary, but let it know the state
XMapWindow(display(), frameId());
m_frame.map();
if (!isShade()) {
m_wrapper.map();
m_client.map();
@ -1210,7 +1210,7 @@ void Client::unmap()
// will be missed is also very minimal, so I don't think it's needed to grab the server
// here.
m_wrapper.selectInput(ClientWinMask); // Avoid getting UnmapNotify
XUnmapWindow(display(), frameId());
m_frame.unmap();
m_wrapper.unmap();
m_client.unmap();
m_decoInputExtent.unmap();
@ -2253,7 +2253,7 @@ void Client::updateCursor()
if (decoration != NULL)
decoration->widget()->setCursor(m_cursor);
xcb_cursor_t nativeCursor = Cursor::x11Cursor(m_cursor);
Xcb::defineCursor(frameId(), nativeCursor);
m_frame.defineCursor(nativeCursor);
if (m_decoInputExtent.isValid())
m_decoInputExtent.defineCursor(nativeCursor);
if (moveResizeMode) {

View file

@ -1910,7 +1910,7 @@ void Client::setGeometry(int x, int y, int w, int h, ForceGeometry_t force)
bool resized = (geom_before_block.size() != geom.size() || pending_geometry_update == PendingGeometryForced);
if (resized) {
resizeDecoration(QSize(w, h));
XMoveResizeWindow(display(), frameId(), x, y, w, h);
m_frame.setGeometry(x, y, w, h);
if (!isShade()) {
QSize cs = clientSize();
m_wrapper.setGeometry(QRect(clientPos(), cs));
@ -1926,9 +1926,9 @@ void Client::setGeometry(int x, int y, int w, int h, ForceGeometry_t force)
if (compositing()) // Defer the X update until we leave this mode
needsXWindowMove = true;
else
XMoveWindow(display(), frameId(), x, y); // sendSyntheticConfigureNotify() on finish shall be sufficient
m_frame.move(x, y); // sendSyntheticConfigureNotify() on finish shall be sufficient
} else {
XMoveWindow(display(), frameId(), x, y);
m_frame.move(x, y);
sendSyntheticConfigureNotify();
}
@ -1998,7 +1998,7 @@ void Client::plainResize(int w, int h, ForceGeometry_t force)
return;
}
resizeDecoration(s);
XResizeWindow(display(), frameId(), w, h);
m_frame.resize(w, h);
// resizeDecoration( s );
if (!isShade()) {
QSize cs = clientSize();
@ -2049,7 +2049,7 @@ void Client::move(int x, int y, ForceGeometry_t force)
pending_geometry_update = PendingGeometryNormal;
return;
}
XMoveWindow(display(), frameId(), x, y);
m_frame.move(x, y);
sendSyntheticConfigureNotify();
updateWindowRules(Rules::Position);
screens()->setCurrent(this);
@ -2646,7 +2646,7 @@ void Client::leaveMoveResize()
{
if (needsXWindowMove) {
// Do the deferred move
XMoveWindow(display(), frameId(), geom.x(), geom.y());
m_frame.move(geom.topLeft());
needsXWindowMove = false;
}
if (!isResize())