Fix flash before terminal spawns

This commit is contained in:
outfoxxed 2024-03-20 04:17:27 -07:00
parent 8364a3b9b9
commit eeb47e9dc1
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
4 changed files with 55 additions and 11 deletions

View file

@ -28,7 +28,7 @@ WlrLayershell {
property real endX: 0
property real endY: 0
readonly property bool bigEnough: width > 50 && height > 50
readonly property bool bigEnough: width > 300 && height > 150
border.color: bigEnough ? "#ee33ccff" : "#aa595959"
border.width: 1
@ -36,10 +36,10 @@ WlrLayershell {
color: "#66001017"
visible: selecting
x: Math.min(startX, endX)
y: Math.min(startY, endY)
width: Math.max(startX, endX) - x
height: Math.max(startY, endY) - y
x: Math.min(startX, endX) - border.width
y: Math.min(startY, endY) - border.width
width: Math.max(startX, endX) - x + border.width * 2
height: Math.max(startY, endY) - y + border.width * 2
function startSelection() {
initializing = true
@ -53,11 +53,12 @@ WlrLayershell {
function endSelection() {
const wasSelecting = selecting;
selecting = false;
initializing = false;
if (wasSelecting && bigEnough) {
selectionComplete(x, y, width, height);
selectionComplete(x + 1, y + 1, width - 2, height - 2);
} else {
selecting = false;
}
}
}
@ -80,8 +81,10 @@ WlrLayershell {
area.selecting = true;
}
area.endX = mouseX;
area.endY = mouseY;
if (selectionArea.selecting) {
area.endX = mouseX;
area.endY = mouseY;
}
}
}
}