From 85d94c07e410471920b2e57c3ac1819b72e91c70 Mon Sep 17 00:00:00 2001 From: riccardom Date: Fri, 14 May 2010 08:28:28 +0000 Subject: [PATCH] Window size bugfix from noodlebox. --- desmume/src/gtk/main.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/desmume/src/gtk/main.cpp b/desmume/src/gtk/main.cpp index f60a26bff..4028ace0f 100644 --- a/desmume/src/gtk/main.cpp +++ b/desmume/src/gtk/main.cpp @@ -1012,11 +1012,19 @@ static void UpdateDrawingAreaAspect() if (nds_screen.rotation_angle == 0 || nds_screen.rotation_angle == 180) { W = screen_size[nds_screen.orientation].width; - H = screen_size[nds_screen.orientation].height + nds_screen.gap_size; + H = screen_size[nds_screen.orientation].height; } else { W = screen_size[nds_screen.orientation].height; - H = screen_size[nds_screen.orientation].width + nds_screen.gap_size; + H = screen_size[nds_screen.orientation].width; } + + if ((nds_screen.rotation_angle == 0 || nds_screen.rotation_angle == 180) ^ + (nds_screen.orientation == ORIENT_HORIZONTAL)) { + H += nds_screen.gap_size; + } else { + W += nds_screen.gap_size; + } + gtk_widget_set_size_request(GTK_WIDGET(pDrawingArea), W, H); }