Changeset View
Changeset View
Standalone View
Standalone View
kcms/mouse/backends/kwin_wl/kwin_wl_device.cpp
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | 71 | { | |||
---|---|---|---|---|---|
92 | success &= valueLoader(m_pointerAcceleration); | 92 | success &= valueLoader(m_pointerAcceleration); | ||
93 | success &= valueLoader(m_pointerAccelerationProfileFlat); | 93 | success &= valueLoader(m_pointerAccelerationProfileFlat); | ||
94 | success &= valueLoader(m_pointerAccelerationProfileAdaptive); | 94 | success &= valueLoader(m_pointerAccelerationProfileAdaptive); | ||
95 | // natural scroll | 95 | // natural scroll | ||
96 | success &= valueLoader(m_supportsNaturalScroll); | 96 | success &= valueLoader(m_supportsNaturalScroll); | ||
97 | success &= valueLoader(m_naturalScrollEnabledByDefault); | 97 | success &= valueLoader(m_naturalScrollEnabledByDefault); | ||
98 | success &= valueLoader(m_naturalScroll); | 98 | success &= valueLoader(m_naturalScroll); | ||
99 | 99 | | |||
100 | success &= valueLoader(m_scrollFactor); | ||||
101 | | ||||
100 | return success; | 102 | return success; | ||
101 | } | 103 | } | ||
102 | 104 | | |||
103 | bool KWinWaylandDevice::getDefaultConfig() | 105 | bool KWinWaylandDevice::getDefaultConfig() | ||
104 | { | 106 | { | ||
105 | m_enabled.set(true); | 107 | m_enabled.set(true); | ||
106 | m_leftHanded.set(false); | 108 | m_leftHanded.set(false); | ||
107 | 109 | | |||
108 | m_pointerAcceleration.set(m_defaultPointerAcceleration); | 110 | m_pointerAcceleration.set(m_defaultPointerAcceleration); | ||
109 | m_pointerAccelerationProfileFlat.set(m_defaultPointerAccelerationProfileFlat); | 111 | m_pointerAccelerationProfileFlat.set(m_defaultPointerAccelerationProfileFlat); | ||
110 | m_pointerAccelerationProfileAdaptive.set(m_defaultPointerAccelerationProfileAdaptive); | 112 | m_pointerAccelerationProfileAdaptive.set(m_defaultPointerAccelerationProfileAdaptive); | ||
111 | 113 | | |||
112 | m_middleEmulation.set(m_middleEmulationEnabledByDefault); | 114 | m_middleEmulation.set(m_middleEmulationEnabledByDefault); | ||
113 | m_naturalScroll.set(m_naturalScrollEnabledByDefault); | 115 | m_naturalScroll.set(m_naturalScrollEnabledByDefault); | ||
114 | 116 | | |||
117 | m_scrollFactor.set(1.0); | ||||
118 | | ||||
115 | return true; | 119 | return true; | ||
116 | } | 120 | } | ||
117 | 121 | | |||
118 | bool KWinWaylandDevice::applyConfig() | 122 | bool KWinWaylandDevice::applyConfig() | ||
119 | { | 123 | { | ||
120 | QVector<QString> msgs; | 124 | QVector<QString> msgs; | ||
121 | 125 | | |||
122 | msgs << valueWriter(m_enabled) | 126 | msgs << valueWriter(m_enabled) | ||
123 | << valueWriter(m_leftHanded) | 127 | << valueWriter(m_leftHanded) | ||
124 | << valueWriter(m_pointerAcceleration) | 128 | << valueWriter(m_pointerAcceleration) | ||
125 | << valueWriter(m_pointerAccelerationProfileFlat) | 129 | << valueWriter(m_pointerAccelerationProfileFlat) | ||
126 | << valueWriter(m_pointerAccelerationProfileAdaptive) | 130 | << valueWriter(m_pointerAccelerationProfileAdaptive) | ||
127 | << valueWriter(m_middleEmulation) | 131 | << valueWriter(m_middleEmulation) | ||
128 | << valueWriter(m_naturalScroll); | 132 | << valueWriter(m_naturalScroll) | ||
133 | << valueWriter(m_scrollFactor); | ||||
129 | 134 | | |||
130 | bool success = true; | 135 | bool success = true; | ||
131 | QString error_msg; | 136 | QString error_msg; | ||
132 | 137 | | |||
133 | for (QString m : msgs) { | 138 | for (QString m : msgs) { | ||
134 | if (!m.isNull()) { | 139 | if (!m.isNull()) { | ||
135 | qCCritical(KCM_MOUSE) << "in error:" << m; | 140 | qCCritical(KCM_MOUSE) << "in error:" << m; | ||
136 | if (!success) { | 141 | if (!success) { | ||
Show All 13 Lines | |||||
150 | bool KWinWaylandDevice::isChangedConfig() const | 155 | bool KWinWaylandDevice::isChangedConfig() const | ||
151 | { | 156 | { | ||
152 | return m_enabled.changed() || | 157 | return m_enabled.changed() || | ||
153 | m_leftHanded.changed() || | 158 | m_leftHanded.changed() || | ||
154 | m_pointerAcceleration.changed() || | 159 | m_pointerAcceleration.changed() || | ||
155 | m_pointerAccelerationProfileFlat.changed() || | 160 | m_pointerAccelerationProfileFlat.changed() || | ||
156 | m_pointerAccelerationProfileAdaptive.changed() || | 161 | m_pointerAccelerationProfileAdaptive.changed() || | ||
157 | m_middleEmulation.changed() || | 162 | m_middleEmulation.changed() || | ||
163 | m_scrollFactor.changed() || | ||||
158 | m_naturalScroll.changed(); | 164 | m_naturalScroll.changed(); | ||
159 | } | 165 | } | ||
160 | 166 | | |||
161 | template<typename T> | 167 | template<typename T> | ||
162 | QString KWinWaylandDevice::valueWriter(const Prop<T> &prop) | 168 | QString KWinWaylandDevice::valueWriter(const Prop<T> &prop) | ||
163 | { | 169 | { | ||
164 | if (!prop.changed()) { | 170 | if (!prop.changed()) { | ||
165 | return QString(); | 171 | return QString(); | ||
Show All 27 Lines |