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