Avoid rounding on X11 configure events
As per the comment this is in kwin logical space not X11 space, therefore results should be floating.
This commit is contained in:
parent
c214801a23
commit
2854d59da4
3 changed files with 16 additions and 16 deletions
|
@ -448,7 +448,7 @@ bool X11Window::windowEvent(xcb_generic_event_t *e)
|
||||||
|
|
||||||
motionNotifyEvent(event->event, event->state,
|
motionNotifyEvent(event->event, event->state,
|
||||||
x, y, root_x, root_y);
|
x, y, root_x, root_y);
|
||||||
workspace()->updateFocusMousePosition(QPoint(root_x, root_y));
|
workspace()->updateFocusMousePosition(QPointF(root_x, root_y));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case XCB_ENTER_NOTIFY: {
|
case XCB_ENTER_NOTIFY: {
|
||||||
|
@ -466,7 +466,7 @@ bool X11Window::windowEvent(xcb_generic_event_t *e)
|
||||||
|
|
||||||
motionNotifyEvent(event->event, event->state,
|
motionNotifyEvent(event->event, event->state,
|
||||||
x, y, root_x, root_y);
|
x, y, root_x, root_y);
|
||||||
workspace()->updateFocusMousePosition(QPoint(root_x, root_y));
|
workspace()->updateFocusMousePosition(QPointF(root_x, root_y));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case XCB_LEAVE_NOTIFY: {
|
case XCB_LEAVE_NOTIFY: {
|
||||||
|
@ -1176,14 +1176,14 @@ void X11Window::focusOutEvent(xcb_focus_out_event_t *e)
|
||||||
}
|
}
|
||||||
|
|
||||||
// performs _NET_WM_MOVERESIZE
|
// performs _NET_WM_MOVERESIZE
|
||||||
void X11Window::NETMoveResize(int x_root, int y_root, NET::Direction direction)
|
void X11Window::NETMoveResize(qreal x_root, qreal y_root, NET::Direction direction)
|
||||||
{
|
{
|
||||||
if (direction == NET::Move) {
|
if (direction == NET::Move) {
|
||||||
// move cursor to the provided position to prevent the window jumping there on first movement
|
// move cursor to the provided position to prevent the window jumping there on first movement
|
||||||
// the expectation is that the cursor is already at the provided position,
|
// the expectation is that the cursor is already at the provided position,
|
||||||
// thus it's more a safety measurement
|
// thus it's more a safety measurement
|
||||||
Cursors::self()->mouse()->setPos(QPoint(x_root, y_root));
|
Cursors::self()->mouse()->setPos(QPointF(x_root, y_root));
|
||||||
performMouseCommand(Options::MouseMove, QPoint(x_root, y_root));
|
performMouseCommand(Options::MouseMove, QPointF(x_root, y_root));
|
||||||
} else if (isInteractiveMoveResize() && direction == NET::MoveResizeCancel) {
|
} else if (isInteractiveMoveResize() && direction == NET::MoveResizeCancel) {
|
||||||
finishInteractiveMoveResize(true);
|
finishInteractiveMoveResize(true);
|
||||||
setInteractiveMoveResizePointerButtonDown(false);
|
setInteractiveMoveResizePointerButtonDown(false);
|
||||||
|
@ -1205,7 +1205,7 @@ void X11Window::NETMoveResize(int x_root, int y_root, NET::Direction direction)
|
||||||
finishInteractiveMoveResize(false);
|
finishInteractiveMoveResize(false);
|
||||||
}
|
}
|
||||||
setInteractiveMoveResizePointerButtonDown(true);
|
setInteractiveMoveResizePointerButtonDown(true);
|
||||||
setInteractiveMoveOffset(QPoint(x_root - x(), y_root - y())); // map from global
|
setInteractiveMoveOffset(QPointF(x_root - x(), y_root - y())); // map from global
|
||||||
setInvertedInteractiveMoveOffset(rect().bottomRight() - interactiveMoveOffset());
|
setInvertedInteractiveMoveOffset(rect().bottomRight() - interactiveMoveOffset());
|
||||||
setUnrestrictedInteractiveMoveResize(false);
|
setUnrestrictedInteractiveMoveResize(false);
|
||||||
setInteractiveMoveResizeGravity(convert[direction]);
|
setInteractiveMoveResizeGravity(convert[direction]);
|
||||||
|
|
|
@ -3859,7 +3859,7 @@ const QPointF X11Window::calculateGravitation(bool invert) const
|
||||||
}
|
}
|
||||||
|
|
||||||
// co-ordinate are in kwin logical
|
// co-ordinate are in kwin logical
|
||||||
void X11Window::configureRequest(int value_mask, int rx, int ry, int rw, int rh, int gravity, bool from_tool)
|
void X11Window::configureRequest(int value_mask, qreal rx, qreal ry, qreal rw, qreal rh, int gravity, bool from_tool)
|
||||||
{
|
{
|
||||||
const int configurePositionMask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y;
|
const int configurePositionMask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y;
|
||||||
const int configureSizeMask = XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT;
|
const int configureSizeMask = XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT;
|
||||||
|
@ -3966,8 +3966,8 @@ void X11Window::configureRequest(int value_mask, int rx, int ry, int rw, int rh,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value_mask & configureSizeMask && !(value_mask & configurePositionMask)) { // pure resize
|
if (value_mask & configureSizeMask && !(value_mask & configurePositionMask)) { // pure resize
|
||||||
int nw = clientSize().width();
|
qreal nw = clientSize().width();
|
||||||
int nh = clientSize().height();
|
qreal nh = clientSize().height();
|
||||||
if (value_mask & XCB_CONFIG_WINDOW_WIDTH) {
|
if (value_mask & XCB_CONFIG_WINDOW_WIDTH) {
|
||||||
nw = rw;
|
nw = rw;
|
||||||
}
|
}
|
||||||
|
@ -3975,7 +3975,7 @@ void X11Window::configureRequest(int value_mask, int rx, int ry, int rw, int rh,
|
||||||
nh = rh;
|
nh = rh;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QSizeF requestedClientSize = constrainClientSize(QSize(nw, nh));
|
const QSizeF requestedClientSize = constrainClientSize(QSizeF(nw, nh));
|
||||||
QSizeF requestedFrameSize = clientSizeToFrameSize(requestedClientSize);
|
QSizeF requestedFrameSize = clientSizeToFrameSize(requestedClientSize);
|
||||||
requestedFrameSize = rules()->checkSize(requestedFrameSize);
|
requestedFrameSize = rules()->checkSize(requestedFrameSize);
|
||||||
|
|
||||||
|
@ -4067,7 +4067,7 @@ void X11Window::resizeWithChecks(qreal w, qreal h, xcb_gravity_t gravity)
|
||||||
|
|
||||||
// _NET_MOVERESIZE_WINDOW
|
// _NET_MOVERESIZE_WINDOW
|
||||||
// note co-ordinates are kwin logical
|
// note co-ordinates are kwin logical
|
||||||
void X11Window::NETMoveResizeWindow(int flags, int x, int y, int width, int height)
|
void X11Window::NETMoveResizeWindow(int flags, qreal x, qreal y, qreal width, qreal height)
|
||||||
{
|
{
|
||||||
int gravity = flags & 0xff;
|
int gravity = flags & 0xff;
|
||||||
int value_mask = 0;
|
int value_mask = 0;
|
||||||
|
@ -4087,7 +4087,7 @@ void X11Window::NETMoveResizeWindow(int flags, int x, int y, int width, int heig
|
||||||
}
|
}
|
||||||
|
|
||||||
// _GTK_SHOW_WINDOW_MENU
|
// _GTK_SHOW_WINDOW_MENU
|
||||||
void X11Window::GTKShowWindowMenu(int x_root, int y_root)
|
void X11Window::GTKShowWindowMenu(qreal x_root, qreal y_root)
|
||||||
{
|
{
|
||||||
QPoint globalPos(x_root, y_root);
|
QPoint globalPos(x_root, y_root);
|
||||||
workspace()->showWindowMenu(QRect(globalPos, globalPos), this);
|
workspace()->showWindowMenu(QRect(globalPos, globalPos), this);
|
||||||
|
|
|
@ -235,9 +235,9 @@ public:
|
||||||
QPointF gravityAdjustment(xcb_gravity_t gravity) const;
|
QPointF gravityAdjustment(xcb_gravity_t gravity) const;
|
||||||
const QPointF calculateGravitation(bool invert) const;
|
const QPointF calculateGravitation(bool invert) const;
|
||||||
|
|
||||||
void NETMoveResize(int x_root, int y_root, NET::Direction direction);
|
void NETMoveResize(qreal x_root, qreal y_root, NET::Direction direction);
|
||||||
void NETMoveResizeWindow(int flags, int x, int y, int width, int height);
|
void NETMoveResizeWindow(int flags, qreal x, qreal y, qreal width, qreal height);
|
||||||
void GTKShowWindowMenu(int x_root, int y_root);
|
void GTKShowWindowMenu(qreal x_root, qreal y_root);
|
||||||
void restackWindow(xcb_window_t above, int detail, NET::RequestSource source, xcb_timestamp_t timestamp,
|
void restackWindow(xcb_window_t above, int detail, NET::RequestSource source, xcb_timestamp_t timestamp,
|
||||||
bool send_event = false);
|
bool send_event = false);
|
||||||
|
|
||||||
|
@ -402,7 +402,7 @@ private:
|
||||||
bool hasTransientInternal(const X11Window *c, bool indirect, QList<const X11Window *> &set) const;
|
bool hasTransientInternal(const X11Window *c, bool indirect, QList<const X11Window *> &set) const;
|
||||||
void setShortcutInternal() override;
|
void setShortcutInternal() override;
|
||||||
|
|
||||||
void configureRequest(int value_mask, int rx, int ry, int rw, int rh, int gravity, bool from_tool);
|
void configureRequest(int value_mask, qreal rx, qreal ry, qreal rw, qreal rh, int gravity, bool from_tool);
|
||||||
NETExtendedStrut strut() const;
|
NETExtendedStrut strut() const;
|
||||||
int checkShadeGeometry(int w, int h);
|
int checkShadeGeometry(int w, int h);
|
||||||
void getSyncCounter();
|
void getSyncCounter();
|
||||||
|
|
Loading…
Reference in a new issue