on startup explicit dock faulty moving onPrimary

--multi-screen fix for explicit docks. There were
cases that explicit docks during startup were
moving to onprimary screen even though they shouldnt
based on the new multi-screens implementation.
Bug was tracked down at a faulty series of signals
that were overwriting dockView config values
to default values and that was creating the fault.
-- one more fix for multi-screens, a missing return
statement in case an explicit dock is called and its
edge at that specific screen is occuppied by an
onPrimary one.

BUG: 398219
FIXED-IN: 0.8.1
(cherry picked from commit 09fe5e385b)
v0.8
Michail Vourlakos 7 years ago
parent d39028104b
commit 10dfc62347

@ -99,9 +99,13 @@ DockView::DockView(Plasma::Corona *corona, QScreen *targetScreen, bool dockWindo
qDebug() << "dock view c++ containment changed 2...";
//! First load default values from file
restoreConfig();
//! Afterwards override that values in case during creation something different is needed
setDockWinBehavior(dockWindowBehavior);
restoreConfig();
//! Check the screen assigned to this dock
reconsiderScreen();
if (!m_visibility) {
@ -1928,8 +1932,8 @@ void DockView::saveConfig()
return;
auto config = this->containment()->config();
config.writeEntry("onPrimary", m_onPrimary);
config.writeEntry("dockWindowBehavior", m_dockWinBehavior);
config.writeEntry("onPrimary", onPrimary());
config.writeEntry("dockWindowBehavior", dockWinBehavior());
config.sync();
}
@ -1939,8 +1943,13 @@ void DockView::restoreConfig()
return;
auto config = this->containment()->config();
setOnPrimary(config.readEntry("onPrimary", true));
setDockWinBehavior(config.readEntry("dockWindowBehavior", true));
m_onPrimary = config.readEntry("onPrimary", true);
m_dockWinBehavior = config.readEntry("dockWindowBehavior", true);
//! Send changed signals at the end in order to be sure that saveConfig
//! wont rewrite default/invalid values
emit onPrimaryChanged();
emit dockWinBehaviorChanged();
}
//!END configuration functions

@ -911,6 +911,7 @@ void Layout::addDock(Plasma::Containment *containment, bool forceOnPrimary, int
if (primaryDockOccupyEdge(containment->location())) {
qDebug() << "reject : adding explicit dock, primary dock occupies edge at screen ! : " << connector;
return;
}
}
@ -973,6 +974,7 @@ void Layout::addDock(Plasma::Containment *containment, bool forceOnPrimary, int
//! force this special dock case to become primary
//! even though it isnt
if (forceOnPrimary) {
qDebug() << "Enforcing onPrimary:true as requested for DockView...";
dockView->setOnPrimary(true);
}

Loading…
Cancel
Save