Changeset View
Changeset View
Standalone View
Standalone View
tabbox/tabboxhandler.cpp
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | 301 | #ifndef KWIN_UNIT_TEST | |||
---|---|---|---|---|---|
318 | m_mainItem = desktopMode ? findMainItem(m_desktopTabBoxes) : findMainItem(m_clientTabBoxes); | 318 | m_mainItem = desktopMode ? findMainItem(m_desktopTabBoxes) : findMainItem(m_clientTabBoxes); | ||
319 | if (!m_mainItem) { | 319 | if (!m_mainItem) { | ||
320 | m_mainItem = createSwitcherItem(desktopMode); | 320 | m_mainItem = createSwitcherItem(desktopMode); | ||
321 | if (!m_mainItem) { | 321 | if (!m_mainItem) { | ||
322 | return; | 322 | return; | ||
323 | } | 323 | } | ||
324 | } | 324 | } | ||
325 | if (SwitcherItem *item = switcherItem()) { | 325 | if (SwitcherItem *item = switcherItem()) { | ||
326 | // In case the model isn't yet set (see below), index will be reset and therefore we | ||||
327 | // need to save the current index row (https://bugs.kde.org/show_bug.cgi?id=333511). | ||||
328 | int indexRow = index.row(); | ||||
326 | if (!item->model()) { | 329 | if (!item->model()) { | ||
327 | QAbstractItemModel *model = nullptr; | 330 | QAbstractItemModel *model = nullptr; | ||
328 | if (desktopMode) { | 331 | if (desktopMode) { | ||
329 | model = desktopModel(); | 332 | model = desktopModel(); | ||
330 | } else { | 333 | } else { | ||
331 | model = clientModel(); | 334 | model = clientModel(); | ||
332 | } | 335 | } | ||
333 | item->setModel(model); | 336 | item->setModel(model); | ||
334 | } | 337 | } | ||
335 | item->setAllDesktops(config.clientDesktopMode() == TabBoxConfig::AllDesktopsClients); | 338 | item->setAllDesktops(config.clientDesktopMode() == TabBoxConfig::AllDesktopsClients); | ||
336 | item->setCurrentIndex(index.row()); | 339 | item->setCurrentIndex(indexRow); | ||
337 | // everything is prepared, so let's make the whole thing visible | 340 | // everything is prepared, so let's make the whole thing visible | ||
338 | item->setVisible(true); | 341 | item->setVisible(true); | ||
339 | } | 342 | } | ||
340 | if (QWindow *w = window()) { | 343 | if (QWindow *w = window()) { | ||
341 | wheelAngleDelta = 0; | 344 | wheelAngleDelta = 0; | ||
342 | w->installEventFilter(q); | 345 | w->installEventFilter(q); | ||
343 | } | 346 | } | ||
344 | #endif | 347 | #endif | ||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |