Changeset View
Changeset View
Standalone View
Standalone View
events.cpp
Show First 20 Lines • Show All 259 Lines • ▼ Show 20 Line(s) | 254 | if (eventType == XCB_PROPERTY_NOTIFY || eventType == XCB_CLIENT_MESSAGE) { | |||
---|---|---|---|---|---|
260 | if (dirtyProtocols2 & NET::WM2DesktopLayout) | 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 | was_user_interaction = true; | | |||
269 | auto *mouseEvent = reinterpret_cast<xcb_button_press_event_t*>(e); | 268 | auto *mouseEvent = reinterpret_cast<xcb_button_press_event_t*>(e); | ||
270 | #ifdef KWIN_BUILD_TABBOX | 269 | #ifdef KWIN_BUILD_TABBOX | ||
271 | if (TabBox::TabBox::self()->isGrabbed()) { | 270 | if (TabBox::TabBox::self()->isGrabbed()) { | ||
272 | return TabBox::TabBox::self()->handleMouseEvent(mouseEvent); | 271 | return TabBox::TabBox::self()->handleMouseEvent(mouseEvent); | ||
273 | } | 272 | } | ||
274 | #endif | 273 | #endif | ||
275 | if (effects && static_cast<EffectsHandlerImpl*>(effects)->checkInputWindowEvent(mouseEvent)) { | 274 | if (effects && static_cast<EffectsHandlerImpl*>(effects)->checkInputWindowEvent(mouseEvent)) { | ||
276 | return true; | 275 | return true; | ||
Show All 19 Lines | 291 | #endif | |||
296 | if (QWidget::mouseGrabber()) { | 295 | if (QWidget::mouseGrabber()) { | ||
297 | ScreenEdges::self()->check(rootPos, QDateTime::fromMSecsSinceEpoch(xTime()), true); | 296 | ScreenEdges::self()->check(rootPos, QDateTime::fromMSecsSinceEpoch(xTime()), true); | ||
298 | } else { | 297 | } else { | ||
299 | ScreenEdges::self()->check(rootPos, QDateTime::fromMSecsSinceEpoch(mouseEvent->time)); | 298 | ScreenEdges::self()->check(rootPos, QDateTime::fromMSecsSinceEpoch(mouseEvent->time)); | ||
300 | } | 299 | } | ||
301 | break; | 300 | break; | ||
302 | } | 301 | } | ||
303 | case XCB_KEY_PRESS: { | 302 | case XCB_KEY_PRESS: { | ||
304 | was_user_interaction = true; | | |||
305 | int keyQt; | 303 | int keyQt; | ||
306 | xcb_key_press_event_t *event = reinterpret_cast<xcb_key_press_event_t*>(e); | 304 | xcb_key_press_event_t *event = reinterpret_cast<xcb_key_press_event_t*>(e); | ||
307 | KKeyServer::xcbKeyPressEventToQt(event, &keyQt); | 305 | KKeyServer::xcbKeyPressEventToQt(event, &keyQt); | ||
308 | // qDebug() << "Workspace::keyPress( " << keyQt << " )"; | 306 | // qDebug() << "Workspace::keyPress( " << keyQt << " )"; | ||
309 | if (Client *c = dynamic_cast<Client*>(movingClient)) { | 307 | if (Client *c = dynamic_cast<Client*>(movingClient)) { | ||
310 | c->keyPressEvent(keyQt, event->time); | 308 | c->keyPressEvent(keyQt, event->time); | ||
311 | return true; | 309 | return true; | ||
312 | } | 310 | } | ||
313 | #ifdef KWIN_BUILD_TABBOX | 311 | #ifdef KWIN_BUILD_TABBOX | ||
314 | if (TabBox::TabBox::self()->isGrabbed()) { | 312 | if (TabBox::TabBox::self()->isGrabbed()) { | ||
315 | TabBox::TabBox::self()->keyPress(keyQt); | 313 | TabBox::TabBox::self()->keyPress(keyQt); | ||
316 | return true; | 314 | return true; | ||
317 | } | 315 | } | ||
318 | #endif | 316 | #endif | ||
319 | break; | 317 | break; | ||
320 | } | 318 | } | ||
321 | case XCB_KEY_RELEASE: | 319 | case XCB_KEY_RELEASE: | ||
322 | was_user_interaction = true; | | |||
323 | #ifdef KWIN_BUILD_TABBOX | 320 | #ifdef KWIN_BUILD_TABBOX | ||
324 | if (TabBox::TabBox::self()->isGrabbed()) { | 321 | if (TabBox::TabBox::self()->isGrabbed()) { | ||
325 | TabBox::TabBox::self()->keyRelease(reinterpret_cast<xcb_key_release_event_t*>(e)); | 322 | TabBox::TabBox::self()->keyRelease(reinterpret_cast<xcb_key_release_event_t*>(e)); | ||
326 | return true; | 323 | return true; | ||
327 | } | 324 | } | ||
328 | #endif | 325 | #endif | ||
329 | break; | 326 | break; | ||
330 | case XCB_CONFIGURE_NOTIFY: | 327 | case XCB_CONFIGURE_NOTIFY: | ||
▲ Show 20 Lines • Show All 308 Lines • ▼ Show 20 Line(s) | 562 | { | |||
639 | case XCB_CONFIGURE_REQUEST: | 636 | case XCB_CONFIGURE_REQUEST: | ||
640 | configureRequestEvent(reinterpret_cast<xcb_configure_request_event_t*>(e)); | 637 | configureRequestEvent(reinterpret_cast<xcb_configure_request_event_t*>(e)); | ||
641 | break; | 638 | break; | ||
642 | case XCB_PROPERTY_NOTIFY: | 639 | case XCB_PROPERTY_NOTIFY: | ||
643 | propertyNotifyEvent(reinterpret_cast<xcb_property_notify_event_t*>(e)); | 640 | propertyNotifyEvent(reinterpret_cast<xcb_property_notify_event_t*>(e)); | ||
644 | break; | 641 | break; | ||
645 | case XCB_KEY_PRESS: | 642 | case XCB_KEY_PRESS: | ||
646 | updateUserTime(reinterpret_cast<xcb_key_press_event_t*>(e)->time); | 643 | updateUserTime(reinterpret_cast<xcb_key_press_event_t*>(e)->time); | ||
647 | workspace()->setWasUserInteraction(); | | |||
648 | break; | 644 | break; | ||
649 | case XCB_BUTTON_PRESS: { | 645 | case XCB_BUTTON_PRESS: { | ||
650 | const auto *event = reinterpret_cast<xcb_button_press_event_t*>(e); | 646 | const auto *event = reinterpret_cast<xcb_button_press_event_t*>(e); | ||
651 | updateUserTime(event->time); | 647 | updateUserTime(event->time); | ||
652 | workspace()->setWasUserInteraction(); | | |||
653 | buttonPressEvent(event->event, event->detail, event->state, | 648 | buttonPressEvent(event->event, event->detail, event->state, | ||
654 | event->event_x, event->event_y, event->root_x, event->root_y, event->time); | 649 | event->event_x, event->event_y, event->root_x, event->root_y, event->time); | ||
655 | break; | 650 | break; | ||
656 | } | 651 | } | ||
657 | case XCB_KEY_RELEASE: | 652 | case XCB_KEY_RELEASE: | ||
658 | // don't update user time on releases | 653 | // don't update user time on releases | ||
659 | // e.g. if the user presses Alt+F2, the Alt release | 654 | // e.g. if the user presses Alt+F2, the Alt release | ||
660 | // would appear as user input to the currently active window | 655 | // would appear as user input to the currently active window | ||
▲ Show 20 Lines • Show All 402 Lines • ▼ Show 20 Line(s) | 1057 | if (isMoveResizePointerButtonDown()) { | |||
1063 | if (w == wrapperId()) | 1058 | if (w == wrapperId()) | ||
1064 | xcb_allow_events(connection(), XCB_ALLOW_SYNC_POINTER, XCB_TIME_CURRENT_TIME); //xTime()); | 1059 | xcb_allow_events(connection(), XCB_ALLOW_SYNC_POINTER, XCB_TIME_CURRENT_TIME); //xTime()); | ||
1065 | return true; | 1060 | return true; | ||
1066 | } | 1061 | } | ||
1067 | 1062 | | |||
1068 | if (w == wrapperId() || w == frameId() || w == inputId()) { | 1063 | if (w == wrapperId() || w == frameId() || w == inputId()) { | ||
1069 | // FRAME neco s tohohle by se melo zpracovat, nez to dostane dekorace | 1064 | // FRAME neco s tohohle by se melo zpracovat, nez to dostane dekorace | ||
1070 | updateUserTime(time); | 1065 | updateUserTime(time); | ||
1071 | workspace()->setWasUserInteraction(); | | |||
1072 | const bool bModKeyHeld = modKeyDown(state); | 1066 | const bool bModKeyHeld = modKeyDown(state); | ||
1073 | 1067 | | |||
1074 | if (isSplash() | 1068 | if (isSplash() | ||
1075 | && button == XCB_BUTTON_INDEX_1 && !bModKeyHeld) { | 1069 | && button == XCB_BUTTON_INDEX_1 && !bModKeyHeld) { | ||
1076 | // hide splashwindow if the user clicks on it | 1070 | // hide splashwindow if the user clicks on it | ||
1077 | hideClient(true); | 1071 | hideClient(true); | ||
1078 | if (w == wrapperId()) | 1072 | if (w == wrapperId()) | ||
1079 | xcb_allow_events(connection(), XCB_ALLOW_SYNC_POINTER, XCB_TIME_CURRENT_TIME); //xTime()); | 1073 | xcb_allow_events(connection(), XCB_ALLOW_SYNC_POINTER, XCB_TIME_CURRENT_TIME); //xTime()); | ||
▲ Show 20 Lines • Show All 437 Lines • Show Last 20 Lines |