From 846fd6815ed4e87f61ede91774cc542dd7ad8373 Mon Sep 17 00:00:00 2001 From: otavepto Date: Mon, 18 Mar 2024 05:57:24 +0200 Subject: [PATCH] allow overlay invitations to obscure game input to be able to accept/reject the request --- CHANGELOG.md | 1 + dll/network.cpp | 2 +- dll/steam_matchmaking_servers.cpp | 2 +- overlay_experimental/steam_overlay.cpp | 60 +++++++++++++------------- 4 files changed, 33 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65bec984..939636a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ * **[detiam]** fix linking errors when build on archlinux * for windows: updated stub drm patterns and added a workaround for older variants * added missing example file `disable_lobby_creation.txt` in `steam_settings` folder + updated release `README` +* allow overlay invitations to obscure game input to be able to accept/reject the request --- diff --git a/dll/network.cpp b/dll/network.cpp index 70524873..71d17b9a 100644 --- a/dll/network.cpp +++ b/dll/network.cpp @@ -933,7 +933,7 @@ void Networking::Run() } //PRINT_DEBUG("Networking::Run() %lf\n", time_extra); - PRINT_DEBUG("Networking::Run()\n"); + // PRINT_DEBUG("Networking::Run()\n"); if (check_timedout(last_broadcast, BROADCAST_INTERVAL)) { send_announce_broadcasts(); } diff --git a/dll/steam_matchmaking_servers.cpp b/dll/steam_matchmaking_servers.cpp index 0841fc8e..90128190 100644 --- a/dll/steam_matchmaking_servers.cpp +++ b/dll/steam_matchmaking_servers.cpp @@ -717,7 +717,7 @@ void Steam_Matchmaking_Servers::CancelServerQuery( HServerQuery hServerQuery ) void Steam_Matchmaking_Servers::RunCallbacks() { - PRINT_DEBUG("Steam_Matchmaking_Servers::RunCallbacks\n"); + // PRINT_DEBUG("Steam_Matchmaking_Servers::RunCallbacks\n"); { auto g = std::begin(gameservers); diff --git a/overlay_experimental/steam_overlay.cpp b/overlay_experimental/steam_overlay.cpp index 1ce6d0fc..f43692c5 100644 --- a/overlay_experimental/steam_overlay.cpp +++ b/overlay_experimental/steam_overlay.cpp @@ -638,23 +638,23 @@ bool Steam_Overlay::submit_notification(notification_type type, const std::strin notifications.emplace_back(notif); allow_renderer_frame_processing(true); // uncomment this block to obscure cursor input and steal focus for these specific notifications - // switch (type) { - // // we want to steal focus for these ones - // case notification_type_message: - // case notification_type_invite: - // obscure_game_input(true); - // break; + switch (type) { + // we want to steal focus for these ones + case notification_type_invite: + obscure_game_input(true); + break; - // // not effective - // case notification_type_achievement: - // case notification_type_auto_accept_invite: - // // nothing - // break; + // not effective + case notification_type_achievement: + case notification_type_auto_accept_invite: + case notification_type_message: + // nothing + break; - // default: - // PRINT_DEBUG("Steam_Overlay::submit_notification error unhandled type %i\n", (int)type); - // break; - // } + default: + PRINT_DEBUG("Steam_Overlay::submit_notification error unhandled type %i\n", (int)type); + break; + } return true; } @@ -1021,23 +1021,23 @@ void Steam_Overlay::build_notifications(int width, int height) PRINT_DEBUG("Steam_Overlay::build_notifications removing a notification\n"); allow_renderer_frame_processing(false); // uncomment this block to restore app input focus - // switch (item.type) { - // // we want to restore focus for these ones - // case notification_type_message: - // case notification_type_invite: - // obscure_game_input(false); - // break; + switch (item.type) { + // we want to restore focus for these ones + case notification_type_invite: + obscure_game_input(false); + break; - // // not effective - // case notification_type_achievement: - // case notification_type_auto_accept_invite: - // // nothing - // break; + // not effective + case notification_type_achievement: + case notification_type_auto_accept_invite: + case notification_type_message: + // nothing + break; - // default: - // PRINT_DEBUG("Steam_Overlay::build_notifications error unhandled remove for type %i\n", (int)item.type); - // break; - // } + default: + PRINT_DEBUG("Steam_Overlay::build_notifications error unhandled remove for type %i\n", (int)item.type); + break; + } return true; }