Changeset View
Changeset View
Standalone View
Standalone View
shadow.cpp
Show First 20 Lines • Show All 118 Lines • ▼ Show 20 Line(s) | 117 | if (!shadow->init(s)) { | |||
---|---|---|---|---|---|
119 | return nullptr; | 119 | return nullptr; | ||
120 | } | 120 | } | ||
121 | return shadow; | 121 | return shadow; | ||
122 | } | 122 | } | ||
123 | 123 | | |||
124 | QVector< uint32_t > Shadow::readX11ShadowProperty(xcb_window_t id) | 124 | QVector< uint32_t > Shadow::readX11ShadowProperty(xcb_window_t id) | ||
125 | { | 125 | { | ||
126 | QVector<uint32_t> ret; | 126 | QVector<uint32_t> ret; | ||
127 | if (id != XCB_WINDOW) { | 127 | if (id != XCB_WINDOW_NONE) { | ||
zzag: It's a typo, right? | |||||
... I think it should be XCB_WINDOW_NONE. That way we won't need to check the operation mode. zzag: ... I think it should be XCB_WINDOW_NONE. That way we won't need to check the operation mode. | |||||
128 | Xcb::Property property(false, id, atoms->kde_net_wm_shadow, XCB_ATOM_CARDINAL, 0, 12); | 128 | Xcb::Property property(false, id, atoms->kde_net_wm_shadow, XCB_ATOM_CARDINAL, 0, 12); | ||
129 | uint32_t *shadow = property.value<uint32_t*>(); | 129 | uint32_t *shadow = property.value<uint32_t*>(); | ||
130 | if (shadow) { | 130 | if (shadow) { | ||
131 | ret.reserve(12); | 131 | ret.reserve(12); | ||
132 | for (int i=0; i<12; ++i) { | 132 | for (int i=0; i<12; ++i) { | ||
133 | ret << shadow[i]; | 133 | ret << shadow[i]; | ||
134 | } | 134 | } | ||
135 | } | 135 | } | ||
▲ Show 20 Lines • Show All 215 Lines • ▼ Show 20 Line(s) | 350 | if (m_topLevel && m_topLevel->surface()) { | |||
351 | if (const auto &s = m_topLevel->surface()->shadow()) { | 351 | if (const auto &s = m_topLevel->surface()->shadow()) { | ||
352 | if (init(s)) { | 352 | if (init(s)) { | ||
353 | return true; | 353 | return true; | ||
354 | } | 354 | } | ||
355 | } | 355 | } | ||
356 | } | 356 | } | ||
357 | } | 357 | } | ||
358 | 358 | | |||
359 | auto data = Shadow::readX11ShadowProperty(m_topLevel->window()); | 359 | auto data = Shadow::readX11ShadowProperty(m_topLevel->window()); | ||
zzag: What's the id of the Toplevel? | |||||
360 | if (data.isEmpty()) { | 360 | if (data.isEmpty()) { | ||
361 | return false; | 361 | return false; | ||
362 | } | 362 | } | ||
363 | 363 | | |||
364 | init(data); | 364 | init(data); | ||
365 | 365 | | |||
366 | return true; | 366 | return true; | ||
367 | } | 367 | } | ||
▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines |
It's a typo, right?