Port Decoration related XLib code to XCB
REVIEW: 110341
This commit is contained in:
parent
4022de7075
commit
9ed3307467
2 changed files with 18 additions and 6 deletions
|
@ -465,13 +465,13 @@ void Client::createDecoration(const QRect& oldgeom)
|
|||
// TODO: Check decoration's minimum size?
|
||||
decoration->init();
|
||||
decoration->widget()->installEventFilter(this);
|
||||
XReparentWindow(display(), decoration->widget()->winId(), frameId(), 0, 0);
|
||||
xcb_reparent_window(connection(), decoration->widget()->winId(), frameId(), 0, 0);
|
||||
decoration->widget()->lower();
|
||||
decoration->borders(border_left, border_right, border_top, border_bottom);
|
||||
padding_left = padding_right = padding_top = padding_bottom = 0;
|
||||
if (KDecorationUnstable *deco2 = dynamic_cast<KDecorationUnstable*>(decoration))
|
||||
deco2->padding(padding_left, padding_right, padding_top, padding_bottom);
|
||||
XMoveWindow(display(), decoration->widget()->winId(), -padding_left, -padding_top);
|
||||
Xcb::moveWindow(decoration->widget()->winId(), -padding_left, -padding_top);
|
||||
move(calculateGravitation(false));
|
||||
plainResize(sizeForClientSize(clientSize()), ForceGeometrySet);
|
||||
if (Compositor::compositing()) {
|
||||
|
@ -511,7 +511,7 @@ bool Client::checkBorderSizes(bool also_resize)
|
|||
if (KDecorationUnstable *deco2 = dynamic_cast<KDecorationUnstable*>(decoration))
|
||||
deco2->padding(new_left, new_right, new_top, new_bottom);
|
||||
if (padding_left != new_left || padding_top != new_top)
|
||||
XMoveWindow(display(), decoration->widget()->winId(), -new_left, -new_top);
|
||||
Xcb::moveWindow(decoration->widget()->winId(), -new_left, -new_top);
|
||||
padding_left = new_left;
|
||||
padding_right = new_right;
|
||||
padding_top = new_top;
|
||||
|
|
18
xcbutils.h
18
xcbutils.h
|
@ -39,6 +39,8 @@ typedef xcb_window_t WindowId;
|
|||
// forward declaration of methods
|
||||
static void defineCursor(xcb_window_t window, xcb_cursor_t cursor);
|
||||
static void setInputFocus(xcb_window_t window, uint8_t revertTo = XCB_INPUT_FOCUS_POINTER_ROOT, xcb_timestamp_t time = xTime());
|
||||
static void moveWindow(xcb_window_t window, const QPoint &pos);
|
||||
static void moveWindow(xcb_window_t window, uint32_t x, uint32_t y);
|
||||
|
||||
template <typename Reply,
|
||||
typename Cookie,
|
||||
|
@ -471,9 +473,7 @@ void Window::move(uint32_t x, uint32_t y)
|
|||
if (!isValid()) {
|
||||
return;
|
||||
}
|
||||
const uint16_t mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y;
|
||||
const uint32_t values[] = { x, y };
|
||||
xcb_configure_window(connection(), m_window, mask, values);
|
||||
moveWindow(m_window, x, y);
|
||||
}
|
||||
|
||||
inline
|
||||
|
@ -562,6 +562,18 @@ static inline void moveResizeWindow(WindowId window, const QRect &geometry)
|
|||
xcb_configure_window(connection(), window, mask, values);
|
||||
}
|
||||
|
||||
static inline void moveWindow(xcb_window_t window, const QPoint& pos)
|
||||
{
|
||||
moveWindow(window, pos.x(), pos.y());
|
||||
}
|
||||
|
||||
static inline void moveWindow(xcb_window_t window, uint32_t x, uint32_t y)
|
||||
{
|
||||
const uint16_t mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y;
|
||||
const uint32_t values[] = { x, y };
|
||||
xcb_configure_window(connection(), window, mask, values);
|
||||
}
|
||||
|
||||
static inline WindowId createInputWindow(const QRect &geometry, uint32_t mask, const uint32_t *values)
|
||||
{
|
||||
WindowId window = xcb_generate_id(connection());
|
||||
|
|
Loading…
Reference in a new issue