Scale Issue with 3.6 Release

Previous Version (Worked) : 3.6.0.1114
Current Version (Bugged): 3.6.0.1625 (Latest 3.6 release as of posting)
DirectX/Windows project.

I think the way I am scaling is a bad way (draw everything to a render target, then scale that to whatever the back buffer’s dimensions are) in the first place, but anyway it worked before in MG after this issue was solved.

I am in the process of moving onto viewports for scaling but thought it may be worth mentioning.

If you don’t change _viewWidth and _viewHeight when the back buffer is resized this is expected behavior. It was wrong before.

1 Like

I was changing _viewWidth and _viewHeight before (else it wouldn’t have worked in first place?).

Prior to the linked issue, (3.5 basically) it did this, after the issue it drew the RT to whatever size I changed the back buffer too, now it is behaving as before.

I have moved onto using viewports now anyway but can look into it more later if need be.

I basically was doing this on Window.ClientSizeChanged:

_viewWidth = GraphicsDevice.PresentationParameters.BackBufferWidth;

So I think PresentationParameters are not being updated anymore on size change events. (which I think was the issue in that linked PR).

I will have a test later at home.

Are you resizing the back buffer through code? The ClientResize event is only raised when the user resizes the window or when you switch to/from full screen mode.

Yeah, this threw me for a loop a well, but after playing with it I realized it had just been wrong before.

My code also doesn’t work properly after I switched to 3.6 (a while ago).
Can someone tell me what’s wrong here?

It worked like that before, now the backbuffer is randomly not correct, while the rendertargets have the correct size.

private void ClientChangedWindowSize(object sender, EventArgs e)
        {
            if (GraphicsDevice.Viewport.Width != _graphics.PreferredBackBufferWidth ||
                GraphicsDevice.Viewport.Height != _graphics.PreferredBackBufferHeight)
            {
                if (Window.ClientBounds.Width == 0) return;
                _graphics.PreferredBackBufferWidth = Window.ClientBounds.Width;
                _graphics.PreferredBackBufferHeight = Window.ClientBounds.Height;
                _graphics.ApplyChanges();

                GameSettings.g_ScreenWidth = Window.ClientBounds.Width;
                GameSettings.g_ScreenHeight = Window.ClientBounds.Height;

                _screenManager.UpdateResolution();
            }
        }

You can see that in the gif below, there are white borders, which seem to be random. Note: The g_ScreenWidth parameters are correct the UI looks like it’s scaled correctly to the new window size.

You don’t have to resize the backbuffer yourself, MG takes care of that. Is that a DX project?

yes

Commenting these lines out changes nothing.

If i draw nothing but
GraphicsDevice.Clear(Color.Red);

this still happens, so it’s most likely not on the rest of my code.
If i have no Eventhandler set up it’s still the same problem. This did not happen with 3.5, but it’s hard to say where it went wrong.

Doe’s this work ?

private void ClientChangedWindowSize(object sender, EventArgs e)
        {
                GameSettings.g_ScreenWidth = GraphicsDevice.Viewport.Width;
                GameSettings.g_ScreenHeight = GraphicsDevice.Viewport.Height;

                _screenManager.UpdateResolution();
        }

if not first thing im gonna have to do when i download the nightly is break out my old test to see whats going on lol

no, changes nothing, the gamesettings and internal resolution are correct.

If i don’t call clientChangedWindows it changes nothing, too, apart from the rendertargets not being correct

As shown in the last post it breaks even with an empty solution

Hold on i have test class try this, it should show whats going wrong.

You have to flip on the console in a new project and paste it in game1 > project > properties > application > click the drop down box > output type > console.

It outputs pretty much everything that is happening or changing between resizes.

Just copy paste all of this right into a new game1 project as is minus the namespace of course. This is just a straight testing class.

It runs a auto test at first i used to use that as comparisons between versions when it was really really buggy.

flip the bool off at the top of the class.

        // runs a scripted test at start
        bool run_test_script = false;

this is probably a older version of the test same thing just doesn’t look as nice.

Two parts two classes two posts.

using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;

namespace MgFsWindowingTests12
{
    /// <summary>
    /// This is the main type for your game.
    /// </summary>
    public class Game1 : Game
    {

        // change to false to see all variable info per change
        bool just_display_changes = true;

        // this only works if just_display_changes is true
        bool display_unchanged_stuff = false;

        // runs a scripted test at start
        bool run_test_script = true;

        // show code in test
        bool show_code = true;

        // scripted and user pause amount
        int input_pause_amount = 10;

        GraphicsDeviceManager gdm;
        GraphicsDevice gd;
        SpriteBatch spriteBatch;
        KeyboardState kbs;
        Point started = new Point(GraphicsDeviceManager.DefaultBackBufferWidth, GraphicsDeviceManager.DefaultBackBufferHeight);
        Point preset = new Point(1200, 720);
        Point preferred = new Point(800, 600);
        private bool was_resize_called = false;
        private bool was_apply_called = false;
        private int onresizecounter = 0;
        private int wasapplycalledcounter = 0;

        List<DisplayMode> sdm = new List<DisplayMode>();
        DisplayMode starteddm;
        int startedbestdmindex = -1;

        int auto_script_cmd_value = -1;
        int auto_script_cmd_execution = -1;

        static string nline = Environment.NewLine;
        static string tab4 = "    ";
        static string dline = "__________________________________________________________________________________________________________________________";
        static string ndnline = nline + dline + nline + nline;

        public void RunAutoScript()
        {
            auto_script_cmd_value = -1;
            if (run_test_script && auto_script_cmd_execution < 11 && pause < 0)
            {
                auto_script_cmd_execution++;
                switch (auto_script_cmd_execution)
                {
                    case 0:
                        Console.WriteLine("");
                        input_pause_amount = input_pause_amount * 10;
                        pause = 540;
                        Console.WriteLine(nline + " Auto Script Commands About to Start in 5 Seconds Please Wait pause amount changed to " + input_pause_amount + nline + nline + nline);
                        break;
                    case 1: // F2 expand window to preset value
                        auto_script_cmd_value = 2;
                        break;
                    case 2: // f10 goto fullscreen
                        auto_script_cmd_value = 10;
                        break;
                    case 3: // f9 next fullscreen mode change
                        auto_script_cmd_value = 9;
                        break;
                    case 4: // f9 next fullscreen mode change
                        auto_script_cmd_value = 9;
                        break;
                    case 5: // f9 next fullscreen mode change
                        auto_script_cmd_value = 9;
                        break;
                    case 6: // f11 drop out of fullscreen with gdm apply
                        auto_script_cmd_value = 11;
                        break;
                    case 7: // F1 shrink window to started value
                        auto_script_cmd_value = 1;
                        break;
                    case 8: // f12 toggle fullscreen
                        auto_script_cmd_value = 12;
                        break;
                    case 9: // f12 toggle fullscreen
                        auto_script_cmd_value = 12;
                        break;
                    case 10: // f3 set backbuffer thru presentation parameters
                        auto_script_cmd_value = 3;
                        break;
                    default: // set pause amound back to normal
                        auto_script_cmd_value = -1;
                        //input_pause_amount = (int)(input_pause_amount * .10f);
                        Console.WriteLine("");
                        Console.WriteLine("Auto Script Commands Ended press f7 for options");
                        Console.WriteLine("");
                        break;
                }
            }
        }

        public Game1()
        {
            IsMouseVisible = true;
            gdm = new GraphicsDeviceManager(this);
            Console.WriteLine(nline + "*** Game1 Constructor()");
            Console.WriteLine
                (
                nline + " the below changes take effect in this constructor" +
                nline + " gdm.PreferredBackBufferWidth  = preferred.X; " + preferred.X +
                nline + " gdm.PreferredBackBufferHeight = preferred.Y; " + preferred.Y +
                nline + " allow user resizing and register a callback for window.clientsizechanged"
                );
            gdm.PreferredBackBufferWidth = preferred.X;
            gdm.PreferredBackBufferHeight = preferred.Y;
            gdm.PreferredBackBufferFormat = SurfaceFormat.Color;
            Window.AllowUserResizing = true;

            Window.ClientSizeChanged += OnResize;
            //Window.ClientSizeChanged += OnJamesCode;

            Content.RootDirectory = "Content";
            //gdm.SynchronizeWithVerticalRetrace = false;
            //gdm.IsFullScreen = true;
            //gdm.PreparingDeviceSettings += GdmPreparingDeviceSettings;
        }

        private void ApplyTheChanges()
        {
            Console.WriteLine(nline + "  User or Script calling My ApplyTheChanges() which will make the call ");
            Console.WriteLine("  Before gdm.ApplyingChanges ");
            DisplayGdmGdWindowRecordedInfo();
            was_apply_called = true;
            wasapplycalledcounter++;
            Console.WriteLine(nline + "  Now we will call...  gdm.ApplyChanges()...");
            gdm.ApplyChanges();
            if (was_resize_called == true)
            {
                Console.WriteLine("  After  gdm.ApplyingChanges was called ... OnResize Was called from gdm.ApplyChanges");
            }
            else
            {
                Console.WriteLine("  After  gdm.ApplyingChanges was called ... OnResize was NOT Yet called");
            }
            DisplayGdmGdWindowRecordedInfo();
            Console.WriteLine("   ...leaving my ApplyTheChanges method");
        }

        public void OnResize(object sender, EventArgs e)
        {
            Console.WriteLine(nline + "  \"A Resize Has Just Occured\"  Window.ClientSizeChanged has fired...OnResize()");
            onresizecounter++;
            if (was_apply_called == false)
            {
                Console.WriteLine("  Within OnResize.... My ApplyTheChanges() Was NOT called");
            }
            else
            {
                Console.WriteLine("  Within OnResize.... My ApplyTheChanges() Was called");
            }
            was_resize_called = true;
            DisplayGdmGdWindowRecordedInfo();
        }

        protected override void Initialize()
        {
            Console.WriteLine(nline + "*** Game Initialize()");
            gd = gdm.GraphicsDevice;
            ListSupportedDisplayModes();
            //Window.Title = gd.Adapter.DeviceName; // not yet implemented in monogame
            //Window.Title += gd.Adapter.Description; // not yet implemented in monogame
            base.Initialize();
        }

        protected override void LoadContent()
        {
            Console.WriteLine(nline + "*** Game LoadContent()");
            gd = GraphicsDevice;
            spriteBatch = new SpriteBatch(GraphicsDevice);
            // get current display mode and find best matches
            starteddm = gd.Adapter.CurrentDisplayMode;
            sdm = FindBestDisplayModes();
            startedbestdmindex = FindCurrentOrClosestDisplayModeInList(sdm, starteddm);
            // printout what we are doing
            Console.WriteLine(nline + " started backbuffer was " + started + " set to prefered " + preferred);
            DisplayGdmGdWindowRecordedInfo();
            Console.WriteLine(nline + " Vtrace period gdm.GraphicsDevice.PresentationParameters.PresentationInterval " + gdm.GraphicsDevice.PresentationParameters.PresentationInterval);
            DisplayOptions();
        }

        protected void DisplayOptions()
        {
            Console.WriteLine(
                nline + "_____Available Options_____________" +
                nline +
                nline + " F1  sets started " + started +
                nline + " F2  sets preset " + preset +
                nline + " F3  sets the presentation backbuffer thru the graphics device to 400x400 " +
                nline + " F4  lists supported display modes " +
                nline + " F5  display current status " +
                nline + " F6  go into fullscreen " +
                nline + " F7  go out of fullscreen " +
                nline + " F8  list options " +
                nline + " F9  attempts to set to the next display mode " + preset +
                nline + " F10 to set fullscreen true " +
                nline + " F11 to set fullscreen false " +
                nline + " F12 to toggle fullscreen"
                );
        }

        protected override void UnloadContent()
        {
        }

        protected override void Update(GameTime gameTime)
        {
            was_resize_called = false;
            was_apply_called = false;

            kbs = Keyboard.GetState();

            if (kbs.IsKeyDown(Keys.Escape))
                this.Exit();

            // switch preferred

            if ((kbs.IsKeyDown(Keys.F1) || auto_script_cmd_value == 1) && Paused == false)
            {
                Console.WriteLine(ndnline + "INPUT  F1   Setting gdm preferred backbuffer" + started + nline);
                SetPreferred(started.X, started.Y);
                ApplyTheChanges();
            }

            if ((kbs.IsKeyDown(Keys.F2) || auto_script_cmd_value == 2) && Paused == false)
            {
                Console.WriteLine(ndnline + "INPUT  F2   Setting gdm preferred backbuffer " + preset + nline);
                SetPreferred(preset.X, preset.Y);
                ApplyTheChanges();
            }

            if ((kbs.IsKeyDown(Keys.F3) || auto_script_cmd_value == 3) && Paused == false)
            {
                Console.WriteLine(ndnline + "INPUT  F3   set backbuffer thru gd presentation parameters 400x400" + nline);
                SetBackBufferThruGdPresentationParams(400, 400);
                ApplyTheChanges();
            }

            if ((kbs.IsKeyDown(Keys.F4) || auto_script_cmd_value == 4) && Paused == false)
            {
                Console.WriteLine(ndnline + "INPUT  F4   List Supported Display Modes" + nline);
                ListSupportedDisplayModes();
            }

            if ((kbs.IsKeyDown(Keys.F5) || auto_script_cmd_value == 5) && Paused == false)
            {
                Console.WriteLine(ndnline + "INPUT  F5   Display Current Status" + nline);
                RecordDiff.DisplayCurrentStatus(gdm, gd, Window);
            }

            if ((kbs.IsKeyDown(Keys.F6) || auto_script_cmd_value == 6) && Paused == false)
            {
                Console.WriteLine(ndnline + "INPUT  F6   Go into fullscreen -- Setting gdm preferred backbuffer" + started + nline);
                SetFullScreen(true);
                SetPreferred(gd.DisplayMode.Width, gd.DisplayMode.Height);
                ApplyTheChanges();
            }

            if ((kbs.IsKeyDown(Keys.F7) || auto_script_cmd_value == 7) && Paused == false)
            {
                Console.WriteLine(ndnline + "INPUT  F7   Backout of fullscreen -- Setting gdm preferred backbuffer" + started + nline);
                SetFullScreen(false);
                SetPreferred(started.X, started.Y);
                ApplyTheChanges();
            }

            if ((kbs.IsKeyDown(Keys.F8) || auto_script_cmd_value == 8) && Paused == false)
            {
                Console.WriteLine(ndnline + "INPUT  F8   Show Options" + nline);
                DisplayOptions();
            }

            // attempt to switch to different display mode resolutions

            if ((kbs.IsKeyDown(Keys.F9) || auto_script_cmd_value == 9) && Paused == false)
            {
                Console.WriteLine(ndnline + "INPUT  F9   attempting next displaymode" + nline);
                ChangeToNextDisplayMode();
                ApplyTheChanges();
            }

            // different ways to just call fullscreen

            if ((kbs.IsKeyDown(Keys.F10) || auto_script_cmd_value == 10) && Paused == false)
            {
                Console.WriteLine(ndnline + "INPUT  F10   set to fullscreen via gdm applychanges" + nline);
                SetFullScreen(true);
                ApplyTheChanges();
            }

            if ((kbs.IsKeyDown(Keys.F11) || auto_script_cmd_value == 11) && Paused == false)
            {
                Console.WriteLine(ndnline + "INPUT  F11   set to windowed   via gdm applychanges" + nline);
                SetFullScreen(false);
                ApplyTheChanges();
            }

            if ((kbs.IsKeyDown(Keys.F12) || auto_script_cmd_value == 12) && Paused == false)
            {
                Console.WriteLine(ndnline + "INPUT  F12   toggle fullscreen (their is no call to apply changes like this)" + nline);
                TheFullScreenToggle();
                // no apply changes is called for this normally in xna or xna calls it on its own
                ApplyTheChanges();
            }

            CheckForDoubleCalls();

            RunAutoScript();

            ReducePause();

            base.Update(gameTime);
        }

        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);
            base.Draw(gameTime);
        }

        private void DisplayGdmGdWindowRecordedInfo()
        {
            gd = gdm.GraphicsDevice; // just to show gd is in fact current
            new RecordDiff(gdm, gd, Window);
            if (just_display_changes && RecordDiff.EnoughRecords)
            {
                RecordDiff.DisplayDifferences(display_unchanged_stuff);
            }
            else
            {
                RecordDiff.DisplayCurrentStatus(gdm, gd, Window);
            }
        }


        private void CheckForDoubleCalls()
        {
            if (wasapplycalledcounter > 1)
            {
                Console.WriteLine(nline + " !!! Note !!! ApplyTheChanges was fired more then once ... this for the test so i dont do it by accident");
            }
            if (onresizecounter > 1)
            {
                Console.WriteLine(nline + " !!! Note !!! OnResize was fired more then once... this would only be normal if applychanges was called more then once");
            }
            onresizecounter = 0;
            wasapplycalledcounter = 0;
        }

        public void SetPreferred(int w, int h)
        {
            if (show_code)
            {
                Console.WriteLine(
                    tab4 + "Code" +
                    nline + tab4 + "preferred.X = w;" +
                    nline + tab4 + "preferred.Y = h;" +
                    nline + tab4 + "gdm.PreferredBackBufferWidth = preferred.X;" +
                    nline + tab4 + "gdm.PreferredBackBufferHeight = preferred.Y;"
                    );
            }
            Console.WriteLine(nline + " we have made a called to set gdm.PreferredBackBuffer.WH from " + preferred + " to (" + w + "," + h + ")");
            preferred.X = w;
            preferred.Y = h;
            gdm.PreferredBackBufferWidth = preferred.X;
            gdm.PreferredBackBufferHeight = preferred.Y;
        }

        public void SetBackBufferThruGdPresentationParams(int w, int h)
        {
            if (show_code)
            {
                Console.WriteLine(
                    tab4 + "Code" +
                    nline + tab4 + "gd.PresentationParameters.BackBufferWidth = w;" +
                    nline + tab4 + "gd.PresentationParameters.BackBufferHeight = h;"
                    );
            }
            gd.PresentationParameters.BackBufferWidth = w;
            gd.PresentationParameters.BackBufferHeight = h;
        }

        public void SetFullScreen(bool tf)
        {
            if (show_code)
            {
                Console.WriteLine(
                    tab4 + "Code" +
                    nline + tab4 + "if (tf != gdm.IsFullScreen){gdm.IsFullScreen = tf;}"
                    );
            }
            Console.WriteLine(nline + " checking gdm.isfullscreen(" + gdm.IsFullScreen + ") requesting change to " + tf);
            if (tf != gdm.IsFullScreen)
            {
                Console.WriteLine(" Ok changing gdm.isfullscreen setting To " + tf);
            }
            else
            {
                Console.WriteLine(" !!note!! gdm isfullscreen is " + tf + " Already !!!!!!!!");
            }
            gdm.IsFullScreen = tf;
        }

        public void TheFullScreenToggle()
        {
            if (show_code)
            {
                Console.WriteLine(
                    tab4 + "Code" +
                    nline + tab4 + "gdm.ToggleFullScreen();"
                    );
            }
            gdm.ToggleFullScreen();
            DisplayGdmGdWindowRecordedInfo();
        }

        public void ListSupportedDisplayModes()
        {
            Console.WriteLine(nline + " list supported Display modes");
            Console.WriteLine("  Current Mode " + gd.Adapter.CurrentDisplayMode + nline);
            int counter = 0;
            counter = 0;
            //foreach (DisplayMode dm in GraphicsAdapter.DefaultAdapter.SupportedDisplayModes) // either works
            foreach (DisplayMode dm in gd.Adapter.SupportedDisplayModes)
            {
                Console.WriteLine(
                    "   DisplayMode[" + counter.ToString() + "] " + dm.Width.ToString() + "," + dm.Height.ToString() +
                    "   AspectRatio " + dm.AspectRatio.ToString() +
                    "   SurfaceFormat " + dm.Format.ToString()
                    //+" RefreshRate " + dm.RefreshRate.ToString()  //in monogame but not in xna 4.0 that's required for arm i think
                    );
                counter++;
            }
        }

        public void ChangeToNextDisplayMode()
        {

            if (show_code)
            {
                Console.WriteLine(
                    tab4 + "Code   :relevant:" +
                    nline + tab4 + "gdm.PreferredBackBufferWidth = dm.Width;" +
                    nline + tab4 + "gdm.PreferredBackBufferHeight = dm.Height;" +
                    nline + tab4 + "gdm.PreferredBackBufferFormat = dm.Format;" +
                    nline + tab4 + "//gd.PresentationParameters.BackBufferWidth = dm.Width;" +
                    nline + tab4 + "//gd.PresentationParameters.BackBufferHeight = dm.Height;" +
                    nline + tab4 + "//gd.PresentationParameters.BackBufferFormat = dm.Format;" +
                    nline + tab4 + "gdm.IsFullScreen = true; // call this specifically here as this might fail windowed"
                    );
            }
            Console.WriteLine(nline + " Next Display mode coaxing setting fullscreen");

            DisplayMode currentdm = gd.Adapter.CurrentDisplayMode;
            int curdisplaymodeindex = FindCurrentOrClosestDisplayModeInList(sdm, currentdm);
            int nextdisplaymodeindex = curdisplaymodeindex + 1;

            if (curdisplaymodeindex > -1)
            {
                Console.WriteLine(" Ensureing we are in fullscreen [code] gdm.IsFullScreen = true;");
                gdm.IsFullScreen = true;
                DisplayGdmGdWindowRecordedInfo();
                if (curdisplaymodeindex + 1 >= sdm.Count)
                {
                    curdisplaymodeindex = -1;
                    nextdisplaymodeindex = curdisplaymodeindex + 1;
                }
                Console.WriteLine(" gd.displaymode values now ... wh " + gd.DisplayMode.Width + "," + gd.DisplayMode.Height + " aspct " + gd.DisplayMode.AspectRatio + " format " + gd.DisplayMode.Format);
                Console.WriteLine(" attempt to switch to the next displaymode[" + nextdisplaymodeindex + "] from " + curdisplaymodeindex);
                DisplayMode dm = sdm[nextdisplaymodeindex];
                Console.WriteLine(" next displaymode wh " + dm.Width + "," + dm.Height + " sf " + dm.Format + " aspectratio " + dm.AspectRatio);
                gdm.PreferredBackBufferWidth = dm.Width;
                gdm.PreferredBackBufferHeight = dm.Height;
                gdm.PreferredBackBufferFormat = dm.Format;
                //gd.PresentationParameters.BackBufferWidth = dm.Width;
                //gd.PresentationParameters.BackBufferHeight = dm.Height;
                //gd.PresentationParameters.BackBufferFormat = dm.Format;
                gdm.ApplyChanges();
            }
            else
            {
                gdm.IsFullScreen = false;
                Console.WriteLine(" NO match found for the current display mode ? falling back to windowed");
            }
            Console.WriteLine(" ChangeToNextDisplayMode... ends");
        }

        public int FindCurrentOrClosestDisplayModeInList(List<DisplayMode> bd, DisplayMode tofind)
        {
            int index = -1;
            for (int j = 0; j < bd.Count; j++)
            {
                if (tofind.Width == bd[j].Width && tofind.Height == bd[j].Height && tofind.Format == bd[j].Format)
                {
                    index = j;
                    j = bd.Count;
                }
            }
            return index;
        }

        public List<DisplayMode> FindBestDisplayModes()
        {
            Console.WriteLine(nline + " Finding Best DisplayModes ");
            // rebuild viable list into sdm
            DisplayModeCollection dms = gdm.GraphicsDevice.Adapter.SupportedDisplayModes;
            sdm = new List<DisplayMode>();

            for (int i = 0; i < dms.Count(); i++)
            {
                DisplayMode now = dms.ElementAt(i);
                if (now.Format == starteddm.Format && now.AspectRatio == starteddm.AspectRatio)
                {
                    bool isgood = true;
                    for (int j = 0; j < sdm.Count; j++)
                    {
                        if (now.Width == sdm[j].Width && now.Height == sdm[j].Height)
                        {
                            isgood = false;
                        }
                    }
                    if (isgood)
                    {
                        sdm.Add(now);
                        Console.WriteLine("  (" + i + ")-->(" + (sdm.Count() - 1) + ")" + now + " aspct " + now.AspectRatio + " format " + now.Format);
                    }
                }
            }
            return sdm;
        }

        int pause = 0;
        public void ReducePause()
        {
            if (pause > -1)
                pause--;
        }
        public bool Paused
        {
            get
            {
                if (pause < 1)
                {
                    pause = input_pause_amount;
                    return false;
                }
                else
                {
                    return true;
                }
            }
        }
    }

continued below…

public class RecordDiff
{
    private static List<RecordDiff> registered_list = new List<RecordDiff>();
    bool isfullscreen = false;
    bool isgdfullscreen = false;
    bool iswidescreen = false;
    Point preferedbackbuffwh = new Point();
    SurfaceFormat preferedbackbufferformat;
    Rectangle windowclientbounds = new Rectangle();
    DisplayOrientation displayorientation = DisplayOrientation.Default;
    Rectangle gdpresentationparambounds = new Rectangle();
    Point presentationparametersbackbufferwh = new Point();
    SurfaceFormat presentationparametersbackbufferformat;
    Viewport viewport = new Viewport();
    Rectangle viewporttilesafearea = new Rectangle();
    Point displaymodeWh = new Point();
    Rectangle displaymodetilesafearea = new Rectangle();
    bool isdefaultgraphicsadapter = true;
    Point gdcurrentdisplaymodewh = new Point();
    Rectangle gdcurrentdisplaymodetilesafearea = new Rectangle();

    public static bool EnoughRecords { get { return (registered_list.Count > 1); } }

    public RecordDiff(GraphicsDeviceManager gdm, GraphicsDevice gd, GameWindow Window)
    {
        isfullscreen = gdm.IsFullScreen;
        isgdfullscreen = gd.PresentationParameters.IsFullScreen;
        iswidescreen = false;
        preferedbackbuffwh = new Point(gdm.PreferredBackBufferWidth, gdm.PreferredBackBufferHeight);
        preferedbackbufferformat = gdm.PreferredBackBufferFormat;
        windowclientbounds = Window.ClientBounds;
        displayorientation = gd.PresentationParameters.DisplayOrientation;
        gdpresentationparambounds = gd.PresentationParameters.Bounds;
        presentationparametersbackbufferwh = new Point(gd.PresentationParameters.BackBufferWidth, gd.PresentationParameters.BackBufferHeight);
        presentationparametersbackbufferformat = gd.PresentationParameters.BackBufferFormat;
        viewport = gd.Viewport;
        viewporttilesafearea = gd.Viewport.TitleSafeArea;
        displaymodeWh = new Point(gd.DisplayMode.Width, gd.DisplayMode.Height);
        displaymodetilesafearea = gd.DisplayMode.TitleSafeArea;
        isdefaultgraphicsadapter = true;//gd.Adapter.IsDefaultAdapter; // not implemented in monogame
        gdcurrentdisplaymodewh = new Point(gd.Adapter.CurrentDisplayMode.Width, gd.Adapter.CurrentDisplayMode.Height);
        gdcurrentdisplaymodetilesafearea = gd.Adapter.CurrentDisplayMode.TitleSafeArea;
        // add it
        registered_list.Add(this);
    }
    public static void DisplayDifferences(bool displayunchanged)
    {
        if (EnoughRecords)
        {
            int to = registered_list.Count - 1;
            int from = to - 1;
            TheDifferences(registered_list[from], registered_list[to], displayunchanged);
        }
    }
    private static void TheDifferences(RecordDiff A, RecordDiff B, bool displayunchanged)
    {
        string differences = "";
        string stayedthesame = "";
        string formating = "\n   diff {0} CHANGE FROM {1} TO {2}";
        string formating2 = "\n    nochange {0}";
        string changedvar = "";
        differences += string.Format("\n   ------ changes that occured -----------");
        differences += string.Format("\n   ---------------------------------------");
        stayedthesame += string.Format("\n   ------ remained unchanged -----------");
        stayedthesame += string.Format("\n   ---------------------------------------");
        if (A.isfullscreen != B.isfullscreen) { changedvar = "gdm.FullScreen"; differences += string.Format(formating, changedvar, A.isfullscreen, B.isfullscreen); }
        else { stayedthesame += string.Format(formating2, "gdm.FullScreen"); }
        if (A.isgdfullscreen != B.isgdfullscreen) { changedvar = "gd.PresentationParameters.IsFullScreen"; differences += string.Format(formating, changedvar, A.isgdfullscreen, B.isgdfullscreen); }
        else { stayedthesame += string.Format(formating2, "gd.PresentationParameters.IsFullScreen"); }
        if (A.iswidescreen != B.iswidescreen) { changedvar = "gd.Adapter.isWideScreen"; differences += string.Format(formating, changedvar, A.iswidescreen, B.iswidescreen); }
        else { stayedthesame += string.Format(formating2, "gd.Adapter.isWideScreen"); }
        if (A.preferedbackbuffwh != B.preferedbackbuffwh) { changedvar = "gdm.PreferredBackBuffer(Width Height)"; differences += string.Format(formating, changedvar, A.preferedbackbuffwh, B.preferedbackbuffwh); }
        else { stayedthesame += string.Format(formating2, "gdm.PreferredBackBuffer(Width Height)"); }
        if (A.preferedbackbufferformat != B.preferedbackbufferformat) { changedvar = "gdm.PreferredBackBufferFormat"; differences += string.Format(formating, changedvar, A.preferedbackbufferformat, B.preferedbackbufferformat); }
        else { stayedthesame += string.Format(formating2, "gdm.PreferredBackBufferFormat"); }
        if (A.windowclientbounds != B.windowclientbounds) { changedvar = "Window.ClientBounds"; differences += string.Format(formating, changedvar, A.windowclientbounds, B.windowclientbounds); }
        else { stayedthesame += string.Format(formating2, "Window.ClientBounds"); }
        if (A.displayorientation != B.displayorientation) { changedvar = "gd.PresentationParameters.DisplayOrientation"; differences += string.Format(formating, changedvar, A.displayorientation, B.displayorientation); }
        else { stayedthesame += string.Format(formating2, "gd.PresentationParameters.DisplayOrientation"); }
        if (A.gdpresentationparambounds != B.gdpresentationparambounds) { changedvar = "gd.PresentationParameters.Bounds"; differences += string.Format(formating, changedvar, A.gdpresentationparambounds, B.gdpresentationparambounds); }
        else { stayedthesame += string.Format(formating2, "gd.PresentationParameters.Bounds"); }
        if (A.presentationparametersbackbufferwh != B.presentationparametersbackbufferwh) { changedvar = "gd.PresentationParameters.BackBuffer(WidthHeight)"; differences += string.Format(formating, changedvar, A.presentationparametersbackbufferwh, B.presentationparametersbackbufferwh); }
        else { stayedthesame += string.Format(formating2, "gd.PresentationParameters.BackBuffer(WidthHeight)"); }
        if (A.presentationparametersbackbufferformat != B.presentationparametersbackbufferformat) { changedvar = "gd.PresentationParameters.BackBufferFormat"; differences += string.Format(formating, changedvar, A.presentationparametersbackbufferformat, B.presentationparametersbackbufferformat); }
        else { stayedthesame += string.Format(formating2, "gd.PresentationParameters.BackBufferFormat"); }
        if (A.viewport.Bounds != B.viewport.Bounds) { changedvar = "gd.Viewport"; differences += string.Format(formating, changedvar, A.viewport, B.viewport); }
        else { stayedthesame += string.Format(formating2, "gd.Viewport"); }
        if (A.viewporttilesafearea != B.viewporttilesafearea) { changedvar = "gd.Viewport.TitleSafeArea"; differences += string.Format(formating, changedvar, A.viewporttilesafearea, B.viewporttilesafearea); }
        else { stayedthesame += string.Format(formating2, "gd.Viewport.TitleSafeArea"); }
        if (A.displaymodeWh != B.displaymodeWh) { changedvar = "gd.DisplayMode.(Width, Height)"; differences += string.Format(formating, changedvar, A.displaymodeWh, B.displaymodeWh); }
        else { stayedthesame += string.Format(formating2, "gd.DisplayMode.(Width, Height)"); }
        if (A.displaymodetilesafearea != B.displaymodetilesafearea) { changedvar = "gd.DisplayMode.TitleSafeArea"; differences += string.Format(formating, changedvar, A.displaymodetilesafearea, B.displaymodetilesafearea); }
        else { stayedthesame += string.Format(formating2, "gd.DisplayMode.TitleSafeArea"); }
        if (A.isdefaultgraphicsadapter != B.isdefaultgraphicsadapter) { changedvar = "gd.Adapter.IsDefaultAdapter"; differences += string.Format(formating, changedvar, A.isdefaultgraphicsadapter, B.isdefaultgraphicsadapter); }
        else { stayedthesame += string.Format(formating2, "gd.Adapter.IsDefaultAdapter"); }
        if (A.gdcurrentdisplaymodewh != B.gdcurrentdisplaymodewh) { changedvar = "gd.Adapter.CurrentDisplayMode.WH"; differences += string.Format(formating, changedvar, A.gdcurrentdisplaymodewh, B.gdcurrentdisplaymodewh); }
        else { stayedthesame += string.Format(formating2, "gd.Adapter.CurrentDisplayMode.WH"); }
        if (A.gdcurrentdisplaymodetilesafearea != B.gdcurrentdisplaymodetilesafearea) { changedvar = "gd.Adapter.CurrentDisplayMode.TitleSafeArea"; differences += string.Format(formating, changedvar, A.gdcurrentdisplaymodetilesafearea, B.gdcurrentdisplaymodetilesafearea); }
        else { stayedthesame += string.Format(formating2, "gd.Adapter.CurrentDisplayMode.TitleSafeArea"); }
        differences += string.Format("\n   ---------------------------------------");
        stayedthesame += string.Format("\n   ---------------------------------------");
        //
        Console.WriteLine(differences);
        if (displayunchanged)
            Console.WriteLine(stayedthesame);
    }
    public static void DisplayCurrentStatus(GraphicsDeviceManager gdm, GraphicsDevice gd, GameWindow Window)
    {
        Console.WriteLine("  DisplayCurrentStatus ");
        if (gdm.IsFullScreen)
            Console.WriteLine("  ___________Info______Gdm_Currently FullScreen");
        else
            Console.WriteLine("  ___________Info______Gdm_Currently Windowed");
        if (gd.PresentationParameters.IsFullScreen)
            Console.WriteLine("  gd.PresentationParameters.IsFullScreen Currently FullScreen");
        else
            Console.WriteLine("  gd.PresentationParameters.IsFullScreen Currently Windowed");
        Console.WriteLine("  gd.Adapter.IsWideScreen                      " + gd.Adapter.IsWideScreen);
        Console.WriteLine("  gdm.PreferredBackBuffer WH:                           Width:" + gdm.PreferredBackBufferWidth + " Height:" + gdm.PreferredBackBufferHeight);
        Console.WriteLine("  gdm.PreferredBackBufferFormat                " + gdm.PreferredBackBufferFormat);
        Console.WriteLine("  Window.ClientBounds                          " + Window.ClientBounds);
        Console.WriteLine("  gd.PresentationParameters.DisplayOrientation " + gd.PresentationParameters.DisplayOrientation);
        Console.WriteLine("  gd.PresentationParameters.Bounds             " + gd.PresentationParameters.Bounds);
        Console.WriteLine("  gd.PresentationParameters.BackBuffer WH:              Width:" + gd.PresentationParameters.BackBufferWidth + " Height:" + gd.PresentationParameters.BackBufferHeight);
        Console.WriteLine("  gd.PresentationParameters.BackBufferFormat   " + gd.PresentationParameters.BackBufferFormat);
        Console.WriteLine("  gd.Viewport                                  " + gd.Viewport);
        Console.WriteLine("  gd.Viewport.TitleSafeArea                    " + gd.Viewport.TitleSafeArea);
        Console.WriteLine("  gd.DisplayMode.Width, Height                          Width:" + gd.DisplayMode.Width + " Height:" + gd.DisplayMode.Height);
        Console.WriteLine("  gd.DisplayMode.TitleSafeArea                 " + gd.DisplayMode.TitleSafeArea);
        //Console.WriteLine("gd.Adapter.IsDefaultAdapter                  " + gd.Adapter.IsDefaultAdapter); //// not yet implemented in monogame
        Console.WriteLine("  gd.Adapter.IsDefaultAdapter                  not yet implemented in monogame");
        Console.WriteLine("  gd.Adapter.CurrentDisplayMode WH:                     Width:" + gd.Adapter.CurrentDisplayMode.Width + " Height:" + gd.Adapter.CurrentDisplayMode.Height);
        Console.WriteLine("  gd.Adapter.CurrentDisplayMode.TitleSafeArea  " + gd.Adapter.CurrentDisplayMode.TitleSafeArea);
        Console.WriteLine("  ________________________________");

    }
 }
}

this is the output i get when i just resize the screen on the version im using which works…

“A Resize Has Just Occured” Window.ClientSizeChanged has fired…OnResize()
Within OnResize… My ApplyTheChanges() Was NOT called

------ changes that occured -----------

diff Window.ClientBounds CHANGE FROM {X:240 Y:212 Width:571 Height:357}
TO {X:240 Y:212 Width:627 Height:286}
diff gd.PresentationParameters.Bounds CHANGE FROM {X:0 Y:0 Width:571 Height:357}
TO {X:0 Y:0 Width:627 Height:286}
diff gd.PresentationParameters.BackBuffer(WidthHeight) CHANGE FROM {X:571 Y:357}
TO {X:627 Y:286}
diff gd.Viewport CHANGE FROM {X:0 Y:0 Width:571 Height:357 MinDepth:0 MaxDepth:1}
TO {X:0 Y:0 Width:627 Height:286 MinDepth:0 MaxDepth:1}
diff gd.Viewport.TitleSafeArea CHANGE FROM {X:0 Y:0 Width:571 Height:357}
TO {X:0 Y:0 Width:627 Height:286}