Changeset View
Changeset View
Standalone View
Standalone View
keyboard_input.cpp
Show First 20 Lines • Show All 175 Lines • ▼ Show 20 Line(s) | 159 | if (!stacking.isEmpty()) { | |||
---|---|---|---|---|---|
176 | } while (it != stacking.begin()); | 176 | } while (it != stacking.begin()); | ||
177 | } | 177 | } | ||
178 | } else if (!input()->isSelectingWindow()) { | 178 | } else if (!input()->isSelectingWindow()) { | ||
179 | found = workspace()->activeClient(); | 179 | found = workspace()->activeClient(); | ||
180 | } | 180 | } | ||
181 | if (found && found->surface()) { | 181 | if (found && found->surface()) { | ||
182 | if (found->surface() != seat->focusedKeyboardSurface()) { | 182 | if (found->surface() != seat->focusedKeyboardSurface()) { | ||
183 | seat->setFocusedKeyboardSurface(found->surface()); | 183 | seat->setFocusedKeyboardSurface(found->surface()); | ||
184 | auto newKeyboard = seat->focusedKeyboard(); | | |||
185 | if (newKeyboard && newKeyboard->client() == waylandServer()->xWaylandConnection()) { | | |||
186 | // focus passed to an XWayland surface | | |||
187 | const auto selection = seat->selection(); | | |||
188 | auto xclipboard = waylandServer()->xclipboardSyncDataDevice(); | | |||
189 | if (xclipboard && selection != xclipboard.data()) { | | |||
190 | if (selection) { | | |||
191 | xclipboard->sendSelection(selection); | | |||
192 | } else { | | |||
193 | xclipboard->sendClearSelection(); | | |||
194 | } | | |||
195 | } | | |||
196 | } | | |||
197 | } | 184 | } | ||
198 | } else { | 185 | } else { | ||
199 | seat->setFocusedKeyboardSurface(nullptr); | 186 | seat->setFocusedKeyboardSurface(nullptr); | ||
200 | } | 187 | } | ||
201 | } | 188 | } | ||
202 | 189 | | |||
203 | void KeyboardInputRedirection::processKey(uint32_t key, InputRedirection::KeyboardKeyState state, uint32_t time, LibInput::Device *device) | 190 | void KeyboardInputRedirection::processKey(uint32_t key, InputRedirection::KeyboardKeyState state, uint32_t time, LibInput::Device *device) | ||
204 | { | 191 | { | ||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |