1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-26 23:21:37 +03:00

update Containment Windows Tracking with screens

--new screens implementation for Latte screen
tracking
This commit is contained in:
Michail Vourlakos 2019-06-09 02:08:47 +03:00
parent 353f7119cc
commit e25da5a668
4 changed files with 42 additions and 24 deletions

View File

@ -759,19 +759,36 @@ Window{
}
Text{
text: "Last Active Window (id)"+space
text: "Last Active Window Current Screen (id)"+space
}
Text{
text: latteView && latteView.windowsTracker ? latteView.windowsTracker.lastActiveWindow.winId : ""
text: latteView && latteView.windowsTracker ? latteView.windowsTracker.currentScreen.lastActiveWindow.winId : "--"
}
Text{
text: "Last Active Window (title)"+space
text: "Last Active Window Current Screen (title)"+space
}
Text{
text: latteView && latteView.windowsTracker ? latteView.windowsTracker.lastActiveWindow.display : ""
text: latteView && latteView.windowsTracker ? latteView.windowsTracker.currentScreen.lastActiveWindow.display : "--"
elide: Text.ElideRight
}
Text{
text: "Last Active Window All Screens (id)"+space
}
Text{
text: latteView && latteView.windowsTracker ? latteView.windowsTracker.allScreens.lastActiveWindow.winId : "--"
}
Text{
text: "Last Active Window All Screens (title)"+space
}
Text{
text: latteView && latteView.windowsTracker ? latteView.windowsTracker.allScreens.lastActiveWindow.display : "--"
elide: Text.ElideRight
}
}

View File

@ -65,26 +65,26 @@ Loader{
readonly property real currentBackgroundBrightness: item ? item.currentBrightness : -1000
readonly property bool applyingWindowColors: (root.windowColors === Latte.Types.ActiveWindowColors && latteView && latteView.windowsTracker
&& latteView.windowsTracker.activeWindowScheme)
&& selectedWindowsTracker.activeWindowScheme)
|| (root.windowColors === Latte.Types.TouchingWindowColors && latteView && latteView.windowsTracker
&& latteView.windowsTracker.touchingWindowScheme)
&& latteView.windowsTracker.currentScreen.touchingWindowScheme)
property QtObject applyTheme: {
if (latteView && latteView.windowsTracker && !root.hasExpandedApplet) {
if (root.windowColors === Latte.Types.ActiveWindowColors && latteView.windowsTracker.activeWindowScheme) {
return latteView.windowsTracker.activeWindowScheme;
if (root.windowColors === Latte.Types.ActiveWindowColors && selectedWindowsTracker.activeWindowScheme) {
return selectedWindowsTracker.activeWindowScheme;
}
if (root.windowColors === Latte.Types.TouchingWindowColors && latteView.windowsTracker.touchingWindowScheme) {
if (root.windowColors === Latte.Types.TouchingWindowColors && latteView.windowsTracker.currentScreen.touchingWindowScheme) {
//! we must track touching windows and when they are not ative
//! the active window scheme is used for convenience
if (latteView.windowsTracker.existsWindowTouching
&& !latteView.windowsTracker.activeWindowTouching
&& latteView.windowsTracker.activeWindowScheme) {
return latteView.windowsTracker.activeWindowScheme;
if (latteView.windowsTracker.currentScreen.existsWindowTouching
&& !latteView.windowsTracker.currentScreen.activeWindowTouching
&& latteView.windowsTracker.currentScreen.activeWindowScheme) {
return latteView.windowsTracker.currentScreen.activeWindowScheme;
}
return latteView.windowsTracker.touchingWindowScheme;
return latteView.windowsTracker.currentScreen.touchingWindowScheme;
}
}

View File

@ -69,7 +69,7 @@ Loader {
return;
}
if (latteView.windowsTracker.lastActiveWindow.canBeDragged()) {
if (selectedWindowsTracker.lastActiveWindow.canBeDragged()) {
lastPressX = mouse.x;
lastPressY = mouse.y;
dragWindowTimer.start();
@ -92,7 +92,7 @@ Loader {
var tryDrag = mainArea.pressed && (stepX>threshold || stepY>threshold);
if ( tryDrag && latteView.windowsTracker.lastActiveWindow.canBeDragged()) {
if ( tryDrag && selectedWindowsTracker.lastActiveWindow.canBeDragged()) {
dragWindowTimer.stop();
activateDragging();
}
@ -105,7 +105,7 @@ Loader {
dragWindowTimer.stop();
restoreGrabberTimer.stop();
latteView.windowsTracker.lastActiveWindow.requestToggleMaximized();
selectedWindowsTracker.lastActiveWindow.requestToggleMaximized();
}
onWheel: {
@ -169,7 +169,7 @@ Loader {
function activateDragging(){
latteView.disableGrabItemBehavior();
latteView.windowsTracker.requestMoveLastWindowFromCurrentScreen(mainArea.mouseX, mainArea.mouseY);
selectedWindowsTracker.requestMoveLastWindow(mainArea.mouseX, mainArea.mouseY);
restoreGrabberTimer.start();
}
@ -178,7 +178,7 @@ Loader {
id: dragWindowTimer
interval: 500
onTriggered: {
if (mainArea.pressed && latteView.windowsTracker.lastActiveWindow.canBeDragged()) {
if (mainArea.pressed && selectedWindowsTracker.lastActiveWindow.canBeDragged()) {
mainArea.activateDragging();
}
}

View File

@ -118,7 +118,7 @@ Item {
property bool drawShadowsExternal: panelShadowsActive && behaveAsPlasmaPanel && !visibilityManager.inTempHiding
property bool editMode: editModeVisual.inEditMode
property bool windowIsTouching: latteView && latteView.windowsTracker
&& (latteView.windowsTracker.activeWindowTouching || hasExpandedApplet)
&& (latteView.windowsTracker.currentScreen.activeWindowTouching || hasExpandedApplet)
property bool forceSolidPanel: (latteView && latteView.visibility
&& Latte.WindowSystem.compositingActive
@ -126,7 +126,7 @@ Item {
&& userShowPanelBackground
&& ( (plasmoid.configuration.solidBackgroundForMaximized
&& !(hasExpandedApplet && !plasmaBackgroundForPopups)
&& latteView.windowsTracker.existsWindowTouching)
&& latteView.windowsTracker.currentScreen.existsWindowTouching)
|| (hasExpandedApplet && plasmaBackgroundForPopups) ))
|| !Latte.WindowSystem.compositingActive
@ -135,8 +135,8 @@ Item {
&& Latte.WindowSystem.compositingActive
&& !inConfigureAppletsMode
&& !forceSolidPanel
&& !(windowColors === Latte.Types.TouchingWindowColors && latteView.windowsTracker.activeWindowTouching)
&& !(windowColors === Latte.Types.ActiveWindowColors && latteView.windowsTracker.existsWindowActive)
&& !(windowColors === Latte.Types.TouchingWindowColors && latteView.windowsTracker.currentScreen.activeWindowTouching)
&& !(windowColors === Latte.Types.ActiveWindowColors && selectedWindowsTracker.existsWindowActive)
property bool forcePanelForBusyBackground: userShowPanelBackground && root.forceTransparentPanel
&& colorizerManager.mustBeShown && colorizerManager.backgroundIsBusy
@ -263,7 +263,7 @@ Item {
if (( (plasmoid.configuration.panelShadows && !root.backgroundOnlyOnMaximized)
|| (plasmoid.configuration.panelShadows && root.backgroundOnlyOnMaximized && !root.forceTransparentPanel))
&& !(disablePanelShadowMaximized && latteView && latteView.windowsTracker
&& latteView.windowsTracker.activeWindowMaximized)) {
&& latteView.windowsTracker.currentScreen.activeWindowMaximized)) {
return true;
}
@ -409,6 +409,7 @@ Item {
property QtObject universalSettings: null
property QtObject layoutsManager: null
property QtObject viewLayout: latteView && latteView.layout ? latteView.layout : null
property QtObject selectedWindowsTracker: latteView && latteView.windowsTracker ? latteView.windowsTracker.currentScreen : null
// TO BE DELETED, if not needed: property int counter:0;