| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/plugins/platforms/xcb/qxcbscreen.cpp | 
| Switch to Source code | Preprocessed file | 
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||
| 7 | - | |||||||||||||||||||||||||
| 8 | QXcbVirtualDesktop::QXcbVirtualDesktop(QXcbConnection *connection, xcb_screen_t *screen, int number) | - | ||||||||||||||||||||||||
| 9 | : QXcbObject(connection) | - | ||||||||||||||||||||||||
| 10 | , m_screen(screen) | - | ||||||||||||||||||||||||
| 11 | , m_number(number) | - | ||||||||||||||||||||||||
| 12 | , m_xSettings(nullptr) | - | ||||||||||||||||||||||||
| 13 | { | - | ||||||||||||||||||||||||
| 14 | QByteArray cmAtomName("_NET_WM_CM_S"); | - | ||||||||||||||||||||||||
| 15 | cmAtomName += QByteArray::number(m_number); | - | ||||||||||||||||||||||||
| 16 | m_net_wm_cm_atom = connection->internAtom(cmAtomName.constData()); | - | ||||||||||||||||||||||||
| 17 | m_compositingActive = connection->getSelectionOwner(m_net_wm_cm_atom); | - | ||||||||||||||||||||||||
| 18 | - | |||||||||||||||||||||||||
| 19 | m_workArea = getWorkArea(); | - | ||||||||||||||||||||||||
| 20 | } executed 135 times by 5 tests:  end of blockExecuted by: 
  | 135 | ||||||||||||||||||||||||
| 21 | - | |||||||||||||||||||||||||
| 22 | QXcbVirtualDesktop::~QXcbVirtualDesktop() | - | ||||||||||||||||||||||||
| 23 | { | - | ||||||||||||||||||||||||
| 24 | delete m_xSettings; | - | ||||||||||||||||||||||||
| 25 | } executed 347 times by 219 tests:  end of blockExecuted by: 
  | 347 | ||||||||||||||||||||||||
| 26 | - | |||||||||||||||||||||||||
| 27 | QXcbScreen *QXcbVirtualDesktop::screenAt(const QPoint &pos) const | - | ||||||||||||||||||||||||
| 28 | { | - | ||||||||||||||||||||||||
| 29 | const auto screens = connection()->screens(); | - | ||||||||||||||||||||||||
| 30 | for (QXcbScreen *screen : screens) { | - | ||||||||||||||||||||||||
| 31 |         if (screen->virtualDesktop() == this
 
  | 0 | ||||||||||||||||||||||||
| 32 |             return never executed:   screen;return screen;never executed:  return screen; | 0 | ||||||||||||||||||||||||
| 33 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 34 |     return never executed:   nullptr;return nullptr;never executed:  return nullptr; | 0 | ||||||||||||||||||||||||
| 35 | } | - | ||||||||||||||||||||||||
| 36 | - | |||||||||||||||||||||||||
| 37 | void QXcbVirtualDesktop::addScreen(QPlatformScreen *s) | - | ||||||||||||||||||||||||
| 38 | { | - | ||||||||||||||||||||||||
| 39 | ((QXcbScreen *) s)->isPrimary() ? m_screens.prepend(s) : m_screens.append(s); | - | ||||||||||||||||||||||||
| 40 | } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 41 | - | |||||||||||||||||||||||||
| 42 | void QXcbVirtualDesktop::setPrimaryScreen(QPlatformScreen *s) | - | ||||||||||||||||||||||||
| 43 | { | - | ||||||||||||||||||||||||
| 44 | const int idx = m_screens.indexOf(s); | - | ||||||||||||||||||||||||
| 45 | ((!(idx > -1)) ? qt_assert("idx > -1",__FILE__,95) : qt_noop()); | - | ||||||||||||||||||||||||
| 46 | m_screens.swap(0, idx); | - | ||||||||||||||||||||||||
| 47 | } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 48 | - | |||||||||||||||||||||||||
| 49 | QXcbXSettings *QXcbVirtualDesktop::xSettings() const | - | ||||||||||||||||||||||||
| 50 | { | - | ||||||||||||||||||||||||
| 51 |     if (!m_xSettings
  | 19-57 | ||||||||||||||||||||||||
| 52 | QXcbVirtualDesktop *self = const_cast<QXcbVirtualDesktop *>(this); | - | ||||||||||||||||||||||||
| 53 | self->m_xSettings = new QXcbXSettings(self); | - | ||||||||||||||||||||||||
| 54 |     } executed 19 times by 19 tests:  end of blockExecuted by: 
  | 19 | ||||||||||||||||||||||||
| 55 |     return executed 76 times by 38 tests:   m_xSettings;return m_xSettings;Executed by: 
 executed 76 times by 38 tests:  return m_xSettings;Executed by: 
  | 76 | ||||||||||||||||||||||||
| 56 | } | - | ||||||||||||||||||||||||
| 57 | - | |||||||||||||||||||||||||
| 58 | bool QXcbVirtualDesktop::compositingActive() const | - | ||||||||||||||||||||||||
| 59 | { | - | ||||||||||||||||||||||||
| 60 |     if (connection()->hasXFixes()
  | 0 | ||||||||||||||||||||||||
| 61 |         return never executed:   m_compositingActive;return m_compositingActive;never executed:  return m_compositingActive; | 0 | ||||||||||||||||||||||||
| 62 | else | - | ||||||||||||||||||||||||
| 63 |         return never executed:   connection()->getSelectionOwner(m_net_wm_cm_atom);return connection()->getSelectionOwner(m_net_wm_cm_atom);never executed:  return connection()->getSelectionOwner(m_net_wm_cm_atom); | 0 | ||||||||||||||||||||||||
| 64 | } | - | ||||||||||||||||||||||||
| 65 | - | |||||||||||||||||||||||||
| 66 | void QXcbVirtualDesktop::handleXFixesSelectionNotify(xcb_xfixes_selection_notify_event_t *notify_event) | - | ||||||||||||||||||||||||
| 67 | { | - | ||||||||||||||||||||||||
| 68 |     if (notify_event->selection == m_net_wm_cm_atom
  | 0-67 | ||||||||||||||||||||||||
| 69 |         m_compositingActive = notify_event->owner; never executed:  m_compositingActive = notify_event->owner; | 0 | ||||||||||||||||||||||||
| 70 | } executed 67 times by 6 tests:  end of blockExecuted by: 
  | 67 | ||||||||||||||||||||||||
| 71 | - | |||||||||||||||||||||||||
| 72 | void QXcbVirtualDesktop::subscribeToXFixesSelectionNotify() | - | ||||||||||||||||||||||||
| 73 | { | - | ||||||||||||||||||||||||
| 74 |     if (connection()->hasXFixes()
  | 0-135 | ||||||||||||||||||||||||
| 75 | const uint32_t mask = XCB_XFIXES_SELECTION_EVENT_MASK_SET_SELECTION_OWNER | | - | ||||||||||||||||||||||||
| 76 | XCB_XFIXES_SELECTION_EVENT_MASK_SELECTION_WINDOW_DESTROY | | - | ||||||||||||||||||||||||
| 77 | XCB_XFIXES_SELECTION_EVENT_MASK_SELECTION_CLIENT_CLOSE; | - | ||||||||||||||||||||||||
| 78 | xcb_xfixes_select_selection_input_checked(xcb_connection(), connection()->getQtSelectionOwner(), m_net_wm_cm_atom, mask); | - | ||||||||||||||||||||||||
| 79 |     } executed 135 times by 5 tests:  end of blockExecuted by: 
  | 135 | ||||||||||||||||||||||||
| 80 | } executed 135 times by 5 tests:  end of blockExecuted by: 
  | 135 | ||||||||||||||||||||||||
| 81 | - | |||||||||||||||||||||||||
| 82 | QRect QXcbVirtualDesktop::getWorkArea() const | - | ||||||||||||||||||||||||
| 83 | { | - | ||||||||||||||||||||||||
| 84 | QRect r; | - | ||||||||||||||||||||||||
| 85 | xcb_get_property_reply_t * workArea = | - | ||||||||||||||||||||||||
| 86 | xcb_get_property_reply(xcb_connection(), | - | ||||||||||||||||||||||||
| 87 | xcb_get_property_unchecked(xcb_connection(), false, screen()->root, | - | ||||||||||||||||||||||||
| 88 | atom(QXcbAtom::_NET_WORKAREA), | - | ||||||||||||||||||||||||
| 89 | XCB_ATOM_CARDINAL, 0, 1024), __null); | - | ||||||||||||||||||||||||
| 90 |     if (workArea
 
 
 
  | 0-135 | ||||||||||||||||||||||||
| 91 | - | |||||||||||||||||||||||||
| 92 | - | |||||||||||||||||||||||||
| 93 | - | |||||||||||||||||||||||||
| 94 | - | |||||||||||||||||||||||||
| 95 | - | |||||||||||||||||||||||||
| 96 | - | |||||||||||||||||||||||||
| 97 | uint32_t *geom = (uint32_t*)xcb_get_property_value(workArea); | - | ||||||||||||||||||||||||
| 98 | r = QRect(geom[0], geom[1], geom[2], geom[3]); | - | ||||||||||||||||||||||||
| 99 |     } executed 135 times by 5 tests:   else {end of blockExecuted by: 
  | 135 | ||||||||||||||||||||||||
| 100 | r = QRect(QPoint(), size()); | - | ||||||||||||||||||||||||
| 101 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 102 | free(workArea); | - | ||||||||||||||||||||||||
| 103 |     return executed 135 times by 5 tests:   r;return r;Executed by: 
 executed 135 times by 5 tests:  return r;Executed by: 
  | 135 | ||||||||||||||||||||||||
| 104 | } | - | ||||||||||||||||||||||||
| 105 | - | |||||||||||||||||||||||||
| 106 | void QXcbVirtualDesktop::updateWorkArea() | - | ||||||||||||||||||||||||
| 107 | { | - | ||||||||||||||||||||||||
| 108 | QRect workArea = getWorkArea(); | - | ||||||||||||||||||||||||
| 109 |     if (m_workArea != workArea
  | 0 | ||||||||||||||||||||||||
| 110 | m_workArea = workArea; | - | ||||||||||||||||||||||||
| 111 | for (QPlatformScreen *screen : qAsConst(m_screens)) | - | ||||||||||||||||||||||||
| 112 |             (( never executed:  QXcbScreen *)screen)->updateAvailableGeometry();((QXcbScreen *)screen)->updateAvailableGeometry();never executed:  ((QXcbScreen *)screen)->updateAvailableGeometry(); | 0 | ||||||||||||||||||||||||
| 113 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 114 | } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 115 | - | |||||||||||||||||||||||||
| 116 | static inline QSizeF sizeInMillimeters(const QSize &size, const QDpi &dpi) | - | ||||||||||||||||||||||||
| 117 | { | - | ||||||||||||||||||||||||
| 118 |     return executed 135 times by 5 tests:   QSizeF(Q_MM_PER_INCH * size.width() / dpi.first,return QSizeF(Q_MM_PER_INCH * size.width() / dpi.first, Q_MM_PER_INCH * size.height() / dpi.second);Executed by: 
 executed 135 times by 5 tests:  return QSizeF(Q_MM_PER_INCH * size.width() / dpi.first, Q_MM_PER_INCH * size.height() / dpi.second);Executed by: 
  | 135 | ||||||||||||||||||||||||
| 119 |                   Q_MM_PER_INCH * size.height() / dpi.second); executed 135 times by 5 tests:  return QSizeF(Q_MM_PER_INCH * size.width() / dpi.first, Q_MM_PER_INCH * size.height() / dpi.second);Executed by: 
  | 135 | ||||||||||||||||||||||||
| 120 | } | - | ||||||||||||||||||||||||
| 121 | - | |||||||||||||||||||||||||
| 122 | QXcbScreen::QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, | - | ||||||||||||||||||||||||
| 123 | xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *output, | - | ||||||||||||||||||||||||
| 124 | const xcb_xinerama_screen_info_t *xineramaScreenInfo, int xineramaScreenIdx) | - | ||||||||||||||||||||||||
| 125 | : QXcbObject(connection) | - | ||||||||||||||||||||||||
| 126 | , m_virtualDesktop(virtualDesktop) | - | ||||||||||||||||||||||||
| 127 | , m_output(outputId) | - | ||||||||||||||||||||||||
| 128 | , m_crtc(output ? output->crtc : 0L) | - | ||||||||||||||||||||||||
| 129 | , m_mode(0L) | - | ||||||||||||||||||||||||
| 130 | , m_primary(false) | - | ||||||||||||||||||||||||
| 131 | , m_rotation(XCB_RANDR_ROTATION_ROTATE_0) | - | ||||||||||||||||||||||||
| 132 | , m_outputName(getOutputName(output)) | - | ||||||||||||||||||||||||
| 133 | , m_outputSizeMillimeters(output ? QSize(output->mm_width, output->mm_height) : QSize()) | - | ||||||||||||||||||||||||
| 134 | , m_virtualSize(virtualDesktop->size()) | - | ||||||||||||||||||||||||
| 135 | , m_virtualSizeMillimeters(virtualDesktop->physicalSize()) | - | ||||||||||||||||||||||||
| 136 | , m_orientation(Qt::PrimaryOrientation) | - | ||||||||||||||||||||||||
| 137 | , m_refreshRate(60) | - | ||||||||||||||||||||||||
| 138 | , m_forcedDpi(-1) | - | ||||||||||||||||||||||||
| 139 | , m_pixelDensity(1) | - | ||||||||||||||||||||||||
| 140 | , m_hintStyle(QFontEngine::HintStyle(-1)) | - | ||||||||||||||||||||||||
| 141 | , m_noFontHinting(false) | - | ||||||||||||||||||||||||
| 142 | , m_subpixelType(QFontEngine::SubpixelAntialiasingType(-1)) | - | ||||||||||||||||||||||||
| 143 | , m_antialiasingEnabled(-1) | - | ||||||||||||||||||||||||
| 144 | { | - | ||||||||||||||||||||||||
| 145 |     if (connection->hasXRandr()
  | 0-135 | ||||||||||||||||||||||||
| 146 | xcb_randr_select_input(xcb_connection(), screen()->root, true); | - | ||||||||||||||||||||||||
| 147 | xcb_randr_get_crtc_info_cookie_t crtcCookie = | - | ||||||||||||||||||||||||
| 148 | xcb_randr_get_crtc_info_unchecked(xcb_connection(), m_crtc, output ? output->timestamp : 0); | - | ||||||||||||||||||||||||
| 149 | xcb_randr_get_crtc_info_reply_t *crtc = | - | ||||||||||||||||||||||||
| 150 | xcb_randr_get_crtc_info_reply(xcb_connection(), crtcCookie, __null); | - | ||||||||||||||||||||||||
| 151 |         if (crtc
  | 0-135 | ||||||||||||||||||||||||
| 152 | updateGeometry(QRect(crtc->x, crtc->y, crtc->width, crtc->height), crtc->rotation); | - | ||||||||||||||||||||||||
| 153 | updateRefreshRate(crtc->mode); | - | ||||||||||||||||||||||||
| 154 | free(crtc); | - | ||||||||||||||||||||||||
| 155 |         } executed 135 times by 5 tests:  end of blockExecuted by: 
  | 135 | ||||||||||||||||||||||||
| 156 |     } executed 135 times by 5 tests:   else if (xineramaScreenInfoend of blockExecuted by: 
 
  | 0-135 | ||||||||||||||||||||||||
| 157 | m_geometry = QRect(xineramaScreenInfo->x_org, xineramaScreenInfo->y_org, | - | ||||||||||||||||||||||||
| 158 | xineramaScreenInfo->width, xineramaScreenInfo->height); | - | ||||||||||||||||||||||||
| 159 | m_availableGeometry = m_geometry & m_virtualDesktop->workArea(); | - | ||||||||||||||||||||||||
| 160 | m_sizeMillimeters = sizeInMillimeters(m_geometry.size(), virtualDpi()); | - | ||||||||||||||||||||||||
| 161 |         if (xineramaScreenIdx > -1
  | 0 | ||||||||||||||||||||||||
| 162 |             m_outputName += QLatin1Char('-') + QString::number(xineramaScreenIdx); never executed:  m_outputName += QLatin1Char('-') + QString::number(xineramaScreenIdx); | 0 | ||||||||||||||||||||||||
| 163 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 164 | - | |||||||||||||||||||||||||
| 165 |     if (m_geometry.isEmpty()
  | 0-135 | ||||||||||||||||||||||||
| 166 |         m_geometry = QRect(QPoint(), m_virtualSize); never executed:  m_geometry = QRect(QPoint(), m_virtualSize); | 0 | ||||||||||||||||||||||||
| 167 | - | |||||||||||||||||||||||||
| 168 |     if (m_availableGeometry.isEmpty()
  | 0-135 | ||||||||||||||||||||||||
| 169 |         m_availableGeometry = m_geometry & m_virtualDesktop->workArea(); never executed:  m_availableGeometry = m_geometry & m_virtualDesktop->workArea(); | 0 | ||||||||||||||||||||||||
| 170 | - | |||||||||||||||||||||||||
| 171 |     if (m_sizeMillimeters.isEmpty()
  | 0-135 | ||||||||||||||||||||||||
| 172 |         m_sizeMillimeters = m_virtualSizeMillimeters; never executed:  m_sizeMillimeters = m_virtualSizeMillimeters; | 0 | ||||||||||||||||||||||||
| 173 | - | |||||||||||||||||||||||||
| 174 | readXResources(); | - | ||||||||||||||||||||||||
| 175 | - | |||||||||||||||||||||||||
| 176 | QScopedPointer<xcb_get_window_attributes_reply_t, QScopedPointerPodDeleter> rootAttribs( | - | ||||||||||||||||||||||||
| 177 | xcb_get_window_attributes_reply(xcb_connection(), | - | ||||||||||||||||||||||||
| 178 | xcb_get_window_attributes_unchecked(xcb_connection(), screen()->root), __null)); | - | ||||||||||||||||||||||||
| 179 |     const quint32 existingEventMask = rootAttribs.isNull()
  | 0-135 | ||||||||||||||||||||||||
| 180 | - | |||||||||||||||||||||||||
| 181 | const quint32 mask = XCB_CW_EVENT_MASK; | - | ||||||||||||||||||||||||
| 182 | const quint32 values[] = { | - | ||||||||||||||||||||||||
| 183 | - | |||||||||||||||||||||||||
| 184 | XCB_EVENT_MASK_ENTER_WINDOW | - | ||||||||||||||||||||||||
| 185 | | XCB_EVENT_MASK_LEAVE_WINDOW | - | ||||||||||||||||||||||||
| 186 | | XCB_EVENT_MASK_PROPERTY_CHANGE | - | ||||||||||||||||||||||||
| 187 | | XCB_EVENT_MASK_STRUCTURE_NOTIFY | - | ||||||||||||||||||||||||
| 188 | | existingEventMask | - | ||||||||||||||||||||||||
| 189 | }; | - | ||||||||||||||||||||||||
| 190 | - | |||||||||||||||||||||||||
| 191 | xcb_change_window_attributes(xcb_connection(), screen()->root, mask, values); | - | ||||||||||||||||||||||||
| 192 | - | |||||||||||||||||||||||||
| 193 | xcb_get_property_reply_t *reply = | - | ||||||||||||||||||||||||
| 194 | xcb_get_property_reply(xcb_connection(), | - | ||||||||||||||||||||||||
| 195 | xcb_get_property_unchecked(xcb_connection(), false, screen()->root, | - | ||||||||||||||||||||||||
| 196 | atom(QXcbAtom::_NET_SUPPORTING_WM_CHECK), | - | ||||||||||||||||||||||||
| 197 | XCB_ATOM_WINDOW, 0, 1024), __null); | - | ||||||||||||||||||||||||
| 198 | - | |||||||||||||||||||||||||
| 199 |     if (reply
 
 
  | 0-135 | ||||||||||||||||||||||||
| 200 | xcb_window_t windowManager = *((xcb_window_t *)xcb_get_property_value(reply)); | - | ||||||||||||||||||||||||
| 201 | - | |||||||||||||||||||||||||
| 202 |         if (windowManager != XCB_WINDOW_NONE
  | 0-135 | ||||||||||||||||||||||||
| 203 | xcb_get_property_reply_t *windowManagerReply = | - | ||||||||||||||||||||||||
| 204 | xcb_get_property_reply(xcb_connection(), | - | ||||||||||||||||||||||||
| 205 | xcb_get_property_unchecked(xcb_connection(), false, windowManager, | - | ||||||||||||||||||||||||
| 206 | atom(QXcbAtom::_NET_WM_NAME), | - | ||||||||||||||||||||||||
| 207 | atom(QXcbAtom::UTF8_STRING), 0, 1024), __null); | - | ||||||||||||||||||||||||
| 208 |             if (windowManagerReply
 
 
  | 0-135 | ||||||||||||||||||||||||
| 209 | m_windowManagerName = QString::fromUtf8((const char *)xcb_get_property_value(windowManagerReply), xcb_get_property_value_length(windowManagerReply)); | - | ||||||||||||||||||||||||
| 210 |             } executed 135 times by 5 tests:  end of blockExecuted by: 
  | 135 | ||||||||||||||||||||||||
| 211 | - | |||||||||||||||||||||||||
| 212 | free(windowManagerReply); | - | ||||||||||||||||||||||||
| 213 |         } executed 135 times by 5 tests:  end of blockExecuted by: 
  | 135 | ||||||||||||||||||||||||
| 214 |     } executed 135 times by 5 tests:  end of blockExecuted by: 
  | 135 | ||||||||||||||||||||||||
| 215 | free(reply); | - | ||||||||||||||||||||||||
| 216 | - | |||||||||||||||||||||||||
| 217 | const xcb_query_extension_reply_t *sync_reply = xcb_get_extension_data(xcb_connection(), &xcb_sync_id); | - | ||||||||||||||||||||||||
| 218 |     if (!sync_reply
 
  | 0-135 | ||||||||||||||||||||||||
| 219 |         m_syncRequestSupported = false; never executed:  m_syncRequestSupported = false; | 0 | ||||||||||||||||||||||||
| 220 | else | - | ||||||||||||||||||||||||
| 221 |         m_syncRequestSupported = true; executed 135 times by 5 tests:  m_syncRequestSupported = true;Executed by: 
  | 135 | ||||||||||||||||||||||||
| 222 | - | |||||||||||||||||||||||||
| 223 | xcb_depth_iterator_t depth_iterator = | - | ||||||||||||||||||||||||
| 224 | xcb_screen_allowed_depths_iterator(screen()); | - | ||||||||||||||||||||||||
| 225 | - | |||||||||||||||||||||||||
| 226 |     while (depth_iterator.rem
  | 135-945 | ||||||||||||||||||||||||
| 227 | xcb_depth_t *depth = depth_iterator.data; | - | ||||||||||||||||||||||||
| 228 | xcb_visualtype_iterator_t visualtype_iterator = | - | ||||||||||||||||||||||||
| 229 | xcb_depth_visuals_iterator(depth); | - | ||||||||||||||||||||||||
| 230 | - | |||||||||||||||||||||||||
| 231 |         while (visualtype_iterator.rem
  | 945-16200 | ||||||||||||||||||||||||
| 232 | xcb_visualtype_t *visualtype = visualtype_iterator.data; | - | ||||||||||||||||||||||||
| 233 | m_visuals.insert(visualtype->visual_id, *visualtype); | - | ||||||||||||||||||||||||
| 234 | m_visualDepths.insert(visualtype->visual_id, depth->depth); | - | ||||||||||||||||||||||||
| 235 | xcb_visualtype_next(&visualtype_iterator); | - | ||||||||||||||||||||||||
| 236 |         } executed 16200 times by 5 tests:  end of blockExecuted by: 
  | 16200 | ||||||||||||||||||||||||
| 237 | - | |||||||||||||||||||||||||
| 238 | xcb_depth_next(&depth_iterator); | - | ||||||||||||||||||||||||
| 239 |     } executed 945 times by 5 tests:  end of blockExecuted by: 
  | 945 | ||||||||||||||||||||||||
| 240 | - | |||||||||||||||||||||||||
| 241 | m_cursor = new QXcbCursor(connection, this); | - | ||||||||||||||||||||||||
| 242 | } executed 135 times by 5 tests:  end of blockExecuted by: 
  | 135 | ||||||||||||||||||||||||
| 243 | - | |||||||||||||||||||||||||
| 244 | QXcbScreen::~QXcbScreen() | - | ||||||||||||||||||||||||
| 245 | { | - | ||||||||||||||||||||||||
| 246 | delete m_cursor; | - | ||||||||||||||||||||||||
| 247 | } executed 347 times by 219 tests:  end of blockExecuted by: 
  | 347 | ||||||||||||||||||||||||
| 248 | - | |||||||||||||||||||||||||
| 249 | QString QXcbScreen::getOutputName(xcb_randr_get_output_info_reply_t *outputInfo) | - | ||||||||||||||||||||||||
| 250 | { | - | ||||||||||||||||||||||||
| 251 | QString name; | - | ||||||||||||||||||||||||
| 252 |     if (outputInfo
  | 0-135 | ||||||||||||||||||||||||
| 253 | name = QString::fromUtf8((const char*)xcb_randr_get_output_info_name(outputInfo), | - | ||||||||||||||||||||||||
| 254 | xcb_randr_get_output_info_name_length(outputInfo)); | - | ||||||||||||||||||||||||
| 255 |     } executed 135 times by 5 tests:   else {end of blockExecuted by: 
  | 135 | ||||||||||||||||||||||||
| 256 | QByteArray displayName = connection()->displayName(); | - | ||||||||||||||||||||||||
| 257 | int dotPos = displayName.lastIndexOf('.'); | - | ||||||||||||||||||||||||
| 258 |         if (dotPos != -1
  | 0 | ||||||||||||||||||||||||
| 259 |             displayName.truncate(dotPos); never executed:  displayName.truncate(dotPos); | 0 | ||||||||||||||||||||||||
| 260 | name = QString::fromLocal8Bit(displayName) + QLatin1Char('.') | - | ||||||||||||||||||||||||
| 261 | + QString::number(m_virtualDesktop->number()); | - | ||||||||||||||||||||||||
| 262 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 263 |     return executed 135 times by 5 tests:   name;return name;Executed by: 
 executed 135 times by 5 tests:  return name;Executed by: 
  | 135 | ||||||||||||||||||||||||
| 264 | } | - | ||||||||||||||||||||||||
| 265 | - | |||||||||||||||||||||||||
| 266 | QWindow *QXcbScreen::topLevelAt(const QPoint &p) const | - | ||||||||||||||||||||||||
| 267 | { | - | ||||||||||||||||||||||||
| 268 | xcb_window_t root = screen()->root; | - | ||||||||||||||||||||||||
| 269 | - | |||||||||||||||||||||||||
| 270 | int x = p.x(); | - | ||||||||||||||||||||||||
| 271 | int y = p.y(); | - | ||||||||||||||||||||||||
| 272 | - | |||||||||||||||||||||||||
| 273 | xcb_window_t parent = root; | - | ||||||||||||||||||||||||
| 274 | xcb_window_t child = root; | - | ||||||||||||||||||||||||
| 275 | - | |||||||||||||||||||||||||
| 276 | do { | - | ||||||||||||||||||||||||
| 277 | xcb_translate_coordinates_cookie_t translate_cookie = | - | ||||||||||||||||||||||||
| 278 | xcb_translate_coordinates_unchecked(xcb_connection(), parent, child, x, y); | - | ||||||||||||||||||||||||
| 279 | - | |||||||||||||||||||||||||
| 280 | xcb_translate_coordinates_reply_t *translate_reply = | - | ||||||||||||||||||||||||
| 281 | xcb_translate_coordinates_reply(xcb_connection(), translate_cookie, __null); | - | ||||||||||||||||||||||||
| 282 | - | |||||||||||||||||||||||||
| 283 |         if (!translate_reply
  | 0-580 | ||||||||||||||||||||||||
| 284 |             return never executed:   0;return 0;never executed:  return 0; | 0 | ||||||||||||||||||||||||
| 285 | } | - | ||||||||||||||||||||||||
| 286 | - | |||||||||||||||||||||||||
| 287 | parent = child; | - | ||||||||||||||||||||||||
| 288 | child = translate_reply->child; | - | ||||||||||||||||||||||||
| 289 | x = translate_reply->dst_x; | - | ||||||||||||||||||||||||
| 290 | y = translate_reply->dst_y; | - | ||||||||||||||||||||||||
| 291 | - | |||||||||||||||||||||||||
| 292 | free(translate_reply); | - | ||||||||||||||||||||||||
| 293 | - | |||||||||||||||||||||||||
| 294 |         if (!child
 
  | 0-373 | ||||||||||||||||||||||||
| 295 |             return executed 207 times by 19 tests:   0;return 0;Executed by: 
 executed 207 times by 19 tests:  return 0;Executed by: 
  | 207 | ||||||||||||||||||||||||
| 296 | - | |||||||||||||||||||||||||
| 297 | QPlatformWindow *platformWindow = connection()->platformWindowFromId(child); | - | ||||||||||||||||||||||||
| 298 |         if (platformWindow
  | 70-303 | ||||||||||||||||||||||||
| 299 |             return executed 70 times by 7 tests:   platformWindow->window();return platformWindow->window();Executed by: 
 executed 70 times by 7 tests:  return platformWindow->window();Executed by: 
  | 70 | ||||||||||||||||||||||||
| 300 |     } executed 303 times by 20 tests:   while (parent != childend of blockExecuted by: 
 
  | 0-303 | ||||||||||||||||||||||||
| 301 | - | |||||||||||||||||||||||||
| 302 |     return never executed:   0;return 0;never executed:  return 0; | 0 | ||||||||||||||||||||||||
| 303 | } | - | ||||||||||||||||||||||||
| 304 | - | |||||||||||||||||||||||||
| 305 | void QXcbScreen::windowShown(QXcbWindow *window) | - | ||||||||||||||||||||||||
| 306 | { | - | ||||||||||||||||||||||||
| 307 | - | |||||||||||||||||||||||||
| 308 |     if (!connection()->startupId().isEmpty()
 
  | 0-3985 | ||||||||||||||||||||||||
| 309 |         sendStartupMessage(([]() -> QByteArray { enum { Size = sizeof("remove: ID=") - 1 }; static const QStaticByteArrayData<Size> qbytearray_literal = { { { { -1 } }, Size, 0, 0, sizeof(QByteArrayData) }, "remove: ID=" }; QByteArrayDataPtr holder = { qbytearray_literal.data_ptr() }; const QByteArray ba(holder); return never executed:   ba;return ba;never executed:   }()) + connection()->startupId());return ba; | 0 | ||||||||||||||||||||||||
| 310 | connection()->clearStartupId(); | - | ||||||||||||||||||||||||
| 311 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 312 | } executed 3985 times by 122 tests:  end of blockExecuted by: 
  | 3985 | ||||||||||||||||||||||||
| 313 | - | |||||||||||||||||||||||||
| 314 | QSurfaceFormat QXcbScreen::surfaceFormatFor(const QSurfaceFormat &format) const | - | ||||||||||||||||||||||||
| 315 | { | - | ||||||||||||||||||||||||
| 316 |     const xcb_visualid_t xcb_visualid = connection()->hasDefaultVisualId()
  | 0-4190 | ||||||||||||||||||||||||
| 317 | : screen()->root_visual; | - | ||||||||||||||||||||||||
| 318 | const xcb_visualtype_t *xcb_visualtype = visualForId(xcb_visualid); | - | ||||||||||||||||||||||||
| 319 | - | |||||||||||||||||||||||||
| 320 | const int redSize = qPopulationCount(xcb_visualtype->red_mask); | - | ||||||||||||||||||||||||
| 321 | const int greenSize = qPopulationCount(xcb_visualtype->green_mask); | - | ||||||||||||||||||||||||
| 322 | const int blueSize = qPopulationCount(xcb_visualtype->blue_mask); | - | ||||||||||||||||||||||||
| 323 | - | |||||||||||||||||||||||||
| 324 | QSurfaceFormat result = format; | - | ||||||||||||||||||||||||
| 325 | - | |||||||||||||||||||||||||
| 326 |     if (result.redBufferSize() < 0
  | 40-4150 | ||||||||||||||||||||||||
| 327 |         result.setRedBufferSize(redSize); executed 4150 times by 126 tests:  result.setRedBufferSize(redSize);Executed by: 
  | 4150 | ||||||||||||||||||||||||
| 328 | - | |||||||||||||||||||||||||
| 329 |     if (result.greenBufferSize() < 0
  | 40-4150 | ||||||||||||||||||||||||
| 330 |         result.setGreenBufferSize(greenSize); executed 4150 times by 126 tests:  result.setGreenBufferSize(greenSize);Executed by: 
  | 4150 | ||||||||||||||||||||||||
| 331 | - | |||||||||||||||||||||||||
| 332 |     if (result.blueBufferSize() < 0
  | 40-4150 | ||||||||||||||||||||||||
| 333 |         result.setBlueBufferSize(blueSize); executed 4150 times by 126 tests:  result.setBlueBufferSize(blueSize);Executed by: 
  | 4150 | ||||||||||||||||||||||||
| 334 | - | |||||||||||||||||||||||||
| 335 |     return executed 4190 times by 126 tests:   result;return result;Executed by: 
 executed 4190 times by 126 tests:  return result;Executed by: 
  | 4190 | ||||||||||||||||||||||||
| 336 | } | - | ||||||||||||||||||||||||
| 337 | - | |||||||||||||||||||||||||
| 338 | const xcb_visualtype_t *QXcbScreen::visualForFormat(const QSurfaceFormat &format) const | - | ||||||||||||||||||||||||
| 339 | { | - | ||||||||||||||||||||||||
| 340 | const xcb_visualtype_t *candidate = nullptr; | - | ||||||||||||||||||||||||
| 341 | - | |||||||||||||||||||||||||
| 342 | for (const xcb_visualtype_t &xcb_visualtype : m_visuals) { | - | ||||||||||||||||||||||||
| 343 | - | |||||||||||||||||||||||||
| 344 | const int redSize = qPopulationCount(xcb_visualtype.red_mask); | - | ||||||||||||||||||||||||
| 345 | const int greenSize = qPopulationCount(xcb_visualtype.green_mask); | - | ||||||||||||||||||||||||
| 346 | const int blueSize = qPopulationCount(xcb_visualtype.blue_mask); | - | ||||||||||||||||||||||||
| 347 | const int alphaSize = depthOfVisual(xcb_visualtype.visual_id) - redSize - greenSize - blueSize; | - | ||||||||||||||||||||||||
| 348 | - | |||||||||||||||||||||||||
| 349 |         if (format.redBufferSize() != -1
 
  | 0-133 | ||||||||||||||||||||||||
| 350 |             continue; never executed:  continue; | 0 | ||||||||||||||||||||||||
| 351 | - | |||||||||||||||||||||||||
| 352 |         if (format.greenBufferSize() != -1
 
  | 0-133 | ||||||||||||||||||||||||
| 353 |             continue; never executed:  continue; | 0 | ||||||||||||||||||||||||
| 354 | - | |||||||||||||||||||||||||
| 355 |         if (format.blueBufferSize() != -1
 
  | 0-133 | ||||||||||||||||||||||||
| 356 |             continue; never executed:  continue; | 0 | ||||||||||||||||||||||||
| 357 | - | |||||||||||||||||||||||||
| 358 |         if (format.alphaBufferSize() != -1
 
  | 0-133 | ||||||||||||||||||||||||
| 359 |             continue; never executed:  continue; | 0 | ||||||||||||||||||||||||
| 360 | - | |||||||||||||||||||||||||
| 361 | - | |||||||||||||||||||||||||
| 362 |         if (qCountTrailingZeroBits(xcb_visualtype.blue_mask) == 0
  | 0-133 | ||||||||||||||||||||||||
| 363 |             return executed 133 times by 12 tests:   &xcb_visualtype;return &xcb_visualtype;Executed by: 
 executed 133 times by 12 tests:  return &xcb_visualtype;Executed by: 
  | 133 | ||||||||||||||||||||||||
| 364 | - | |||||||||||||||||||||||||
| 365 | - | |||||||||||||||||||||||||
| 366 | - | |||||||||||||||||||||||||
| 367 |         if (!candidate
  | 0 | ||||||||||||||||||||||||
| 368 |             candidate = &xcb_visualtype; never executed:  candidate = &xcb_visualtype; | 0 | ||||||||||||||||||||||||
| 369 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 370 | - | |||||||||||||||||||||||||
| 371 |     return never executed:   candidate;return candidate;never executed:  return candidate; | 0 | ||||||||||||||||||||||||
| 372 | } | - | ||||||||||||||||||||||||
| 373 | - | |||||||||||||||||||||||||
| 374 | void QXcbScreen::sendStartupMessage(const QByteArray &message) const | - | ||||||||||||||||||||||||
| 375 | { | - | ||||||||||||||||||||||||
| 376 | xcb_window_t rootWindow = root(); | - | ||||||||||||||||||||||||
| 377 | - | |||||||||||||||||||||||||
| 378 | xcb_client_message_event_t ev; | - | ||||||||||||||||||||||||
| 379 | ev.response_type = 33; | - | ||||||||||||||||||||||||
| 380 | ev.format = 8; | - | ||||||||||||||||||||||||
| 381 | ev.type = connection()->atom(QXcbAtom::_NET_STARTUP_INFO_BEGIN); | - | ||||||||||||||||||||||||
| 382 | ev.sequence = 0; | - | ||||||||||||||||||||||||
| 383 | ev.window = rootWindow; | - | ||||||||||||||||||||||||
| 384 | int sent = 0; | - | ||||||||||||||||||||||||
| 385 | int length = message.length() + 1; | - | ||||||||||||||||||||||||
| 386 | const char *data = message.constData(); | - | ||||||||||||||||||||||||
| 387 | do { | - | ||||||||||||||||||||||||
| 388 |         if (sent == 20
  | 0 | ||||||||||||||||||||||||
| 389 |             ev.type = connection()->atom(QXcbAtom::_NET_STARTUP_INFO); never executed:  ev.type = connection()->atom(QXcbAtom::_NET_STARTUP_INFO); | 0 | ||||||||||||||||||||||||
| 390 | - | |||||||||||||||||||||||||
| 391 | const int start = sent; | - | ||||||||||||||||||||||||
| 392 | const int numBytes = qMin(length - start, 20); | - | ||||||||||||||||||||||||
| 393 | memcpy(ev.data.data8, data + start, numBytes); | - | ||||||||||||||||||||||||
| 394 | xcb_send_event(connection()->xcb_connection(), false, rootWindow, XCB_EVENT_MASK_PROPERTY_CHANGE, (const char *) &ev); | - | ||||||||||||||||||||||||
| 395 | - | |||||||||||||||||||||||||
| 396 | sent += numBytes; | - | ||||||||||||||||||||||||
| 397 |     } never executed:   while (sent < lengthend of block
  | 0 | ||||||||||||||||||||||||
| 398 | } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 399 | - | |||||||||||||||||||||||||
| 400 | const xcb_visualtype_t *QXcbScreen::visualForId(xcb_visualid_t visualid) const | - | ||||||||||||||||||||||||
| 401 | { | - | ||||||||||||||||||||||||
| 402 | QMap<xcb_visualid_t, xcb_visualtype_t>::const_iterator it = m_visuals.find(visualid); | - | ||||||||||||||||||||||||
| 403 |     if (it == m_visuals.constEnd()
  | 0-81293 | ||||||||||||||||||||||||
| 404 |         return never executed:   0;return 0;never executed:  return 0; | 0 | ||||||||||||||||||||||||
| 405 |     return executed 81293 times by 147 tests:   &*it;return &*it;Executed by: 
 executed 81293 times by 147 tests:  return &*it;Executed by: 
  | 81293 | ||||||||||||||||||||||||
| 406 | } | - | ||||||||||||||||||||||||
| 407 | - | |||||||||||||||||||||||||
| 408 | quint8 QXcbScreen::depthOfVisual(xcb_visualid_t visualid) const | - | ||||||||||||||||||||||||
| 409 | { | - | ||||||||||||||||||||||||
| 410 | QMap<xcb_visualid_t, quint8>::const_iterator it = m_visualDepths.find(visualid); | - | ||||||||||||||||||||||||
| 411 |     if (it == m_visualDepths.constEnd()
  | 0-4243 | ||||||||||||||||||||||||
| 412 |         return never executed:   0;return 0;never executed:  return 0; | 0 | ||||||||||||||||||||||||
| 413 |     return executed 4243 times by 125 tests:   *it;return *it;Executed by: 
 executed 4243 times by 125 tests:  return *it;Executed by: 
  | 4243 | ||||||||||||||||||||||||
| 414 | } | - | ||||||||||||||||||||||||
| 415 | - | |||||||||||||||||||||||||
| 416 | QImage::Format QXcbScreen::format() const | - | ||||||||||||||||||||||||
| 417 | { | - | ||||||||||||||||||||||||
| 418 |     return executed 72809 times by 105 tests:   qt_xcb_imageFormatForVisual(connection(), screen()->root_depth, visualForId(screen()->root_visual));return qt_xcb_imageFormatForVisual(connection(), screen()->root_depth, visualForId(screen()->root_visual));Executed by: 
 executed 72809 times by 105 tests:  return qt_xcb_imageFormatForVisual(connection(), screen()->root_depth, visualForId(screen()->root_visual));Executed by: 
  | 72809 | ||||||||||||||||||||||||
| 419 | } | - | ||||||||||||||||||||||||
| 420 | - | |||||||||||||||||||||||||
| 421 | QDpi QXcbScreen::virtualDpi() const | - | ||||||||||||||||||||||||
| 422 | { | - | ||||||||||||||||||||||||
| 423 |     return executed 135 times by 5 tests:   QDpi(Q_MM_PER_INCH * m_virtualSize.width() / m_virtualSizeMillimeters.width(),return QDpi(Q_MM_PER_INCH * m_virtualSize.width() / m_virtualSizeMillimeters.width(), Q_MM_PER_INCH * m_virtualSize.height() / m_virtualSizeMillimeters.height());Executed by: 
 executed 135 times by 5 tests:  return QDpi(Q_MM_PER_INCH * m_virtualSize.width() / m_virtualSizeMillimeters.width(), Q_MM_PER_INCH * m_virtualSize.height() / m_virtualSizeMillimeters.height());Executed by: 
  | 135 | ||||||||||||||||||||||||
| 424 |                 Q_MM_PER_INCH * m_virtualSize.height() / m_virtualSizeMillimeters.height()); executed 135 times by 5 tests:  return QDpi(Q_MM_PER_INCH * m_virtualSize.width() / m_virtualSizeMillimeters.width(), Q_MM_PER_INCH * m_virtualSize.height() / m_virtualSizeMillimeters.height());Executed by: 
  | 135 | ||||||||||||||||||||||||
| 425 | } | - | ||||||||||||||||||||||||
| 426 | - | |||||||||||||||||||||||||
| 427 | - | |||||||||||||||||||||||||
| 428 | QDpi QXcbScreen::logicalDpi() const | - | ||||||||||||||||||||||||
| 429 | { | - | ||||||||||||||||||||||||
| 430 | static const int overrideDpi = qEnvironmentVariableIntValue("QT_FONT_DPI"); | - | ||||||||||||||||||||||||
| 431 |     if (overrideDpi
  | 0-426 | ||||||||||||||||||||||||
| 432 |         return never executed:   QDpi(overrideDpi, overrideDpi);return QDpi(overrideDpi, overrideDpi);never executed:  return QDpi(overrideDpi, overrideDpi); | 0 | ||||||||||||||||||||||||
| 433 | - | |||||||||||||||||||||||||
| 434 |     if (m_forcedDpi > 0
  | 0-426 | ||||||||||||||||||||||||
| 435 |         return executed 426 times by 8 tests:   QDpi(m_forcedDpi, m_forcedDpi);return QDpi(m_forcedDpi, m_forcedDpi);Executed by: 
 executed 426 times by 8 tests:  return QDpi(m_forcedDpi, m_forcedDpi);Executed by: 
  | 426 | ||||||||||||||||||||||||
| 436 | } | - | ||||||||||||||||||||||||
| 437 |     return never executed:   virtualDpi();return virtualDpi();never executed:  return virtualDpi(); | 0 | ||||||||||||||||||||||||
| 438 | } | - | ||||||||||||||||||||||||
| 439 | - | |||||||||||||||||||||||||
| 440 | qreal QXcbScreen::pixelDensity() const | - | ||||||||||||||||||||||||
| 441 | { | - | ||||||||||||||||||||||||
| 442 |     return never executed:   m_pixelDensity;return m_pixelDensity;never executed:  return m_pixelDensity; | 0 | ||||||||||||||||||||||||
| 443 | } | - | ||||||||||||||||||||||||
| 444 | - | |||||||||||||||||||||||||
| 445 | QPlatformCursor *QXcbScreen::cursor() const | - | ||||||||||||||||||||||||
| 446 | { | - | ||||||||||||||||||||||||
| 447 |     return executed 27754 times by 119 tests:   m_cursor;return m_cursor;Executed by: 
 executed 27754 times by 119 tests:  return m_cursor;Executed by: 
  | 27754 | ||||||||||||||||||||||||
| 448 | } | - | ||||||||||||||||||||||||
| 449 | - | |||||||||||||||||||||||||
| 450 | void QXcbScreen::setOutput(xcb_randr_output_t outputId, | - | ||||||||||||||||||||||||
| 451 | xcb_randr_get_output_info_reply_t *outputInfo) | - | ||||||||||||||||||||||||
| 452 | { | - | ||||||||||||||||||||||||
| 453 | m_output = outputId; | - | ||||||||||||||||||||||||
| 454 |     m_crtc = outputInfo
  | 0 | ||||||||||||||||||||||||
| 455 | m_mode = 0L; | - | ||||||||||||||||||||||||
| 456 | m_outputName = getOutputName(outputInfo); | - | ||||||||||||||||||||||||
| 457 | - | |||||||||||||||||||||||||
| 458 | } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 459 | - | |||||||||||||||||||||||||
| 460 | int QXcbScreen::virtualDesktopNumberStatic(const QScreen *screen) | - | ||||||||||||||||||||||||
| 461 | { | - | ||||||||||||||||||||||||
| 462 |     if (screen
 
  | 0 | ||||||||||||||||||||||||
| 463 |         return never executed:   static_cast<const QXcbScreen *>(screen->handle())->screenNumber();return static_cast<const QXcbScreen *>(screen->handle())->screenNumber();never executed:  return static_cast<const QXcbScreen *>(screen->handle())->screenNumber(); | 0 | ||||||||||||||||||||||||
| 464 | - | |||||||||||||||||||||||||
| 465 |     return never executed:   0;return 0;never executed:  return 0; | 0 | ||||||||||||||||||||||||
| 466 | } | - | ||||||||||||||||||||||||
| 467 | void QXcbScreen::handleScreenChange(xcb_randr_screen_change_notify_event_t *change_event) | - | ||||||||||||||||||||||||
| 468 | { | - | ||||||||||||||||||||||||
| 469 | - | |||||||||||||||||||||||||
| 470 | - | |||||||||||||||||||||||||
| 471 | - | |||||||||||||||||||||||||
| 472 |     if (change_event->rotation == m_rotation
  | 0 | ||||||||||||||||||||||||
| 473 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||
| 474 | - | |||||||||||||||||||||||||
| 475 | m_rotation = change_event->rotation; | - | ||||||||||||||||||||||||
| 476 | switch (m_rotation) { | - | ||||||||||||||||||||||||
| 477 |     case never executed:   XCB_RANDR_ROTATION_ROTATE_0:case XCB_RANDR_ROTATION_ROTATE_0:never executed:  case XCB_RANDR_ROTATION_ROTATE_0: | 0 | ||||||||||||||||||||||||
| 478 | m_orientation = Qt::LandscapeOrientation; | - | ||||||||||||||||||||||||
| 479 | m_virtualSize.setWidth(change_event->width); | - | ||||||||||||||||||||||||
| 480 | m_virtualSize.setHeight(change_event->height); | - | ||||||||||||||||||||||||
| 481 | m_virtualSizeMillimeters.setWidth(change_event->mwidth); | - | ||||||||||||||||||||||||
| 482 | m_virtualSizeMillimeters.setHeight(change_event->mheight); | - | ||||||||||||||||||||||||
| 483 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||
| 484 |     case never executed:   XCB_RANDR_ROTATION_ROTATE_90:case XCB_RANDR_ROTATION_ROTATE_90:never executed:  case XCB_RANDR_ROTATION_ROTATE_90: | 0 | ||||||||||||||||||||||||
| 485 | m_orientation = Qt::PortraitOrientation; | - | ||||||||||||||||||||||||
| 486 | m_virtualSize.setWidth(change_event->height); | - | ||||||||||||||||||||||||
| 487 | m_virtualSize.setHeight(change_event->width); | - | ||||||||||||||||||||||||
| 488 | m_virtualSizeMillimeters.setWidth(change_event->mheight); | - | ||||||||||||||||||||||||
| 489 | m_virtualSizeMillimeters.setHeight(change_event->mwidth); | - | ||||||||||||||||||||||||
| 490 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||
| 491 |     case never executed:   XCB_RANDR_ROTATION_ROTATE_180:case XCB_RANDR_ROTATION_ROTATE_180:never executed:  case XCB_RANDR_ROTATION_ROTATE_180: | 0 | ||||||||||||||||||||||||
| 492 | m_orientation = Qt::InvertedLandscapeOrientation; | - | ||||||||||||||||||||||||
| 493 | m_virtualSize.setWidth(change_event->width); | - | ||||||||||||||||||||||||
| 494 | m_virtualSize.setHeight(change_event->height); | - | ||||||||||||||||||||||||
| 495 | m_virtualSizeMillimeters.setWidth(change_event->mwidth); | - | ||||||||||||||||||||||||
| 496 | m_virtualSizeMillimeters.setHeight(change_event->mheight); | - | ||||||||||||||||||||||||
| 497 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||
| 498 |     case never executed:   XCB_RANDR_ROTATION_ROTATE_270:case XCB_RANDR_ROTATION_ROTATE_270:never executed:  case XCB_RANDR_ROTATION_ROTATE_270: | 0 | ||||||||||||||||||||||||
| 499 | m_orientation = Qt::InvertedPortraitOrientation; | - | ||||||||||||||||||||||||
| 500 | m_virtualSize.setWidth(change_event->height); | - | ||||||||||||||||||||||||
| 501 | m_virtualSize.setHeight(change_event->width); | - | ||||||||||||||||||||||||
| 502 | m_virtualSizeMillimeters.setWidth(change_event->mheight); | - | ||||||||||||||||||||||||
| 503 | m_virtualSizeMillimeters.setHeight(change_event->mwidth); | - | ||||||||||||||||||||||||
| 504 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||
| 505 | - | |||||||||||||||||||||||||
| 506 | - | |||||||||||||||||||||||||
| 507 |     case never executed:   XCB_RANDR_ROTATION_REFLECT_X:case XCB_RANDR_ROTATION_REFLECT_X:never executed:   break;case XCB_RANDR_ROTATION_REFLECT_X:never executed:  break; | 0 | ||||||||||||||||||||||||
| 508 |     case never executed:   XCB_RANDR_ROTATION_REFLECT_Y:case XCB_RANDR_ROTATION_REFLECT_Y:never executed:   break;case XCB_RANDR_ROTATION_REFLECT_Y:never executed:  break; | 0 | ||||||||||||||||||||||||
| 509 | } | - | ||||||||||||||||||||||||
| 510 | - | |||||||||||||||||||||||||
| 511 | updateGeometry(change_event->timestamp); | - | ||||||||||||||||||||||||
| 512 | - | |||||||||||||||||||||||||
| 513 | QWindowSystemInterface::handleScreenOrientationChange(QPlatformScreen::screen(), m_orientation); | - | ||||||||||||||||||||||||
| 514 | - | |||||||||||||||||||||||||
| 515 | QDpi ldpi = logicalDpi(); | - | ||||||||||||||||||||||||
| 516 | QWindowSystemInterface::handleScreenLogicalDotsPerInchChange(QPlatformScreen::screen(), ldpi.first, ldpi.second); | - | ||||||||||||||||||||||||
| 517 | } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 518 | - | |||||||||||||||||||||||||
| 519 | void QXcbScreen::updateGeometry(xcb_timestamp_t timestamp) | - | ||||||||||||||||||||||||
| 520 | { | - | ||||||||||||||||||||||||
| 521 |     if (!connection()->hasXRandr()
  | 0 | ||||||||||||||||||||||||
| 522 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||
| 523 | - | |||||||||||||||||||||||||
| 524 | xcb_randr_get_crtc_info_cookie_t crtcCookie = | - | ||||||||||||||||||||||||
| 525 | xcb_randr_get_crtc_info_unchecked(xcb_connection(), m_crtc, timestamp); | - | ||||||||||||||||||||||||
| 526 | xcb_randr_get_crtc_info_reply_t *crtc = | - | ||||||||||||||||||||||||
| 527 | xcb_randr_get_crtc_info_reply(xcb_connection(), crtcCookie, __null); | - | ||||||||||||||||||||||||
| 528 |     if (crtc
  | 0 | ||||||||||||||||||||||||
| 529 | updateGeometry(QRect(crtc->x, crtc->y, crtc->width, crtc->height), crtc->rotation); | - | ||||||||||||||||||||||||
| 530 | free(crtc); | - | ||||||||||||||||||||||||
| 531 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 532 | } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 533 | - | |||||||||||||||||||||||||
| 534 | void QXcbScreen::updateGeometry(const QRect &geom, uint8_t rotation) | - | ||||||||||||||||||||||||
| 535 | { | - | ||||||||||||||||||||||||
| 536 | QRect xGeometry = geom; | - | ||||||||||||||||||||||||
| 537 | switch (rotation) { | - | ||||||||||||||||||||||||
| 538 |     case executed 135 times by 5 tests:   XCB_RANDR_ROTATION_ROTATE_0:case XCB_RANDR_ROTATION_ROTATE_0:Executed by: 
 executed 135 times by 5 tests:  case XCB_RANDR_ROTATION_ROTATE_0:Executed by: 
  | 135 | ||||||||||||||||||||||||
| 539 | m_orientation = Qt::LandscapeOrientation; | - | ||||||||||||||||||||||||
| 540 | m_sizeMillimeters = m_outputSizeMillimeters; | - | ||||||||||||||||||||||||
| 541 |         break; executed 135 times by 5 tests:  break;Executed by: 
  | 135 | ||||||||||||||||||||||||
| 542 |     case never executed:   XCB_RANDR_ROTATION_ROTATE_90:case XCB_RANDR_ROTATION_ROTATE_90:never executed:  case XCB_RANDR_ROTATION_ROTATE_90: | 0 | ||||||||||||||||||||||||
| 543 | m_orientation = Qt::PortraitOrientation; | - | ||||||||||||||||||||||||
| 544 | m_sizeMillimeters = m_outputSizeMillimeters.transposed(); | - | ||||||||||||||||||||||||
| 545 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||
| 546 |     case never executed:   XCB_RANDR_ROTATION_ROTATE_180:case XCB_RANDR_ROTATION_ROTATE_180:never executed:  case XCB_RANDR_ROTATION_ROTATE_180: | 0 | ||||||||||||||||||||||||
| 547 | m_orientation = Qt::InvertedLandscapeOrientation; | - | ||||||||||||||||||||||||
| 548 | m_sizeMillimeters = m_outputSizeMillimeters; | - | ||||||||||||||||||||||||
| 549 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||
| 550 |     case never executed:   XCB_RANDR_ROTATION_ROTATE_270:case XCB_RANDR_ROTATION_ROTATE_270:never executed:  case XCB_RANDR_ROTATION_ROTATE_270: | 0 | ||||||||||||||||||||||||
| 551 | m_orientation = Qt::InvertedPortraitOrientation; | - | ||||||||||||||||||||||||
| 552 | m_sizeMillimeters = m_outputSizeMillimeters.transposed(); | - | ||||||||||||||||||||||||
| 553 |         break; never executed:  break; | 0 | ||||||||||||||||||||||||
| 554 | } | - | ||||||||||||||||||||||||
| 555 | - | |||||||||||||||||||||||||
| 556 | - | |||||||||||||||||||||||||
| 557 | - | |||||||||||||||||||||||||
| 558 | - | |||||||||||||||||||||||||
| 559 |     if (m_sizeMillimeters.isEmpty()
  | 0-135 | ||||||||||||||||||||||||
| 560 |         m_sizeMillimeters = sizeInMillimeters(xGeometry.size(), virtualDpi()); executed 135 times by 5 tests:  m_sizeMillimeters = sizeInMillimeters(xGeometry.size(), virtualDpi());Executed by: 
  | 135 | ||||||||||||||||||||||||
| 561 | - | |||||||||||||||||||||||||
| 562 | qreal dpi = xGeometry.width() / physicalSize().width() * qreal(25.4); | - | ||||||||||||||||||||||||
| 563 | m_pixelDensity = qRound(dpi/96); | - | ||||||||||||||||||||||||
| 564 | m_geometry = QRect(xGeometry.topLeft(), xGeometry.size()); | - | ||||||||||||||||||||||||
| 565 | m_availableGeometry = xGeometry & m_virtualDesktop->workArea(); | - | ||||||||||||||||||||||||
| 566 | QWindowSystemInterface::handleScreenGeometryChange(QPlatformScreen::screen(), m_geometry, m_availableGeometry); | - | ||||||||||||||||||||||||
| 567 | } executed 135 times by 5 tests:  end of blockExecuted by: 
  | 135 | ||||||||||||||||||||||||
| 568 | - | |||||||||||||||||||||||||
| 569 | void QXcbScreen::updateAvailableGeometry() | - | ||||||||||||||||||||||||
| 570 | { | - | ||||||||||||||||||||||||
| 571 | QRect availableGeometry = m_geometry & m_virtualDesktop->workArea(); | - | ||||||||||||||||||||||||
| 572 |     if (m_availableGeometry != availableGeometry
  | 0 | ||||||||||||||||||||||||
| 573 | m_availableGeometry = availableGeometry; | - | ||||||||||||||||||||||||
| 574 | QWindowSystemInterface::handleScreenGeometryChange(QPlatformScreen::screen(), m_geometry, m_availableGeometry); | - | ||||||||||||||||||||||||
| 575 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 576 | } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 577 | - | |||||||||||||||||||||||||
| 578 | void QXcbScreen::updateRefreshRate(xcb_randr_mode_t mode) | - | ||||||||||||||||||||||||
| 579 | { | - | ||||||||||||||||||||||||
| 580 |     if (!connection()->hasXRandr()
  | 0-135 | ||||||||||||||||||||||||
| 581 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||
| 582 | - | |||||||||||||||||||||||||
| 583 |     if (m_mode == mode
  | 0-135 | ||||||||||||||||||||||||
| 584 |         return; never executed:  return; | 0 | ||||||||||||||||||||||||
| 585 | - | |||||||||||||||||||||||||
| 586 | - | |||||||||||||||||||||||||
| 587 | - | |||||||||||||||||||||||||
| 588 | xcb_randr_get_screen_resources_current_cookie_t resourcesCookie = | - | ||||||||||||||||||||||||
| 589 | xcb_randr_get_screen_resources_current_unchecked(xcb_connection(), screen()->root); | - | ||||||||||||||||||||||||
| 590 | xcb_randr_get_screen_resources_current_reply_t *resources = | - | ||||||||||||||||||||||||
| 591 | xcb_randr_get_screen_resources_current_reply(xcb_connection(), resourcesCookie, __null); | - | ||||||||||||||||||||||||
| 592 |     if (resources
  | 0-135 | ||||||||||||||||||||||||
| 593 | xcb_randr_mode_info_iterator_t modesIter = | - | ||||||||||||||||||||||||
| 594 | xcb_randr_get_screen_resources_current_modes_iterator(resources); | - | ||||||||||||||||||||||||
| 595 |         for (; modesIter.rem
  | 0-135 | ||||||||||||||||||||||||
| 596 | xcb_randr_mode_info_t *modeInfo = modesIter.data; | - | ||||||||||||||||||||||||
| 597 |             if (modeInfo->id == mode
  | 0-135 | ||||||||||||||||||||||||
| 598 | const uint32_t dotCount = modeInfo->htotal * modeInfo->vtotal; | - | ||||||||||||||||||||||||
| 599 |                 m_refreshRate = (
 
  | 0-135 | ||||||||||||||||||||||||
| 600 | m_mode = mode; | - | ||||||||||||||||||||||||
| 601 |                 break; executed 135 times by 5 tests:  break;Executed by: 
  | 135 | ||||||||||||||||||||||||
| 602 | } | - | ||||||||||||||||||||||||
| 603 |         } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 604 | - | |||||||||||||||||||||||||
| 605 | free(resources); | - | ||||||||||||||||||||||||
| 606 | QWindowSystemInterface::handleScreenRefreshRateChange(QPlatformScreen::screen(), m_refreshRate); | - | ||||||||||||||||||||||||
| 607 |     } executed 135 times by 5 tests:  end of blockExecuted by: 
  | 135 | ||||||||||||||||||||||||
| 608 | } executed 135 times by 5 tests:  end of blockExecuted by: 
  | 135 | ||||||||||||||||||||||||
| 609 | - | |||||||||||||||||||||||||
| 610 | QPixmap QXcbScreen::grabWindow(WId window, int x, int y, int width, int height) const | - | ||||||||||||||||||||||||
| 611 | { | - | ||||||||||||||||||||||||
| 612 |     if (width == 0
 
  | 0-22 | ||||||||||||||||||||||||
| 613 |         return never executed:   QPixmap();return QPixmap();never executed:  return QPixmap(); | 0 | ||||||||||||||||||||||||
| 614 | - | |||||||||||||||||||||||||
| 615 | - | |||||||||||||||||||||||||
| 616 | QXcbScreen *screen = const_cast<QXcbScreen *>(this); | - | ||||||||||||||||||||||||
| 617 | xcb_window_t root = screen->root(); | - | ||||||||||||||||||||||||
| 618 | - | |||||||||||||||||||||||||
| 619 |     if (window == 0
  | 0-22 | ||||||||||||||||||||||||
| 620 |         window = root; never executed:  window = root; | 0 | ||||||||||||||||||||||||
| 621 | - | |||||||||||||||||||||||||
| 622 | xcb_get_geometry_cookie_t geometry_cookie = xcb_get_geometry_unchecked(xcb_connection(), window); | - | ||||||||||||||||||||||||
| 623 | - | |||||||||||||||||||||||||
| 624 | xcb_get_geometry_reply_t *reply = | - | ||||||||||||||||||||||||
| 625 | xcb_get_geometry_reply(xcb_connection(), geometry_cookie, __null); | - | ||||||||||||||||||||||||
| 626 | - | |||||||||||||||||||||||||
| 627 |     if (!reply
  | 0-22 | ||||||||||||||||||||||||
| 628 |         return never executed:   QPixmap();return QPixmap();never executed:  return QPixmap(); | 0 | ||||||||||||||||||||||||
| 629 | } | - | ||||||||||||||||||||||||
| 630 | - | |||||||||||||||||||||||||
| 631 |     if (width < 0
  | 0-22 | ||||||||||||||||||||||||
| 632 |         width = reply->width - x; never executed:  width = reply->width - x; | 0 | ||||||||||||||||||||||||
| 633 |     if (height < 0
  | 0-22 | ||||||||||||||||||||||||
| 634 |         height = reply->height - y; never executed:  height = reply->height - y; | 0 | ||||||||||||||||||||||||
| 635 | - | |||||||||||||||||||||||||
| 636 | geometry_cookie = xcb_get_geometry_unchecked(xcb_connection(), root); | - | ||||||||||||||||||||||||
| 637 | xcb_get_geometry_reply_t *root_reply = | - | ||||||||||||||||||||||||
| 638 | xcb_get_geometry_reply(xcb_connection(), geometry_cookie, __null); | - | ||||||||||||||||||||||||
| 639 | - | |||||||||||||||||||||||||
| 640 |     if (!root_reply
  | 0-22 | ||||||||||||||||||||||||
| 641 | free(reply); | - | ||||||||||||||||||||||||
| 642 |         return never executed:   QPixmap();return QPixmap();never executed:  return QPixmap(); | 0 | ||||||||||||||||||||||||
| 643 | } | - | ||||||||||||||||||||||||
| 644 | - | |||||||||||||||||||||||||
| 645 |     if (reply->depth == root_reply->depth
  | 0-22 | ||||||||||||||||||||||||
| 646 | - | |||||||||||||||||||||||||
| 647 | - | |||||||||||||||||||||||||
| 648 | - | |||||||||||||||||||||||||
| 649 | - | |||||||||||||||||||||||||
| 650 | - | |||||||||||||||||||||||||
| 651 | xcb_translate_coordinates_cookie_t translate_cookie = | - | ||||||||||||||||||||||||
| 652 | xcb_translate_coordinates_unchecked(xcb_connection(), window, root, x, y); | - | ||||||||||||||||||||||||
| 653 | - | |||||||||||||||||||||||||
| 654 | xcb_translate_coordinates_reply_t *translate_reply = | - | ||||||||||||||||||||||||
| 655 | xcb_translate_coordinates_reply(xcb_connection(), translate_cookie, __null); | - | ||||||||||||||||||||||||
| 656 | - | |||||||||||||||||||||||||
| 657 |         if (!translate_reply
  | 0-22 | ||||||||||||||||||||||||
| 658 | free(reply); | - | ||||||||||||||||||||||||
| 659 | free(root_reply); | - | ||||||||||||||||||||||||
| 660 |             return never executed:   QPixmap();return QPixmap();never executed:  return QPixmap(); | 0 | ||||||||||||||||||||||||
| 661 | } | - | ||||||||||||||||||||||||
| 662 | - | |||||||||||||||||||||||||
| 663 | x = translate_reply->dst_x; | - | ||||||||||||||||||||||||
| 664 | y = translate_reply->dst_y; | - | ||||||||||||||||||||||||
| 665 | - | |||||||||||||||||||||||||
| 666 | window = root; | - | ||||||||||||||||||||||||
| 667 | - | |||||||||||||||||||||||||
| 668 | free(translate_reply); | - | ||||||||||||||||||||||||
| 669 | free(reply); | - | ||||||||||||||||||||||||
| 670 | reply = root_reply; | - | ||||||||||||||||||||||||
| 671 |     } executed 22 times by 3 tests:   else {end of blockExecuted by: 
  | 22 | ||||||||||||||||||||||||
| 672 | free(root_reply); | - | ||||||||||||||||||||||||
| 673 | root_reply = 0; | - | ||||||||||||||||||||||||
| 674 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 675 | - | |||||||||||||||||||||||||
| 676 | xcb_get_window_attributes_reply_t *attributes_reply = | - | ||||||||||||||||||||||||
| 677 | xcb_get_window_attributes_reply(xcb_connection(), xcb_get_window_attributes_unchecked(xcb_connection(), window), __null); | - | ||||||||||||||||||||||||
| 678 | - | |||||||||||||||||||||||||
| 679 |     if (!attributes_reply
  | 0-22 | ||||||||||||||||||||||||
| 680 | free(reply); | - | ||||||||||||||||||||||||
| 681 |         return never executed:   QPixmap();return QPixmap();never executed:  return QPixmap(); | 0 | ||||||||||||||||||||||||
| 682 | } | - | ||||||||||||||||||||||||
| 683 | - | |||||||||||||||||||||||||
| 684 | const xcb_visualtype_t *visual = screen->visualForId(attributes_reply->visual); | - | ||||||||||||||||||||||||
| 685 | free(attributes_reply); | - | ||||||||||||||||||||||||
| 686 | - | |||||||||||||||||||||||||
| 687 | xcb_pixmap_t pixmap = xcb_generate_id(xcb_connection()); | - | ||||||||||||||||||||||||
| 688 | xcb_create_pixmap(xcb_connection(), reply->depth, pixmap, window, width, height); | - | ||||||||||||||||||||||||
| 689 | - | |||||||||||||||||||||||||
| 690 | uint32_t gc_value_mask = XCB_GC_SUBWINDOW_MODE; | - | ||||||||||||||||||||||||
| 691 | uint32_t gc_value_list[] = { XCB_SUBWINDOW_MODE_INCLUDE_INFERIORS }; | - | ||||||||||||||||||||||||
| 692 | - | |||||||||||||||||||||||||
| 693 | xcb_gcontext_t gc = xcb_generate_id(xcb_connection()); | - | ||||||||||||||||||||||||
| 694 | xcb_create_gc(xcb_connection(), gc, pixmap, gc_value_mask, gc_value_list); | - | ||||||||||||||||||||||||
| 695 | - | |||||||||||||||||||||||||
| 696 | xcb_copy_area(xcb_connection(), window, pixmap, gc, x, y, 0, 0, width, height); | - | ||||||||||||||||||||||||
| 697 | - | |||||||||||||||||||||||||
| 698 | QPixmap result = qt_xcb_pixmapFromXPixmap(connection(), pixmap, width, height, reply->depth, visual); | - | ||||||||||||||||||||||||
| 699 | - | |||||||||||||||||||||||||
| 700 | free(reply); | - | ||||||||||||||||||||||||
| 701 | xcb_free_gc(xcb_connection(), gc); | - | ||||||||||||||||||||||||
| 702 | xcb_free_pixmap(xcb_connection(), pixmap); | - | ||||||||||||||||||||||||
| 703 | - | |||||||||||||||||||||||||
| 704 |     return executed 22 times by 3 tests:   result;return result;Executed by: 
 executed 22 times by 3 tests:  return result;Executed by: 
  | 22 | ||||||||||||||||||||||||
| 705 | } | - | ||||||||||||||||||||||||
| 706 | - | |||||||||||||||||||||||||
| 707 | static bool parseXftInt(const QByteArray& stringValue, int *value) | - | ||||||||||||||||||||||||
| 708 | { | - | ||||||||||||||||||||||||
| 709 | ((!(value != 0)) ? qt_assert("value != 0",__FILE__,782) : qt_noop()); | - | ||||||||||||||||||||||||
| 710 | bool ok; | - | ||||||||||||||||||||||||
| 711 | *value = stringValue.toInt(&ok); | - | ||||||||||||||||||||||||
| 712 |     return executed 270 times by 5 tests:   ok;return ok;Executed by: 
 executed 270 times by 5 tests:  return ok;Executed by: 
  | 270 | ||||||||||||||||||||||||
| 713 | } | - | ||||||||||||||||||||||||
| 714 | - | |||||||||||||||||||||||||
| 715 | static QFontEngine::HintStyle parseXftHintStyle(const QByteArray& stringValue) | - | ||||||||||||||||||||||||
| 716 | { | - | ||||||||||||||||||||||||
| 717 |     if (stringValue == "hintfull"
  | 0-135 | ||||||||||||||||||||||||
| 718 |         return never executed:   QFontEngine::HintFull;return QFontEngine::HintFull;never executed:  return QFontEngine::HintFull; | 0 | ||||||||||||||||||||||||
| 719 |     else if (stringValue == "hintnone"
  | 0-135 | ||||||||||||||||||||||||
| 720 |         return never executed:   QFontEngine::HintNone;return QFontEngine::HintNone;never executed:  return QFontEngine::HintNone; | 0 | ||||||||||||||||||||||||
| 721 |     else if (stringValue == "hintmedium"
  | 0-135 | ||||||||||||||||||||||||
| 722 |         return executed 135 times by 5 tests:   QFontEngine::HintMedium;return QFontEngine::HintMedium;Executed by: 
 executed 135 times by 5 tests:  return QFontEngine::HintMedium;Executed by: 
  | 135 | ||||||||||||||||||||||||
| 723 |     else if (stringValue == "hintslight"
  | 0 | ||||||||||||||||||||||||
| 724 |         return never executed:   QFontEngine::HintLight;return QFontEngine::HintLight;never executed:  return QFontEngine::HintLight; | 0 | ||||||||||||||||||||||||
| 725 | - | |||||||||||||||||||||||||
| 726 |     return never executed:   QFontEngine::HintStyle(-1);return QFontEngine::HintStyle(-1);never executed:  return QFontEngine::HintStyle(-1); | 0 | ||||||||||||||||||||||||
| 727 | } | - | ||||||||||||||||||||||||
| 728 | - | |||||||||||||||||||||||||
| 729 | static QFontEngine::SubpixelAntialiasingType parseXftRgba(const QByteArray& stringValue) | - | ||||||||||||||||||||||||
| 730 | { | - | ||||||||||||||||||||||||
| 731 |     if (stringValue == "none"
  | 0-135 | ||||||||||||||||||||||||
| 732 |         return executed 135 times by 5 tests:   QFontEngine::Subpixel_None;return QFontEngine::Subpixel_None;Executed by: 
 executed 135 times by 5 tests:  return QFontEngine::Subpixel_None;Executed by: 
  | 135 | ||||||||||||||||||||||||
| 733 |     else if (stringValue == "rgb"
  | 0 | ||||||||||||||||||||||||
| 734 |         return never executed:   QFontEngine::Subpixel_RGB;return QFontEngine::Subpixel_RGB;never executed:  return QFontEngine::Subpixel_RGB; | 0 | ||||||||||||||||||||||||
| 735 |     else if (stringValue == "bgr"
  | 0 | ||||||||||||||||||||||||
| 736 |         return never executed:   QFontEngine::Subpixel_BGR;return QFontEngine::Subpixel_BGR;never executed:  return QFontEngine::Subpixel_BGR; | 0 | ||||||||||||||||||||||||
| 737 |     else if (stringValue == "vrgb"
  | 0 | ||||||||||||||||||||||||
| 738 |         return never executed:   QFontEngine::Subpixel_VRGB;return QFontEngine::Subpixel_VRGB;never executed:  return QFontEngine::Subpixel_VRGB; | 0 | ||||||||||||||||||||||||
| 739 |     else if (stringValue == "vbgr"
  | 0 | ||||||||||||||||||||||||
| 740 |         return never executed:   QFontEngine::Subpixel_VBGR;return QFontEngine::Subpixel_VBGR;never executed:  return QFontEngine::Subpixel_VBGR; | 0 | ||||||||||||||||||||||||
| 741 | - | |||||||||||||||||||||||||
| 742 |     return never executed:   QFontEngine::SubpixelAntialiasingType(-1);return QFontEngine::SubpixelAntialiasingType(-1);never executed:  return QFontEngine::SubpixelAntialiasingType(-1); | 0 | ||||||||||||||||||||||||
| 743 | } | - | ||||||||||||||||||||||||
| 744 | - | |||||||||||||||||||||||||
| 745 | bool QXcbScreen::xResource(const QByteArray &identifier, | - | ||||||||||||||||||||||||
| 746 | const QByteArray &expectedIdentifier, | - | ||||||||||||||||||||||||
| 747 | QByteArray& stringValue) | - | ||||||||||||||||||||||||
| 748 | { | - | ||||||||||||||||||||||||
| 749 |     if (identifier.startsWith(expectedIdentifier)
  | 540-2430 | ||||||||||||||||||||||||
| 750 | stringValue = identifier.mid(expectedIdentifier.size()); | - | ||||||||||||||||||||||||
| 751 |         return executed 540 times by 5 tests:   true;return true;Executed by: 
 executed 540 times by 5 tests:  return true;Executed by: 
  | 540 | ||||||||||||||||||||||||
| 752 | } | - | ||||||||||||||||||||||||
| 753 |     return executed 2430 times by 5 tests:   false;return false;Executed by: 
 executed 2430 times by 5 tests:  return false;Executed by: 
  | 2430 | ||||||||||||||||||||||||
| 754 | } | - | ||||||||||||||||||||||||
| 755 | - | |||||||||||||||||||||||||
| 756 | void QXcbScreen::readXResources() | - | ||||||||||||||||||||||||
| 757 | { | - | ||||||||||||||||||||||||
| 758 | int offset = 0; | - | ||||||||||||||||||||||||
| 759 | QByteArray resources; | - | ||||||||||||||||||||||||
| 760 | while(1) { | - | ||||||||||||||||||||||||
| 761 | xcb_get_property_reply_t *reply = | - | ||||||||||||||||||||||||
| 762 | xcb_get_property_reply(xcb_connection(), | - | ||||||||||||||||||||||||
| 763 | xcb_get_property_unchecked(xcb_connection(), false, screen()->root, | - | ||||||||||||||||||||||||
| 764 | XCB_ATOM_RESOURCE_MANAGER, | - | ||||||||||||||||||||||||
| 765 | XCB_ATOM_STRING, offset/4, 8192), __null); | - | ||||||||||||||||||||||||
| 766 | bool more = false; | - | ||||||||||||||||||||||||
| 767 |         if (reply
 
 
  | 0-135 | ||||||||||||||||||||||||
| 768 | resources += QByteArray((const char *)xcb_get_property_value(reply), xcb_get_property_value_length(reply)); | - | ||||||||||||||||||||||||
| 769 | offset += xcb_get_property_value_length(reply); | - | ||||||||||||||||||||||||
| 770 | more = reply->bytes_after != 0; | - | ||||||||||||||||||||||||
| 771 |         } executed 135 times by 5 tests:  end of blockExecuted by: 
  | 135 | ||||||||||||||||||||||||
| 772 | - | |||||||||||||||||||||||||
| 773 |         if (reply
  | 0-135 | ||||||||||||||||||||||||
| 774 |             free(reply); executed 135 times by 5 tests:  free(reply);Executed by: 
  | 135 | ||||||||||||||||||||||||
| 775 | - | |||||||||||||||||||||||||
| 776 |         if (!more
  | 0-135 | ||||||||||||||||||||||||
| 777 |             break; executed 135 times by 5 tests:  break;Executed by: 
  | 135 | ||||||||||||||||||||||||
| 778 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 779 | - | |||||||||||||||||||||||||
| 780 | QList<QByteArray> split = resources.split('\n'); | - | ||||||||||||||||||||||||
| 781 |     for (int i = 0; i < split.size()
  | 135-945 | ||||||||||||||||||||||||
| 782 | const QByteArray &r = split.at(i); | - | ||||||||||||||||||||||||
| 783 | int value; | - | ||||||||||||||||||||||||
| 784 | QByteArray stringValue; | - | ||||||||||||||||||||||||
| 785 |         if (xResource(r, "Xft.dpi:\t", stringValue)
  | 135-810 | ||||||||||||||||||||||||
| 786 |             if (parseXftInt(stringValue, &value)
  | 0-135 | ||||||||||||||||||||||||
| 787 |                 m_forcedDpi = value; executed 135 times by 5 tests:  m_forcedDpi = value;Executed by: 
  | 135 | ||||||||||||||||||||||||
| 788 |         } executed 135 times by 5 tests:   else if (xResource(r, "Xft.hintstyle:\t", stringValue)end of blockExecuted by: 
 
  | 135-675 | ||||||||||||||||||||||||
| 789 | m_hintStyle = parseXftHintStyle(stringValue); | - | ||||||||||||||||||||||||
| 790 |         } executed 135 times by 5 tests:   else if (xResource(r, "Xft.antialias:\t", stringValue)end of blockExecuted by: 
 
  | 135-540 | ||||||||||||||||||||||||
| 791 |             if (parseXftInt(stringValue, &value)
  | 0-135 | ||||||||||||||||||||||||
| 792 |                 m_antialiasingEnabled = value; executed 135 times by 5 tests:  m_antialiasingEnabled = value;Executed by: 
  | 135 | ||||||||||||||||||||||||
| 793 |         } executed 135 times by 5 tests:   else if (xResource(r, "Xft.rgba:\t", stringValue)end of blockExecuted by: 
 
  | 135-405 | ||||||||||||||||||||||||
| 794 | m_subpixelType = parseXftRgba(stringValue); | - | ||||||||||||||||||||||||
| 795 |         } executed 135 times by 5 tests:  end of blockExecuted by: 
  | 135 | ||||||||||||||||||||||||
| 796 |     } executed 945 times by 5 tests:  end of blockExecuted by: 
  | 945 | ||||||||||||||||||||||||
| 797 | } executed 135 times by 5 tests:  end of blockExecuted by: 
  | 135 | ||||||||||||||||||||||||
| 798 | - | |||||||||||||||||||||||||
| 799 | QXcbXSettings *QXcbScreen::xSettings() const | - | ||||||||||||||||||||||||
| 800 | { | - | ||||||||||||||||||||||||
| 801 |     return executed 76 times by 38 tests:   m_virtualDesktop->xSettings();return m_virtualDesktop->xSettings();Executed by: 
 executed 76 times by 38 tests:  return m_virtualDesktop->xSettings();Executed by: 
  | 76 | ||||||||||||||||||||||||
| 802 | } | - | ||||||||||||||||||||||||
| 803 | - | |||||||||||||||||||||||||
| 804 | static inline void formatRect(QDebug &debug, const QRect r) | - | ||||||||||||||||||||||||
| 805 | { | - | ||||||||||||||||||||||||
| 806 | debug << r.width() << 'x' << r.height() | - | ||||||||||||||||||||||||
| 807 | << forcesign << r.x() << r.y() << noforcesign; | - | ||||||||||||||||||||||||
| 808 | } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 809 | - | |||||||||||||||||||||||||
| 810 | static inline void formatSizeF(QDebug &debug, const QSizeF s) | - | ||||||||||||||||||||||||
| 811 | { | - | ||||||||||||||||||||||||
| 812 | debug << s.width() << 'x' << s.height() << "mm"; | - | ||||||||||||||||||||||||
| 813 | } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 814 | - | |||||||||||||||||||||||||
| 815 | QDebug operator<<(QDebug debug, const QXcbScreen *screen) | - | ||||||||||||||||||||||||
| 816 | { | - | ||||||||||||||||||||||||
| 817 | const QDebugStateSaver saver(debug); | - | ||||||||||||||||||||||||
| 818 | debug.nospace(); | - | ||||||||||||||||||||||||
| 819 | debug << "QXcbScreen(" << (const void *)screen; | - | ||||||||||||||||||||||||
| 820 |     if (screen
  | 0 | ||||||||||||||||||||||||
| 821 | debug << fixed << qSetRealNumberPrecision(1); | - | ||||||||||||||||||||||||
| 822 | debug << ", name=" << screen->name(); | - | ||||||||||||||||||||||||
| 823 | debug << ", geometry="; | - | ||||||||||||||||||||||||
| 824 | formatRect(debug, screen->geometry()); | - | ||||||||||||||||||||||||
| 825 | debug << ", availableGeometry="; | - | ||||||||||||||||||||||||
| 826 | formatRect(debug, screen->availableGeometry()); | - | ||||||||||||||||||||||||
| 827 | debug << ", devicePixelRatio=" << screen->devicePixelRatio(); | - | ||||||||||||||||||||||||
| 828 | debug << ", logicalDpi=" << screen->logicalDpi(); | - | ||||||||||||||||||||||||
| 829 | debug << ", physicalSize="; | - | ||||||||||||||||||||||||
| 830 | formatSizeF(debug, screen->physicalSize()); | - | ||||||||||||||||||||||||
| 831 | - | |||||||||||||||||||||||||
| 832 | debug << ", screenNumber=" << screen->screenNumber(); | - | ||||||||||||||||||||||||
| 833 | debug << ", virtualSize=" << screen->virtualSize().width() << 'x' << screen->virtualSize().height() << " ("; | - | ||||||||||||||||||||||||
| 834 | formatSizeF(debug, screen->virtualSize()); | - | ||||||||||||||||||||||||
| 835 | debug << "), orientation=" << screen->orientation(); | - | ||||||||||||||||||||||||
| 836 | debug << ", depth=" << screen->depth(); | - | ||||||||||||||||||||||||
| 837 | debug << ", refreshRate=" << screen->refreshRate(); | - | ||||||||||||||||||||||||
| 838 | debug << ", root=" << hex << screen->root(); | - | ||||||||||||||||||||||||
| 839 | debug << ", windowManagerName=" << screen->windowManagerName(); | - | ||||||||||||||||||||||||
| 840 |     } never executed:  end of block | 0 | ||||||||||||||||||||||||
| 841 | debug << ')'; | - | ||||||||||||||||||||||||
| 842 |     return never executed:   debug;return debug;never executed:  return debug; | 0 | ||||||||||||||||||||||||
| 843 | } | - | ||||||||||||||||||||||||
| 844 | - | |||||||||||||||||||||||||
| 845 | - | |||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |