Skip to content

Commit

Permalink
Revert "No focus on new messages if auto-carousel is off (#5881)" (#5936
Browse files Browse the repository at this point in the history
)

This reverts commit 0f98115.
  • Loading branch information
thebentern authored Jan 25, 2025
1 parent a14346b commit 7649e70
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/graphics/Screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2662,13 +2662,14 @@ int Screen::handleStatusUpdate(const meshtastic::Status *arg)

int Screen::handleTextMessage(const meshtastic_MeshPacket *packet)
{
// If auto carousel is disabled -> return 0 and skip new messages handling
if (config.display.auto_screen_carousel_secs == 0)
return 0;

// Handle focus change based on message type
if (showingNormalScreen) {
setFrames(packet->from == 0 ? FOCUS_PRESERVE : FOCUS_TEXTMESSAGE);
// Outgoing message
if (packet->from == 0)
setFrames(FOCUS_PRESERVE); // Return to same frame (quietly hiding the rx text message frame)

// Incoming message
else
setFrames(FOCUS_TEXTMESSAGE); // Focus on the new message
}

return 0;
Expand Down Expand Up @@ -2755,4 +2756,4 @@ int Screen::handleAdminMessage(const meshtastic_AdminMessage *arg)
} // namespace graphics
#else
graphics::Screen::Screen(ScanI2C::DeviceAddress, meshtastic_Config_DisplayConfig_OledType, OLEDDISPLAY_GEOMETRY) {}
#endif // HAS_SCREEN
#endif // HAS_SCREEN

0 comments on commit 7649e70

Please sign in to comment.