Default position of comparison window when I use the Compare button in the Editor is off screen. Can it be changed?

Whenever I use the Compare button in the MATLAB Editor to compare two different .M files, the new window that opens to display the files' differences is off screen, and I have to use Alt+space to open the popup menu that allows me to move the window so that it becomes visible. Is there a way to alter the default location where this window will open?

4 Comments

Hi Al,
I have tried to regenerate your issue on my desktop using MATLAB R2022a and R2022b, and I am able to get the new comparison window on top of all the windows for both the MATLAB versions.
There might be some issues with "prefdir" in your system. You may have a look at the following ML Answer for reference:
If it's still not resolved, can you please provide screenshot(s) and/or some more description of the issue?
Cheers,
Suman
Here is a screen cap. It happens every time I compare files. That's all I have to do: choose "Save and Compare with...", pick two files and click the Compare button. Do I really have to lose all my preferences to get this to stop happening? I have R2022a. Sometimes my plots show up off screen. When that happens I use "set(groot, 'DefaultFigurePosition', <1D array>)" to make my plots appear where they will be visible. I was hoping for a similar command to set the default location of this window. As it is, I cannot grab the title bar to move the window. I have to resort to Alt+Space.
I don't think this has anything to do with screen resolution. It is just a poorly designed tool.
The comparison window always opens in the same place and with the same size, which is all the way on the top of the screen in the upper left corner of the primary monitor (regardless of where my Matlab window is located). This isn't a problem for me because I have my Windows taskbar at the bottom of the screen.
Moving/resizing the comparison window has no effect on where it shows up the next time I use the tool.
Even though I don't have the problem that the OP has in being unable to move the window because it is hidden under the taskbar, I do find it annoying that I have to resize the window every time because it is too narrow to see the contents of the files being compared.
It also has too much space between the lines of text. Even maximized on a 1920x1080 screen it only shows 34 lines of text, while the Editor window shows 50 lines when maximized.
Also, I can't change the font to be able to see more text in the window.
Les,
Thank you. The thing is that this is a new problem for me. I'm certain I didn't have this issue with older versions of MATLAB. I also believe that in older versions of MATLAB, the font in the comparison window matched the font in the MATLAB editor. My taskbar has been at the top of the screen since I first started using WinTel boxes in 1996. Although I was using MATLAB from around 1990, I didn't have a GUI version of MATLAB until 2013. I used the comparison tool a lot until around 2020. Now that I'm using it again, it has this bizarre set of issues (mine and all that you listed). I'm sure someone at Mathworks believes that they've replaced the comparison tool with something newer, different, and "better."

Sign in to comment.

 Accepted Answer

Can you give me a command to enter in my start.m file to change the default position?
No, we cannot give you a command for that.
The code to lauch the tool is hidden inside a .p file toolbox/comparisons/mldesktop/matlab/visdiff.p . We do not know what it does. You will need to open a technical support case.

1 Comment

I might have missed something hidden in the code or settings, but when I searched through the data structures that store preferences, and searched through the code for preference setting, I did not find any preference that stores position information for that window.

Sign in to comment.

More Answers (1)

Hi Al,
As per my understanding, it's happening due to your monitor resolution and it may vary from system to system. In my system, the Compare window is appearing fully on-screen in both MATLAB R2022a and R2022b versions.
You may try the "prefdir" resolution which I mentioned earlier i.e., Try renaming the directory designated by
prefdir
command to something else while MATLAB is not running, and see if that fixes the issue.
The "prefdir" documentation page for reference: prefdir - MATLAB doc
I hope all these information will be helpful to you.
Cheers,
Suman

4 Comments

Losing my command history and all my preferences is just not acceptable, so no to renaming the prefdir folder. I don't undertand how that could be considered a solution. At best, it would be a diagnostic showing whether the contents of the prefdir directory affect the issue. The same thing happens on my 23-inch monitor at work and my 20-inch monitor at home so it seems unlikely that I'm experiencing an issue because of the screen resolution.
On Friday, I will be able to provide a screenshot of my home computer.
Here is a screenshot when my laptop is not connected to a dock or any external monitor. Remember, my question is how do I change the default position of the comparison window. I really doubt that throwing away all my preferences is going to change where this window shows up.
And here is the promised screenshot on my 20-inch monitor. As Les described in a comment on my question, the window is opening at the exact same place on three different monitors. Can you give me a command to enter in my start.m file to change the default position?

Sign in to comment.

Categories

Products

Release

R2022a

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!