Changeset View
Changeset View
Standalone View
Standalone View
scene.cpp
Show First 20 Lines • Show All 748 Lines • ▼ Show 20 Line(s) | 748 | if (toplevel->shape()) { | |||
---|---|---|---|---|---|
749 | auto cookie = xcb_shape_get_rectangles_unchecked(connection(), toplevel->frameId(), XCB_SHAPE_SK_BOUNDING); | 749 | auto cookie = xcb_shape_get_rectangles_unchecked(connection(), toplevel->frameId(), XCB_SHAPE_SK_BOUNDING); | ||
750 | ScopedCPointer<xcb_shape_get_rectangles_reply_t> reply(xcb_shape_get_rectangles_reply(connection(), cookie, nullptr)); | 750 | ScopedCPointer<xcb_shape_get_rectangles_reply_t> reply(xcb_shape_get_rectangles_reply(connection(), cookie, nullptr)); | ||
751 | if (!reply.isNull()) { | 751 | if (!reply.isNull()) { | ||
752 | shape_region = QRegion(); | 752 | shape_region = QRegion(); | ||
753 | auto *rects = xcb_shape_get_rectangles_rectangles(reply.data()); | 753 | auto *rects = xcb_shape_get_rectangles_rectangles(reply.data()); | ||
754 | for (int i = 0; | 754 | for (int i = 0; | ||
755 | i < xcb_shape_get_rectangles_rectangles_length(reply.data()); | 755 | i < xcb_shape_get_rectangles_rectangles_length(reply.data()); | ||
756 | ++i) | 756 | ++i) | ||
757 | shape_region += QRegion(rects[ i ].x, rects[ i ].y, | 757 | shape_region += QRegion(Xcb::scK(rects[ i ].x), Xcb::scK(rects[ i ].y), | ||
758 | rects[ i ].width, rects[ i ].height); | 758 | Xcb::scK(rects[ i ].width), Xcb::scK(rects[ i ].height)); | ||
759 | // make sure the shape is sane (X is async, maybe even XShape is broken) | 759 | // make sure the shape is sane (X is async, maybe even XShape is broken) | ||
760 | shape_region &= QRegion(0, 0, width(), height()); | 760 | shape_region &= QRegion(0, 0, width(), height()); | ||
761 | } else | 761 | } else | ||
762 | shape_region = QRegion(); | 762 | shape_region = QRegion(); | ||
763 | } else | 763 | } else | ||
764 | shape_region = QRegion(0, 0, width(), height()); | 764 | shape_region = QRegion(0, 0, width(), height()); | ||
765 | shape_valid = true; | 765 | shape_valid = true; | ||
766 | } | 766 | } | ||
▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Line(s) | |||||
839 | } | 839 | } | ||
840 | 840 | | |||
841 | WindowQuadList Scene::Window::buildQuads(bool force) const | 841 | WindowQuadList Scene::Window::buildQuads(bool force) const | ||
842 | { | 842 | { | ||
843 | if (cached_quad_list != NULL && !force) | 843 | if (cached_quad_list != NULL && !force) | ||
844 | return *cached_quad_list; | 844 | return *cached_quad_list; | ||
845 | WindowQuadList ret; | 845 | WindowQuadList ret; | ||
846 | qreal scale = 1.0; | 846 | qreal scale = 1.0; | ||
847 | if (toplevel->surface()) { | 847 | if (auto s = toplevel->surface()) { | ||
848 | scale = toplevel->surface()->scale(); | 848 | scale = s->scale(); | ||
849 | } | 849 | } | ||
850 | 850 | | |||
851 | if (toplevel->clientPos() == QPoint(0, 0) && toplevel->clientSize() == toplevel->decorationRect().size()) | 851 | if (toplevel->clientPos() == QPoint(0, 0) && toplevel->clientSize() == toplevel->decorationRect().size()) | ||
852 | ret = makeQuads(WindowQuadContents, shape(), QPoint(0,0), scale); // has no decoration | 852 | ret = makeQuads(WindowQuadContents, shape(), QPoint(0,0), scale); // has no decoration | ||
853 | else { | 853 | else { | ||
854 | AbstractClient *client = dynamic_cast<AbstractClient*>(toplevel); | 854 | AbstractClient *client = dynamic_cast<AbstractClient*>(toplevel); | ||
855 | QRegion contents = clientShape(); | 855 | QRegion contents = clientShape(); | ||
856 | QRegion center = toplevel->transparentRect(); | 856 | QRegion center = toplevel->transparentRect(); | ||
▲ Show 20 Lines • Show All 302 Lines • Show Last 20 Lines |