EmuWindow: Remove window title getters/setters.

The window title is none of the emulation core's business. The GUI code is free to put whatever it wants there.
Providing properly thread-safe window title getters and setters is a mess anyway.
This commit is contained in:
Tony Wasserka 2014-11-13 18:17:39 +01:00 committed by ichfly
parent e2d82c0a2f
commit ddb9800259
4 changed files with 10 additions and 28 deletions

View file

@ -75,9 +75,10 @@ EmuWindow_GLFW::EmuWindow_GLFW() {
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
m_render_window = glfwCreateWindow(VideoCore::kScreenTopWidth, std::string window_title = Common::StringFromFormat("Citra | %s-%s", Common::g_scm_branch, Common::g_scm_desc);
(VideoCore::kScreenTopHeight + VideoCore::kScreenBottomHeight), m_render_window = glfwCreateWindow(VideoCore::kScreenTopWidth,
GetWindowTitle().c_str(), NULL, NULL); (VideoCore::kScreenTopHeight + VideoCore::kScreenBottomHeight),
window_title.c_str(), NULL, NULL);
if (m_render_window == NULL) { if (m_render_window == NULL) {
printf("Failed to create GLFW window! Exiting..."); printf("Failed to create GLFW window! Exiting...");

View file

@ -111,6 +111,9 @@ EmuThread& GRenderWindow::GetEmuThread()
GRenderWindow::GRenderWindow(QWidget* parent) : QWidget(parent), emu_thread(this), keyboard_id(0) GRenderWindow::GRenderWindow(QWidget* parent) : QWidget(parent), emu_thread(this), keyboard_id(0)
{ {
std::string window_title = Common::StringFromFormat("Citra | %s-%s", Common::g_scm_branch, Common::g_scm_desc);
setWindowTitle(QString::fromStdString(window_title));
keyboard_id = KeyMap::NewDeviceId(); keyboard_id = KeyMap::NewDeviceId();
ReloadSetKeymaps(); ReloadSetKeymaps();
@ -182,14 +185,6 @@ void GRenderWindow::DoneCurrent()
} }
void GRenderWindow::PollEvents() { void GRenderWindow::PollEvents() {
// TODO(ShizZy): Does this belong here? This is a reasonable place to update the window title
// from the main thread, but this should probably be in an event handler...
/*
static char title[128];
sprintf(title, "%s (FPS: %02.02f)", window_title_.c_str(),
video_core::g_renderer->current_fps());
setWindowTitle(title);
*/
} }
// On Qt 5.0+, this correctly gets the size of the framebuffer (pixels). // On Qt 5.0+, this correctly gets the size of the framebuffer (pixels).

View file

@ -117,7 +117,8 @@ GMainWindow::GMainWindow()
connect(GetHotkey("Main Window", "Load File", this), SIGNAL(activated()), this, SLOT(OnMenuLoadFile())); connect(GetHotkey("Main Window", "Load File", this), SIGNAL(activated()), this, SLOT(OnMenuLoadFile()));
connect(GetHotkey("Main Window", "Start Emulation", this), SIGNAL(activated()), this, SLOT(OnStartGame())); connect(GetHotkey("Main Window", "Start Emulation", this), SIGNAL(activated()), this, SLOT(OnStartGame()));
setWindowTitle(render_window->GetWindowTitle().c_str()); std::string window_title = Common::StringFromFormat("Citra | %s-%s", Common::g_scm_branch, Common::g_scm_desc);
setWindowTitle(window_title.c_str());
show(); show();

View file

@ -89,20 +89,8 @@ public:
return std::make_pair(client_area_width, client_area_height); return std::make_pair(client_area_width, client_area_height);
} }
// TODO: Remove
std::string GetWindowTitle() const {
return window_title;
}
// TODO: Remove
void SetWindowTitle(const std::string& val) {
window_title = val;
}
protected: protected:
// TODO: Remove window title initialization EmuWindow()
EmuWindow() :
window_title(Common::StringFromFormat("Citra | %s-%s", Common::g_scm_branch, Common::g_scm_desc))
{ {
// TODO // TODO
config.min_client_area_size = std::make_pair(300u, 500u); config.min_client_area_size = std::make_pair(300u, 500u);
@ -145,9 +133,6 @@ private:
virtual void OnMinimalClientAreaChangeRequest(const std::pair<unsigned,unsigned>& minimal_size) { virtual void OnMinimalClientAreaChangeRequest(const std::pair<unsigned,unsigned>& minimal_size) {
} }
// TODO: Remove
std::string window_title; ///< Current window title, should be used by window impl.
std::pair<unsigned,unsigned> framebuffer_size; std::pair<unsigned,unsigned> framebuffer_size;
unsigned client_area_width; ///< Current client width, should be set by window impl. unsigned client_area_width; ///< Current client width, should be set by window impl.