Port more stuff away from Cursor::pos() to interactiveMoveResizeAnchor()
The main benefit from doing this is that kwin is going to handle maximizing the window by dragging it on touchscreen correctly if the pointer focus point and touch focus point are on different screens.
This commit is contained in:
parent
e8ae03d799
commit
8cae7f7186
3 changed files with 4 additions and 4 deletions
|
@ -2529,7 +2529,7 @@ void Window::keyPressEvent(uint key_code)
|
||||||
key_code = key_code & ~Qt::KeyboardModifierMask;
|
key_code = key_code & ~Qt::KeyboardModifierMask;
|
||||||
int delta = is_control ? 1 : is_alt ? 32
|
int delta = is_control ? 1 : is_alt ? 32
|
||||||
: 8;
|
: 8;
|
||||||
QPointF pos = Cursors::self()->mouse()->pos();
|
QPointF pos = interactiveMoveResizeAnchor();
|
||||||
switch (key_code) {
|
switch (key_code) {
|
||||||
case Qt::Key_Left:
|
case Qt::Key_Left:
|
||||||
pos.rx() -= delta;
|
pos.rx() -= delta;
|
||||||
|
@ -3368,7 +3368,7 @@ void Window::setElectricBorderMaximizing(bool maximizing)
|
||||||
{
|
{
|
||||||
m_electricMaximizing = maximizing;
|
m_electricMaximizing = maximizing;
|
||||||
if (maximizing) {
|
if (maximizing) {
|
||||||
workspace()->outline()->show(quickTileGeometry(electricBorderMode(), Cursors::self()->mouse()->pos()).toRect(), moveResizeGeometry().toRect());
|
workspace()->outline()->show(quickTileGeometry(electricBorderMode(), interactiveMoveResizeAnchor()).toRect(), moveResizeGeometry().toRect());
|
||||||
} else {
|
} else {
|
||||||
workspace()->outline()->hide();
|
workspace()->outline()->hide();
|
||||||
}
|
}
|
||||||
|
|
|
@ -4432,7 +4432,7 @@ void X11Window::maximize(MaximizeMode mode)
|
||||||
|
|
||||||
QRectF clientArea;
|
QRectF clientArea;
|
||||||
if (isElectricBorderMaximizing()) {
|
if (isElectricBorderMaximizing()) {
|
||||||
clientArea = workspace()->clientArea(MaximizeArea, this, Cursors::self()->mouse()->pos());
|
clientArea = workspace()->clientArea(MaximizeArea, this, interactiveMoveResizeAnchor());
|
||||||
} else {
|
} else {
|
||||||
clientArea = workspace()->clientArea(MaximizeArea, this, moveResizeOutput());
|
clientArea = workspace()->clientArea(MaximizeArea, this, moveResizeOutput());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1484,7 +1484,7 @@ void XdgToplevelWindow::maximize(MaximizeMode mode)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QRectF clientArea = isElectricBorderMaximizing() ? workspace()->clientArea(MaximizeArea, this, Cursors::self()->mouse()->pos()) : workspace()->clientArea(MaximizeArea, this, moveResizeOutput());
|
const QRectF clientArea = isElectricBorderMaximizing() ? workspace()->clientArea(MaximizeArea, this, interactiveMoveResizeAnchor()) : workspace()->clientArea(MaximizeArea, this, moveResizeOutput());
|
||||||
|
|
||||||
const MaximizeMode oldMode = m_requestedMaximizeMode;
|
const MaximizeMode oldMode = m_requestedMaximizeMode;
|
||||||
const QRectF oldGeometry = moveResizeGeometry();
|
const QRectF oldGeometry = moveResizeGeometry();
|
||||||
|
|
Loading…
Reference in a new issue