MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / setInnerFocus

Method setInnerFocus

Telegram/SourceFiles/mainwidget.cpp:1277–1305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1275}
1276
1277void MainWidget::setInnerFocus() {
1278 const auto setTo = [&](auto &&widget) {
1279 if (widget->isHidden()) {
1280 // If we try setting focus inside a hidden widget, we may
1281 // end up focusing search field in dialogs on window activation.
1282 setFocus();
1283 } else {
1284 widget->setInnerFocus();
1285 }
1286 };
1287 if (_dialogs && _dialogs->searchHasFocus()) {
1288 setTo(_dialogs);
1289 } else if (_hider || !_history->peer()) {
1290 if (!_hider && _mainSection) {
1291 setTo(_mainSection);
1292 } else if (!_hider && _thirdSection) {
1293 setTo(_thirdSection);
1294 } else if (_dialogs) {
1295 setTo(_dialogs);
1296 } else {
1297 // Maybe we're just closing a child window, content is destroyed.
1298 _history->setFocus();
1299 }
1300 } else if (_mainSection) {
1301 setTo(_mainSection);
1302 } else {
1303 setTo(_history);
1304 }
1305}
1306
1307void MainWidget::showChooseReportMessages(
1308 not_null<PeerData*> peer,

Callers 7

hiderLayerMethod · 0.45
searchMessagesMethod · 0.45
showHistoryMethod · 0.45
showBackFromStackMethod · 0.45
eventFilterMethod · 0.45
handleHistoryBackMethod · 0.45
activateMethod · 0.45

Calls 4

isHiddenMethod · 0.45
searchHasFocusMethod · 0.45
peerMethod · 0.45
setFocusMethod · 0.45

Tested by

no test coverage detected