Changeset View
Changeset View
Standalone View
Standalone View
events.cpp
Show First 20 Lines • Show All 685 Lines • ▼ Show 20 Line(s) | 672 | { | |||
---|---|---|---|---|---|
686 | } | 686 | } | ||
687 | 687 | | |||
688 | if (e->value_mask & XCB_CONFIG_WINDOW_BORDER_WIDTH) { | 688 | if (e->value_mask & XCB_CONFIG_WINDOW_BORDER_WIDTH) { | ||
689 | // first, get rid of a window border | 689 | // first, get rid of a window border | ||
690 | m_client.setBorderWidth(0); | 690 | m_client.setBorderWidth(0); | ||
691 | } | 691 | } | ||
692 | 692 | | |||
693 | if (e->value_mask & (XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_HEIGHT | XCB_CONFIG_WINDOW_WIDTH)) | 693 | if (e->value_mask & (XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_HEIGHT | XCB_CONFIG_WINDOW_WIDTH)) | ||
694 | configureRequest(e->value_mask, e->x, e->y, e->width, e->height, 0, false); | 694 | configureRequest(e->value_mask, Xcb::scK(e->x), Xcb::scK(e->y), Xcb::scK(e->width), Xcb::scK(e->height), 0, false); | ||
695 | 695 | | |||
696 | if (e->value_mask & XCB_CONFIG_WINDOW_STACK_MODE) | 696 | if (e->value_mask & XCB_CONFIG_WINDOW_STACK_MODE) | ||
697 | restackWindow(e->sibling, e->stack_mode, NET::FromApplication, userTime(), false); | 697 | restackWindow(e->sibling, e->stack_mode, NET::FromApplication, userTime(), false); | ||
698 | 698 | | |||
699 | // Sending a synthetic configure notify always is fine, even in cases where | 699 | // Sending a synthetic configure notify always is fine, even in cases where | ||
700 | // the ICCCM doesn't require this - it can be though of as 'the WM decided to move | 700 | // the ICCCM doesn't require this - it can be though of as 'the WM decided to move | ||
701 | // the window later'. The client should not cause that many configure request, | 701 | // the window later'. The client should not cause that many configure request, | ||
702 | // so this should not have any significant impact. With user moving/resizing | 702 | // so this should not have any significant impact. With user moving/resizing | ||
▲ Show 20 Lines • Show All 358 Lines • ▼ Show 20 Line(s) | 1060 | if ((state & buttonMask) == 0) { | |||
1061 | endMoveResize(); | 1061 | endMoveResize(); | ||
1062 | } | 1062 | } | ||
1063 | return true; | 1063 | return true; | ||
1064 | } | 1064 | } | ||
1065 | 1065 | | |||
1066 | // return value matters only when filtering events before decoration gets them | 1066 | // return value matters only when filtering events before decoration gets them | ||
1067 | bool Client::motionNotifyEvent(xcb_window_t w, int state, int x, int y, int x_root, int y_root) | 1067 | bool Client::motionNotifyEvent(xcb_window_t w, int state, int x, int y, int x_root, int y_root) | ||
1068 | { | 1068 | { | ||
1069 | x = Xcb::scK(x); | ||||
1070 | y = Xcb::scK(y); | ||||
1071 | x_root = Xcb::scK(x_root); | ||||
1072 | y_root = Xcb::scK(y_root); | ||||
1073 | | ||||
1069 | if (w == frameId() && isDecorated() && !isMinimized()) { | 1074 | if (w == frameId() && isDecorated() && !isMinimized()) { | ||
1070 | // TODO Mouse move event dependent on state | 1075 | // TODO Mouse move event dependent on state | ||
1071 | QHoverEvent event(QEvent::HoverMove, QPointF(x, y), QPointF(x, y)); | 1076 | QHoverEvent event(QEvent::HoverMove, QPointF(x, y), QPointF(x, y)); | ||
1072 | QCoreApplication::instance()->sendEvent(decoration(), &event); | 1077 | QCoreApplication::instance()->sendEvent(decoration(), &event); | ||
1073 | } | 1078 | } | ||
1074 | if (w != frameId() && w != inputId() && w != moveResizeGrabWindow()) | 1079 | if (w != frameId() && w != inputId() && w != moveResizeGrabWindow()) | ||
1075 | return true; // care only about the whole frame | 1080 | return true; // care only about the whole frame | ||
1076 | if (!isMoveResizePointerButtonDown()) { | 1081 | if (!isMoveResizePointerButtonDown()) { | ||
▲ Show 20 Lines • Show All 214 Lines • ▼ Show 20 Line(s) | 1230 | { | |||
1291 | } | 1296 | } | ||
1292 | return false; // don't eat events, even our own unmanaged widgets are tracked | 1297 | return false; // don't eat events, even our own unmanaged widgets are tracked | ||
1293 | } | 1298 | } | ||
1294 | 1299 | | |||
1295 | void Unmanaged::configureNotifyEvent(xcb_configure_notify_event_t *e) | 1300 | void Unmanaged::configureNotifyEvent(xcb_configure_notify_event_t *e) | ||
1296 | { | 1301 | { | ||
1297 | if (effects) | 1302 | if (effects) | ||
1298 | static_cast<EffectsHandlerImpl*>(effects)->checkInputWindowStacking(); // keep them on top | 1303 | static_cast<EffectsHandlerImpl*>(effects)->checkInputWindowStacking(); // keep them on top | ||
1299 | QRect newgeom(e->x, e->y, e->width, e->height); | 1304 | const QRect newgeom = Xcb::scK(QRect(e->x, e->y, e->width, e->height)); | ||
1300 | if (newgeom != geom) { | 1305 | if (newgeom != geom) { | ||
1301 | addWorkspaceRepaint(visibleRect()); // damage old area | 1306 | addWorkspaceRepaint(visibleRect()); // damage old area | ||
1302 | QRect old = geom; | 1307 | QRect old = geom; | ||
1303 | geom = newgeom; | 1308 | geom = newgeom; | ||
1304 | emit geometryChanged(); // update shadow region | 1309 | emit geometryChanged(); // update shadow region | ||
1305 | addRepaintFull(); | 1310 | addRepaintFull(); | ||
1306 | if (old.size() != geom.size()) | 1311 | if (old.size() != geom.size()) | ||
1307 | discardWindowPixmap(); | 1312 | discardWindowPixmap(); | ||
Show All 38 Lines |