Changeset View
Changeset View
Standalone View
Standalone View
events.cpp
Show All 33 Lines | |||||
34 | #ifdef KWIN_BUILD_TABBOX | 34 | #ifdef KWIN_BUILD_TABBOX | ||
35 | #include "tabbox.h" | 35 | #include "tabbox.h" | ||
36 | #endif | 36 | #endif | ||
37 | #include "group.h" | 37 | #include "group.h" | ||
38 | #include "rules.h" | 38 | #include "rules.h" | ||
39 | #include "unmanaged.h" | 39 | #include "unmanaged.h" | ||
40 | #include "useractions.h" | 40 | #include "useractions.h" | ||
41 | #include "effects.h" | 41 | #include "effects.h" | ||
42 | #include "screenedge.h" | | |||
43 | #include "screens.h" | 42 | #include "screens.h" | ||
44 | #include "xcbutils.h" | 43 | #include "xcbutils.h" | ||
45 | 44 | | |||
46 | #include <KDecoration2/Decoration> | 45 | #include <KDecoration2/Decoration> | ||
47 | 46 | | |||
48 | #include <QApplication> | 47 | #include <QApplication> | ||
49 | #include <QDebug> | 48 | #include <QDebug> | ||
50 | #include <QHoverEvent> | 49 | #include <QHoverEvent> | ||
▲ Show 20 Lines • Show All 220 Lines • ▼ Show 20 Line(s) | 265 | case XCB_BUTTON_RELEASE: { | |||
271 | break; | 270 | break; | ||
272 | } | 271 | } | ||
273 | case XCB_MOTION_NOTIFY: { | 272 | case XCB_MOTION_NOTIFY: { | ||
274 | if (kwinApp()->operationMode() != Application::OperationModeX11) { | 273 | if (kwinApp()->operationMode() != Application::OperationModeX11) { | ||
275 | // ignore X11 pointer events generated on X windows if we are not on X | 274 | // ignore X11 pointer events generated on X windows if we are not on X | ||
276 | return true; | 275 | return true; | ||
277 | } | 276 | } | ||
278 | auto *mouseEvent = reinterpret_cast<xcb_motion_notify_event_t*>(e); | 277 | auto *mouseEvent = reinterpret_cast<xcb_motion_notify_event_t*>(e); | ||
279 | const QPoint rootPos(mouseEvent->root_x, mouseEvent->root_y); | | |||
280 | if (effects && static_cast<EffectsHandlerImpl*>(effects)->checkInputWindowEvent(mouseEvent)) { | 278 | if (effects && static_cast<EffectsHandlerImpl*>(effects)->checkInputWindowEvent(mouseEvent)) { | ||
281 | return true; | 279 | return true; | ||
282 | } | 280 | } | ||
283 | if (QWidget::mouseGrabber()) { | | |||
284 | ScreenEdges::self()->check(rootPos, QDateTime::fromMSecsSinceEpoch(xTime()), true); | | |||
285 | } else { | | |||
286 | ScreenEdges::self()->check(rootPos, QDateTime::fromMSecsSinceEpoch(mouseEvent->time)); | | |||
287 | } | | |||
288 | break; | 281 | break; | ||
289 | } | 282 | } | ||
290 | case XCB_CONFIGURE_NOTIFY: | 283 | case XCB_CONFIGURE_NOTIFY: | ||
291 | if (reinterpret_cast<xcb_configure_notify_event_t*>(e)->event == rootWindow()) | 284 | if (reinterpret_cast<xcb_configure_notify_event_t*>(e)->event == rootWindow()) | ||
292 | markXStackingOrderAsDirty(); | 285 | markXStackingOrderAsDirty(); | ||
293 | break; | 286 | break; | ||
294 | }; | 287 | }; | ||
295 | 288 | | |||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Line(s) | 369 | if (event->override_redirect) { | |||
378 | if (c == NULL) | 371 | if (c == NULL) | ||
379 | c = createUnmanaged(event->window); | 372 | c = createUnmanaged(event->window); | ||
380 | if (c) | 373 | if (c) | ||
381 | return c->windowEvent(e); | 374 | return c->windowEvent(e); | ||
382 | } | 375 | } | ||
383 | return (event->event != event->window); // hide wm typical event from Qt | 376 | return (event->event != event->window); // hide wm typical event from Qt | ||
384 | } | 377 | } | ||
385 | 378 | | |||
386 | case XCB_ENTER_NOTIFY: { | | |||
387 | if (ScreenEdges::self()->isEntered(reinterpret_cast<xcb_enter_notify_event_t*>(e))) | | |||
388 | return true; | | |||
389 | break; | | |||
390 | } | | |||
391 | case XCB_CONFIGURE_REQUEST: { | 379 | case XCB_CONFIGURE_REQUEST: { | ||
392 | const auto *event = reinterpret_cast<xcb_configure_request_event_t*>(e); | 380 | const auto *event = reinterpret_cast<xcb_configure_request_event_t*>(e); | ||
393 | if (event->parent == rootWindow()) { | 381 | if (event->parent == rootWindow()) { | ||
394 | uint32_t values[5] = { 0, 0, 0, 0, 0}; | 382 | uint32_t values[5] = { 0, 0, 0, 0, 0}; | ||
395 | const uint32_t value_mask = event->value_mask | 383 | const uint32_t value_mask = event->value_mask | ||
396 | & (XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT | XCB_CONFIG_WINDOW_BORDER_WIDTH); | 384 | & (XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT | XCB_CONFIG_WINDOW_BORDER_WIDTH); | ||
397 | int i = 0; | 385 | int i = 0; | ||
398 | if (value_mask & XCB_CONFIG_WINDOW_X) { | 386 | if (value_mask & XCB_CONFIG_WINDOW_X) { | ||
Show All 35 Lines | 415 | if (!currentInput.isNull() && (currentInput->focus == XCB_WINDOW_NONE || currentInput->focus == XCB_INPUT_FOCUS_POINTER_ROOT || lostFocusPointerToRoot)) { | |||
434 | else | 422 | else | ||
435 | focusToNull(); | 423 | focusToNull(); | ||
436 | } | 424 | } | ||
437 | } | 425 | } | ||
438 | } | 426 | } | ||
439 | // fall through | 427 | // fall through | ||
440 | case XCB_FOCUS_OUT: | 428 | case XCB_FOCUS_OUT: | ||
441 | return true; // always eat these, they would tell Qt that KWin is the active app | 429 | return true; // always eat these, they would tell Qt that KWin is the active app | ||
442 | case XCB_CLIENT_MESSAGE: | | |||
443 | if (ScreenEdges::self()->isEntered(reinterpret_cast<xcb_client_message_event_t*>(e))) | | |||
444 | return true; | | |||
445 | break; | | |||
446 | default: | 430 | default: | ||
447 | if (eventType == Xcb::Extensions::self()->randrNotifyEvent() && Xcb::Extensions::self()->isRandrAvailable()) { | 431 | if (eventType == Xcb::Extensions::self()->randrNotifyEvent() && Xcb::Extensions::self()->isRandrAvailable()) { | ||
448 | auto *event = reinterpret_cast<xcb_randr_screen_change_notify_event_t*>(e); | 432 | auto *event = reinterpret_cast<xcb_randr_screen_change_notify_event_t*>(e); | ||
449 | xcb_screen_t *screen = defaultScreen(); | 433 | xcb_screen_t *screen = defaultScreen(); | ||
450 | if (event->rotation & (XCB_RANDR_ROTATION_ROTATE_90 | XCB_RANDR_ROTATION_ROTATE_270)) { | 434 | if (event->rotation & (XCB_RANDR_ROTATION_ROTATE_90 | XCB_RANDR_ROTATION_ROTATE_270)) { | ||
451 | screen->width_in_pixels = event->height; | 435 | screen->width_in_pixels = event->height; | ||
452 | screen->height_in_pixels = event->width; | 436 | screen->height_in_pixels = event->width; | ||
453 | screen->width_in_millimeters = event->mheight; | 437 | screen->width_in_millimeters = event->mheight; | ||
▲ Show 20 Lines • Show All 998 Lines • Show Last 20 Lines |