mirror of
https://github.com/xenia-project/xenia.git
synced 2025-12-06 07:12:03 +01:00
[UI] Disable showing notifications while making screenshot
This commit is contained in:
parent
78f97f8ff3
commit
c373208c97
|
|
@ -935,11 +935,16 @@ void EmulatorWindow::OnMouseUp(const ui::MouseEvent& e) {
|
||||||
|
|
||||||
void EmulatorWindow::TakeScreenshot() {
|
void EmulatorWindow::TakeScreenshot() {
|
||||||
xe::ui::RawImage image;
|
xe::ui::RawImage image;
|
||||||
|
|
||||||
|
imgui_drawer_->EnableNotifications(false);
|
||||||
|
|
||||||
if (!GetGraphicsSystemPresenter()->CaptureGuestOutput(image) ||
|
if (!GetGraphicsSystemPresenter()->CaptureGuestOutput(image) ||
|
||||||
GetGraphicsSystemPresenter() == nullptr) {
|
GetGraphicsSystemPresenter() == nullptr) {
|
||||||
XELOGE("Failed to capture guest output for screenshot");
|
XELOGE("Failed to capture guest output for screenshot");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
imgui_drawer_->EnableNotifications(true);
|
||||||
ExportScreenshot(image);
|
ExportScreenshot(image);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -503,7 +503,7 @@ void ImGuiDrawer::Draw(UIDrawContext& ui_draw_context) {
|
||||||
}
|
}
|
||||||
dialog_loop_next_index_ = SIZE_MAX;
|
dialog_loop_next_index_ = SIZE_MAX;
|
||||||
|
|
||||||
if (!notifications_.empty()) {
|
if (!notifications_.empty() && are_notifications_enabled_) {
|
||||||
std::vector<ui::ImGuiNotification*> guest_notifications = {};
|
std::vector<ui::ImGuiNotification*> guest_notifications = {};
|
||||||
std::vector<ui::ImGuiNotification*> host_notifications = {};
|
std::vector<ui::ImGuiNotification*> host_notifications = {};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@ class ImGuiDrawer : public WindowInputListener, public UIDrawer {
|
||||||
void Draw(UIDrawContext& ui_draw_context) override;
|
void Draw(UIDrawContext& ui_draw_context) override;
|
||||||
|
|
||||||
void ClearDialogs();
|
void ClearDialogs();
|
||||||
|
void EnableNotifications(bool enable) { are_notifications_enabled_ = enable; }
|
||||||
|
|
||||||
std::map<uint32_t, std::unique_ptr<ImmediateTexture>> LoadIcons(
|
std::map<uint32_t, std::unique_ptr<ImmediateTexture>> LoadIcons(
|
||||||
IconsData data);
|
IconsData data);
|
||||||
|
|
@ -155,6 +156,8 @@ class ImGuiDrawer : public WindowInputListener, public UIDrawer {
|
||||||
|
|
||||||
double frame_time_tick_frequency_;
|
double frame_time_tick_frequency_;
|
||||||
uint64_t last_frame_time_ticks_;
|
uint64_t last_frame_time_ticks_;
|
||||||
|
|
||||||
|
bool are_notifications_enabled_ = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ui
|
} // namespace ui
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue