Changeset View
Changeset View
Standalone View
Standalone View
effects/sheet/sheet.cpp
Show First 20 Lines • Show All 131 Lines • ▼ Show 20 Line(s) | 121 | { | |||
---|---|---|---|---|---|
132 | const EffectWindowList stack = effects->stackingOrder(); | 132 | const EffectWindowList stack = effects->stackingOrder(); | ||
133 | // find parent | 133 | // find parent | ||
134 | foreach (EffectWindow * window, stack) { | 134 | foreach (EffectWindow * window, stack) { | ||
135 | if (window->findModal() == w) { | 135 | if (window->findModal() == w) { | ||
136 | info->parentY = window->y(); | 136 | info->parentY = window->y(); | ||
137 | break; | 137 | break; | ||
138 | } | 138 | } | ||
139 | } | 139 | } | ||
140 | | ||||
141 | w->setData(WindowAddedGrabRole, QVariant::fromValue(static_cast<void*>(this))); | ||||
davidedmundson: why the cast? | |||||
Long story short: because other effects do the same. df2b3170cbfddd3ac671c711e5839e2a51523e26 introduced grab roles (before that, effects used proxies to tell other effects what windows to ignore). At that time, Effect wasn't a QObject. So, the only viable option was to cast to void*. Because other effects do w->data(WindowAddedGrabRole).value<void*>(), we need the cast. zzag: Long story short: because other effects do the same.
df2b3170cbfddd3ac671c711e5839e2a51523e26… | |||||
142 | | ||||
140 | w->addRepaintFull(); | 143 | w->addRepaintFull(); | ||
141 | } | 144 | } | ||
142 | 145 | | |||
143 | void SheetEffect::slotWindowClosed(EffectWindow* w) | 146 | void SheetEffect::slotWindowClosed(EffectWindow* w) | ||
144 | { | 147 | { | ||
145 | if (!isSheetWindow(w)) | 148 | if (!isSheetWindow(w)) | ||
146 | return; | 149 | return; | ||
147 | 150 | | |||
Show All 15 Lines | 165 | foreach (EffectWindow * window, stack) { | |||
163 | if (window->findModal() == w) { | 166 | if (window->findModal() == w) { | ||
164 | info->parentY = window->y(); | 167 | info->parentY = window->y(); | ||
165 | found = true; | 168 | found = true; | ||
166 | break; | 169 | break; | ||
167 | } | 170 | } | ||
168 | } | 171 | } | ||
169 | if (!found) | 172 | if (!found) | ||
170 | info->parentY = 0; | 173 | info->parentY = 0; | ||
174 | | ||||
175 | w->setData(WindowClosedGrabRole, QVariant::fromValue(static_cast<void*>(this))); | ||||
176 | | ||||
171 | w->addRepaintFull(); | 177 | w->addRepaintFull(); | ||
172 | } | 178 | } | ||
173 | 179 | | |||
174 | void SheetEffect::slotWindowDeleted(EffectWindow* w) | 180 | void SheetEffect::slotWindowDeleted(EffectWindow* w) | ||
175 | { | 181 | { | ||
176 | windows.remove(w); | 182 | windows.remove(w); | ||
177 | } | 183 | } | ||
178 | 184 | | |||
Show All 25 Lines |
why the cast?