From 905de91c96d38cfe8430ff93061848e32ea5e46e Mon Sep 17 00:00:00 2001 From: thesource Date: Sun, 27 Sep 2020 11:10:14 +0300 Subject: [PATCH] Fixed LCD layout switching --- desmume/src/frontend/posix/gtk/main.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/desmume/src/frontend/posix/gtk/main.cpp b/desmume/src/frontend/posix/gtk/main.cpp index 2468a4be0..9ef85ef55 100644 --- a/desmume/src/frontend/posix/gtk/main.cpp +++ b/desmume/src/frontend/posix/gtk/main.cpp @@ -2137,7 +2137,14 @@ static void SetWinsize(GSimpleAction *action, GVariant *parameter, gpointer user static void SetOrientation(GSimpleAction *action, GVariant *parameter, gpointer user_data) { const char *string = g_variant_get_string(parameter, NULL); - nds_screen.orientation = (orientation_enum)g_ascii_strtoll(string, NULL, 10); + orientation_enum orient=ORIENT_VERTICAL; + if(strcmp(string, "vertical") == 0) + orient = ORIENT_VERTICAL; + else if(strcmp(string, "horizontal") == 0) + orient = ORIENT_HORIZONTAL; + else if(strcmp(string, "single") == 0) + orient = ORIENT_SINGLE; + nds_screen.orientation = orient; #ifdef HAVE_LIBAGG osd->singleScreen = nds_screen.orientation == ORIENT_SINGLE; #endif