Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt/RSX: reset gs_frame taskbar progr. when closing native progr. dialogs #4783

Merged
merged 2 commits into from
Jun 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion rpcs3/Emu/RSX/Overlays/overlays.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace rsx
if (auto dlg = manager->get<rsx::overlays::message_dialog>())
{
if (dlg->progress_bar_count())
Emu.GetCallbacks().handle_taskbar_progress(0, 0);
Emu.GetCallbacks().handle_taskbar_progress(0, 1);
}

manager->remove(uid);
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/Emu/System.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ struct EmuCallbacks
std::function<void()> on_stop;
std::function<void()> on_ready;
std::function<void()> exit;
std::function<void(s32, s32)> handle_taskbar_progress;
std::function<void(s32, s32)> handle_taskbar_progress; // (type, value) type: 0 for reset, 1 for increment, 2 for set_limit
std::function<std::shared_ptr<class KeyboardHandlerBase>()> get_kb_handler;
std::function<std::shared_ptr<class MouseHandlerBase>()> get_mouse_handler;
std::function<std::shared_ptr<class pad_thread>()> get_pad_handler;
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/rpcs3_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ void rpcs3_app::InitializeCallbacks()
switch (type)
{
case 0:
((gs_frame*)gameWindow)->progress_reset();
((gs_frame*)gameWindow)->progress_reset(value);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this not throw a warning about conversion into to bool?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not in VS

break;
case 1:
((gs_frame*)gameWindow)->progress_increment(value);
Expand Down
7 changes: 6 additions & 1 deletion rpcs3/rpcs3qt/gs_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ wm_event gs_frame::get_default_wm_event() const
return (m_user_interaction_active) ? wm_event::geometry_change_in_progress : wm_event::none;
}

void gs_frame::progress_reset()
void gs_frame::progress_reset(bool reset_limit)
{
#ifdef _WIN32
if (m_tb_progress)
Expand All @@ -427,6 +427,11 @@ void gs_frame::progress_reset()
#elif HAVE_QTDBUS
UpdateProgress(0);
#endif

if (reset_limit)
{
progress_set_limit(100);
}
}

void gs_frame::progress_increment(int delta)
Expand Down
2 changes: 1 addition & 1 deletion rpcs3/rpcs3qt/gs_frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class gs_frame : public QWindow, public GSFrameBase
wm_event get_default_wm_event() const override;

// taskbar progress
void progress_reset();
void progress_reset(bool reset_limit = false);
void progress_increment(int delta);
void progress_set_limit(int limit);

Expand Down