Fix case where window overlaps two displays, attempt to fix mouse placement off-by-pixels, fix setup issue with the bin directory, apply adjustment that puts the camera in the middle of screens by default
This commit is contained in:
parent
fbdd5e14bb
commit
0d8fb02388
|
|
@ -59,6 +59,7 @@ cp -r . "$USER_HOME/.local/"
|
||||||
|
|
||||||
popd > /dev/null
|
popd > /dev/null
|
||||||
|
|
||||||
|
mkdir -p $XDG_BIN_HOME
|
||||||
cp bin/breezy_kwin_uninstall $XDG_BIN_HOME
|
cp bin/breezy_kwin_uninstall $XDG_BIN_HOME
|
||||||
|
|
||||||
# Install QT_PLUGIN_PATH snippet into ~/.bash_profile if not present
|
# Install QT_PLUGIN_PATH snippet into ~/.bash_profile if not present
|
||||||
|
|
|
||||||
|
|
@ -561,7 +561,8 @@ void BreezyDesktopEffect::updateCursorImage()
|
||||||
void BreezyDesktopEffect::updateCursorPos()
|
void BreezyDesktopEffect::updateCursorPos()
|
||||||
{
|
{
|
||||||
// Update cursor position from effects
|
// Update cursor position from effects
|
||||||
QPointF newPos = effects->cursorPos();
|
const auto cursor = effects->cursorImage();
|
||||||
|
QPointF newPos = effects->cursorPos() - cursor.hotSpot();
|
||||||
if (m_cursorPos != newPos) {
|
if (m_cursorPos != newPos) {
|
||||||
m_cursorPos = newPos;
|
m_cursorPos = newPos;
|
||||||
Q_EMIT cursorPosChanged();
|
Q_EMIT cursorPosChanged();
|
||||||
|
|
|
||||||
|
|
@ -12,34 +12,6 @@ Node {
|
||||||
property var imuRotations: effect.imuRotations
|
property var imuRotations: effect.imuRotations
|
||||||
property int focusedMonitorIndex: -1
|
property int focusedMonitorIndex: -1
|
||||||
|
|
||||||
// x value for placing the viewport in the middle of all screens
|
|
||||||
property real screensXMid: {
|
|
||||||
let xMin = Number.MAX_VALUE;
|
|
||||||
let xMax = Number.MIN_VALUE;
|
|
||||||
|
|
||||||
for (let i = 0; i < screens.length; i++) {
|
|
||||||
const geometry = screens[i].geometry;
|
|
||||||
xMin = Math.min(xMin, geometry.x);
|
|
||||||
xMax = Math.max(xMax, geometry.x + geometry.width);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (xMin + xMax) / 2 - (viewportResolution[0] / 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
// y value for placing the viewport in the middle of all screens
|
|
||||||
property real screensYMid: {
|
|
||||||
let yMin = Number.MAX_VALUE;
|
|
||||||
let yMax = Number.MIN_VALUE;
|
|
||||||
|
|
||||||
for (let i = 0; i < screens.length; i++) {
|
|
||||||
const geometry = screens[i].geometry;
|
|
||||||
yMin = Math.min(yMin, geometry.y);
|
|
||||||
yMax = Math.max(yMax, geometry.y + geometry.height);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (yMin + yMax) / 2 - (viewportResolution[1] / 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
Displays {
|
Displays {
|
||||||
id: displays
|
id: displays
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,23 +6,42 @@ Item {
|
||||||
|
|
||||||
required property QtObject screen
|
required property QtObject screen
|
||||||
|
|
||||||
|
function overlapsScreen(win, screenGeom) {
|
||||||
|
if (!win) return false
|
||||||
|
const winLeft = win.x
|
||||||
|
const winTop = win.y
|
||||||
|
const winRight = winLeft + win.width
|
||||||
|
const winBottom = winTop + win.height
|
||||||
|
|
||||||
|
const scrLeft = screenGeom.x
|
||||||
|
const scrTop = screenGeom.y
|
||||||
|
const scrRight = scrLeft + screenGeom.width
|
||||||
|
const scrBottom = scrTop + screenGeom.height
|
||||||
|
|
||||||
|
return winLeft < scrRight &&
|
||||||
|
winRight > scrLeft &&
|
||||||
|
winTop < scrBottom &&
|
||||||
|
winBottom > scrTop
|
||||||
|
}
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: KWinComponents.WindowFilterModel {
|
model: KWinComponents.WindowFilterModel {
|
||||||
activity: KWinComponents.Workspace.currentActivity
|
activity: KWinComponents.Workspace.currentActivity
|
||||||
desktop: KWinComponents.Workspace.currentDesktop
|
desktop: KWinComponents.Workspace.currentDesktop
|
||||||
screenName: desktopView.screen.name
|
|
||||||
windowModel: KWinComponents.WindowModel {}
|
windowModel: KWinComponents.WindowModel {}
|
||||||
}
|
}
|
||||||
|
|
||||||
KWinComponents.WindowThumbnail {
|
KWinComponents.WindowThumbnail {
|
||||||
|
// Only show if window overlaps this screen (any amount) and not minimized.
|
||||||
|
readonly property bool onThisScreen: desktopView.overlapsScreen(model.window, desktopView.screen.geometry)
|
||||||
|
|
||||||
wId: model.window.internalId
|
wId: model.window.internalId
|
||||||
x: model.window.x - desktopView.screen.geometry.x
|
x: model.window.x - desktopView.screen.geometry.x
|
||||||
y: model.window.y - desktopView.screen.geometry.y
|
y: model.window.y - desktopView.screen.geometry.y
|
||||||
z: model.window.stackingOrder
|
z: model.window.stackingOrder
|
||||||
visible: !model.window.minimized
|
visible: onThisScreen && !model.window.minimized
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
id: cursorImg
|
id: cursorImg
|
||||||
source: effect.cursorImageSource
|
source: effect.cursorImageSource
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,34 @@ Item {
|
||||||
// return supportedModels.includes(screen.model);
|
// return supportedModels.includes(screen.model);
|
||||||
// })
|
// })
|
||||||
|
|
||||||
|
// x value for placing the viewport in the middle of all screens
|
||||||
|
property real screensXMid: {
|
||||||
|
let xMin = Number.MAX_VALUE;
|
||||||
|
let xMax = Number.MIN_VALUE;
|
||||||
|
|
||||||
|
for (let i = 0; i < screens.length; i++) {
|
||||||
|
const geometry = screens[i].geometry;
|
||||||
|
xMin = Math.min(xMin, geometry.x);
|
||||||
|
xMax = Math.max(xMax, geometry.x + geometry.width);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (xMin + xMax) / 2 - (viewportResolution[0] / 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
// y value for placing the viewport in the middle of all screens
|
||||||
|
property real screensYMid: {
|
||||||
|
let yMin = Number.MAX_VALUE;
|
||||||
|
let yMax = Number.MIN_VALUE;
|
||||||
|
|
||||||
|
for (let i = 0; i < screens.length; i++) {
|
||||||
|
const geometry = screens[i].geometry;
|
||||||
|
yMin = Math.min(yMin, geometry.y);
|
||||||
|
yMax = Math.max(yMax, geometry.y + geometry.height);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (yMin + yMax) / 2 - (viewportResolution[1] / 2);
|
||||||
|
}
|
||||||
|
|
||||||
Displays {
|
Displays {
|
||||||
id: displays
|
id: displays
|
||||||
}
|
}
|
||||||
|
|
@ -37,7 +65,16 @@ Item {
|
||||||
|
|
||||||
property var monitorPlacements: {
|
property var monitorPlacements: {
|
||||||
const monitorSpacing = 0.0;
|
const monitorSpacing = 0.0;
|
||||||
return displays.monitorsToPlacements(fovDetails, screens.map(screen => screen.geometry), monitorSpacing);
|
const adjustedGeometries = screens.map(screen => {
|
||||||
|
const g = screen.geometry;
|
||||||
|
return {
|
||||||
|
x: g.x - screensXMid,
|
||||||
|
y: g.y - screensYMid,
|
||||||
|
width: g.width,
|
||||||
|
height: g.height
|
||||||
|
};
|
||||||
|
});
|
||||||
|
return displays.monitorsToPlacements(fovDetails, adjustedGeometries, monitorSpacing);
|
||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue