Browse Source

remove some comments

pull/2953/head
Maufeat 3 months ago
parent
commit
36fadd0a9a
  1. 5
      src/core/hle/service/am/applet_manager.cpp
  2. 5
      src/core/hle/service/am/display_layer_manager.cpp
  3. 12
      src/core/hle/service/psc/ovln/receiver.cpp
  4. 1
      src/core/hle/service/psc/ovln/receiver.h
  5. 1
      src/core/hle/service/vi/container.cpp

5
src/core/hle/service/am/applet_manager.cpp

@ -272,15 +272,10 @@ void AppletManager::SetWindowSystem(WindowSystem* window_system) {
overlay_applet->program_id = static_cast<u64>(AppletProgramId::OverlayDisplay);
overlay_applet->applet_id = AppletId::OverlayDisplay;
overlay_applet->type = AppletType::OverlayApplet;
// Use PartialForeground so blending is enabled and overlay can be composed on top
overlay_applet->library_applet_mode = LibraryAppletMode::PartialForeground;
// Start with overlay visible but with low z-index (showing vignette behind app)
// Home button will toggle it to foreground (high z-index) to show full overlay
overlay_applet->window_visible = true;
// Enable home button watching so overlay can be toggled with home button
overlay_applet->home_button_short_pressed_blocked = false;
overlay_applet->home_button_long_pressed_blocked = false;
// Track as a non-application so WindowSystem routes it to m_overlay_display
m_window_system->TrackApplet(overlay_applet, false);
overlay_applet->process->Run();
LOG_INFO(Service_AM, "called, Overlay applet launched before application (initially hidden, watching home button)");

5
src/core/hle/service/am/display_layer_manager.cpp

@ -37,7 +37,6 @@ void DisplayLayerManager::Initialize(Core::System& system, Kernel::KProcess* pro
m_blending_enabled = mode == LibraryAppletMode::PartialForeground ||
mode == LibraryAppletMode::PartialForegroundIndirectDisplay;
// For non-application applets, proactively enable shared buffer session so the layer exists
if (m_applet_id != AppletId::Application) {
(void)this->IsSystemBufferSharingEnabled();
}
@ -76,14 +75,10 @@ Result DisplayLayerManager::CreateManagedDisplayLayer(u64* out_layer_id) {
R_TRY(m_manager_display_service->CreateManagedLayer(
out_layer_id, 0, display_id, Service::AppletResourceUserId{m_process->GetProcessId()}));
// Ensure visibility follows our state
m_manager_display_service->SetLayerVisibility(m_visible, *out_layer_id);
// For non-application applets (e.g., overlay), make sure UI layers blend
if (m_applet_id != AppletId::Application) {
(void)m_manager_display_service->SetLayerBlending(m_blending_enabled, *out_layer_id);
// Start with lower z-index for overlay (vignette/background mode)
// Will be raised when overlay is opened
if (m_applet_id == AppletId::OverlayDisplay) {
static constexpr s32 kOverlayBackgroundZ = -100000;
(void)m_manager_display_service->SetLayerZIndex(kOverlayBackgroundZ, *out_layer_id);

12
src/core/hle/service/psc/ovln/receiver.cpp

@ -31,7 +31,6 @@ Result IReceiver::AddSource(SourceName source_name) {
const std::string name = source_name.GetString();
LOG_INFO(Service_PSC, "called: source_name={}", name);
// Add source if it doesn't already exist
if (message_sources.find(name) == message_sources.end()) {
message_sources[name] = {};
}
@ -43,7 +42,6 @@ Result IReceiver::RemoveSource(SourceName source_name) {
const std::string name = source_name.GetString();
LOG_INFO(Service_PSC, "called: source_name={}", name);
// Remove source if it exists
message_sources.erase(name);
R_SUCCEED();
@ -64,7 +62,6 @@ Result IReceiver::ReceiveWithTick(Out<OverlayNotification> out_notification,
Out<MessageFlags> out_flags, Out<u64> out_tick) {
LOG_DEBUG(Service_PSC, "called");
// Find the message with the lowest ID across all sources
const std::string* target_source = nullptr;
size_t target_index = 0;
@ -74,8 +71,6 @@ Result IReceiver::ReceiveWithTick(Out<OverlayNotification> out_notification,
target_source = &source_name;
target_index = 0;
}
// Note: In the real implementation, we would track message IDs
// For now, just use FIFO order
}
}
@ -83,12 +78,10 @@ Result IReceiver::ReceiveWithTick(Out<OverlayNotification> out_notification,
auto& messages = message_sources[*target_source];
*out_notification = messages[target_index].first;
*out_flags = messages[target_index].second;
*out_tick = 0; // TODO: Implement tick tracking
*out_tick = 0;
// Remove the message
messages.erase(messages.begin() + target_index);
// Clear event if no more messages
bool has_messages = false;
for (const auto& [_, msgs] : message_sources) {
if (!msgs.empty()) {
@ -103,13 +96,12 @@ Result IReceiver::ReceiveWithTick(Out<OverlayNotification> out_notification,
R_SUCCEED();
}
// No messages available
*out_notification = {};
*out_flags = {};
*out_tick = 0;
LOG_WARNING(Service_PSC, "No messages available");
R_THROW(ResultUnknown); // TODO: Use proper OvlnResult::NoMessages when available
R_THROW(ResultUnknown);
}
} // namespace Service::PSC

1
src/core/hle/service/psc/ovln/receiver.h

@ -40,7 +40,6 @@ private:
KernelHelpers::ServiceContext service_context;
Kernel::KEvent* receive_event;
// Message sources map (source name -> message queue)
std::map<std::string, std::vector<std::pair<OverlayNotification, MessageFlags>>> message_sources;
};

1
src/core/hle/service/vi/container.cpp

@ -140,7 +140,6 @@ Result Container::SetLayerZIndex(u64 layer_id, s32 z_index) {
auto* const layer = m_layers.GetLayerById(layer_id);
R_UNLESS(layer != nullptr, VI::ResultNotFound);
// Forward to nvnflinger layer via surface flinger (store on the layer struct)
if (auto layer_ref = m_surface_flinger->FindLayer(layer->GetConsumerBinderId())) {
LOG_DEBUG(Service_VI, "called, SetLayerZIndex layer_id={} z={} (cid={})", layer_id,
z_index, layer->GetConsumerBinderId());

Loading…
Cancel
Save