Changeset View
Changeset View
Standalone View
Standalone View
events.cpp
Show First 20 Lines • Show All 260 Lines • ▼ Show 20 Line(s) | 260 | if (dirtyProtocols2 & NET::WM2DesktopLayout) | |||
---|---|---|---|---|---|
261 | VirtualDesktopManager::self()->updateLayout(); | 261 | VirtualDesktopManager::self()->updateLayout(); | ||
262 | } | 262 | } | ||
263 | 263 | | |||
264 | // events that should be handled before Clients can get them | 264 | // events that should be handled before Clients can get them | ||
265 | switch (eventType) { | 265 | switch (eventType) { | ||
266 | case XCB_BUTTON_PRESS: | 266 | case XCB_BUTTON_PRESS: | ||
267 | case XCB_BUTTON_RELEASE: { | 267 | case XCB_BUTTON_RELEASE: { | ||
268 | auto *mouseEvent = reinterpret_cast<xcb_button_press_event_t*>(e); | 268 | auto *mouseEvent = reinterpret_cast<xcb_button_press_event_t*>(e); | ||
269 | #ifdef KWIN_BUILD_TABBOX | | |||
270 | if (TabBox::TabBox::self()->isGrabbed()) { | | |||
271 | return TabBox::TabBox::self()->handleMouseEvent(mouseEvent); | | |||
272 | } | | |||
273 | #endif | | |||
274 | if (effects && static_cast<EffectsHandlerImpl*>(effects)->checkInputWindowEvent(mouseEvent)) { | 269 | if (effects && static_cast<EffectsHandlerImpl*>(effects)->checkInputWindowEvent(mouseEvent)) { | ||
275 | return true; | 270 | return true; | ||
276 | } | 271 | } | ||
277 | break; | 272 | break; | ||
278 | } | 273 | } | ||
279 | case XCB_MOTION_NOTIFY: { | 274 | case XCB_MOTION_NOTIFY: { | ||
280 | if (kwinApp()->operationMode() != Application::OperationModeX11) { | 275 | if (kwinApp()->operationMode() != Application::OperationModeX11) { | ||
281 | // ignore X11 pointer events generated on X windows if we are not on X | 276 | // ignore X11 pointer events generated on X windows if we are not on X | ||
282 | return true; | 277 | return true; | ||
283 | } | 278 | } | ||
284 | auto *mouseEvent = reinterpret_cast<xcb_motion_notify_event_t*>(e); | 279 | auto *mouseEvent = reinterpret_cast<xcb_motion_notify_event_t*>(e); | ||
285 | const QPoint rootPos(mouseEvent->root_x, mouseEvent->root_y); | 280 | const QPoint rootPos(mouseEvent->root_x, mouseEvent->root_y); | ||
286 | #ifdef KWIN_BUILD_TABBOX | | |||
287 | if (TabBox::TabBox::self()->isGrabbed()) { | | |||
288 | ScreenEdges::self()->check(rootPos, QDateTime::fromMSecsSinceEpoch(xTime()), true); | | |||
289 | return TabBox::TabBox::self()->handleMouseEvent(mouseEvent); | | |||
290 | } | | |||
291 | #endif | | |||
292 | if (effects && static_cast<EffectsHandlerImpl*>(effects)->checkInputWindowEvent(mouseEvent)) { | 281 | if (effects && static_cast<EffectsHandlerImpl*>(effects)->checkInputWindowEvent(mouseEvent)) { | ||
293 | return true; | 282 | return true; | ||
294 | } | 283 | } | ||
295 | if (QWidget::mouseGrabber()) { | 284 | if (QWidget::mouseGrabber()) { | ||
296 | ScreenEdges::self()->check(rootPos, QDateTime::fromMSecsSinceEpoch(xTime()), true); | 285 | ScreenEdges::self()->check(rootPos, QDateTime::fromMSecsSinceEpoch(xTime()), true); | ||
297 | } else { | 286 | } else { | ||
298 | ScreenEdges::self()->check(rootPos, QDateTime::fromMSecsSinceEpoch(mouseEvent->time)); | 287 | ScreenEdges::self()->check(rootPos, QDateTime::fromMSecsSinceEpoch(mouseEvent->time)); | ||
299 | } | 288 | } | ||
300 | break; | 289 | break; | ||
301 | } | 290 | } | ||
302 | case XCB_KEY_PRESS: { | | |||
303 | int keyQt; | | |||
304 | xcb_key_press_event_t *event = reinterpret_cast<xcb_key_press_event_t*>(e); | | |||
305 | KKeyServer::xcbKeyPressEventToQt(event, &keyQt); | | |||
306 | // qDebug() << "Workspace::keyPress( " << keyQt << " )"; | | |||
307 | #ifdef KWIN_BUILD_TABBOX | | |||
308 | if (TabBox::TabBox::self()->isGrabbed()) { | | |||
309 | TabBox::TabBox::self()->keyPress(keyQt); | | |||
310 | return true; | | |||
311 | } | | |||
312 | #endif | | |||
313 | break; | | |||
314 | } | | |||
315 | case XCB_KEY_RELEASE: | | |||
316 | #ifdef KWIN_BUILD_TABBOX | | |||
317 | if (TabBox::TabBox::self()->isGrabbed()) { | | |||
318 | TabBox::TabBox::self()->keyRelease(reinterpret_cast<xcb_key_release_event_t*>(e)); | | |||
319 | return true; | | |||
320 | } | | |||
321 | #endif | | |||
322 | break; | | |||
323 | case XCB_CONFIGURE_NOTIFY: | 291 | case XCB_CONFIGURE_NOTIFY: | ||
324 | if (reinterpret_cast<xcb_configure_notify_event_t*>(e)->event == rootWindow()) | 292 | if (reinterpret_cast<xcb_configure_notify_event_t*>(e)->event == rootWindow()) | ||
325 | markXStackingOrderAsDirty(); | 293 | markXStackingOrderAsDirty(); | ||
326 | break; | 294 | break; | ||
327 | }; | 295 | }; | ||
328 | 296 | | |||
329 | const xcb_window_t eventWindow = findEventWindow(e); | 297 | const xcb_window_t eventWindow = findEventWindow(e); | ||
330 | if (eventWindow != XCB_WINDOW_NONE) { | 298 | if (eventWindow != XCB_WINDOW_NONE) { | ||
▲ Show 20 Lines • Show All 1169 Lines • Show Last 20 Lines |