Skip to content
Prev 60976 / 63424 Next

Mismatch between the Rconsole file and the RGui Configuration editor

On 8/27/22 20:46, Paulo Barata wrote:
Dear Paulo,

thanks for the report. It is now fixed in R-devel 82776 (it would be 
nice if you could confirm the problem is fixed for you on your system).

You have run into an old bug in GraphApp, a library used by Rgui. The 
part saving and restoring the preferences works fine, but the problem 
occurs on R startup when creating a new console window. Rgui computes 
the client size of the window based on the preferred number of rows and 
columns and asks GraphApp to create such window. GraphApp uses its 
internal code (probably it pre-dates AdjustWindowRect) to compute the 
screen size of the window, so including the title bar, scroll bars, etc, 
and then asks Windows to create the window. Rgui then checks the actual 
client size of the created window and updates the number of rows and 
columns based on that - which is also the number you then see in the 
preferences editor. Ideally/normally it should be the same as what was 
given initially, e.g. via Rconsole.

However, the computation in GraphApp didn't work quite right, it didn't 
account for the scrollbars. And the reason was that it assumed a canvas 
(CanvasSize bit was set on the window flags). That bit was set by 
accident, because GraphApp by accident used the same bit number for 
CanvasSize and UseUnicode. The UseUnicode bit is set in Rgui when 
running in a multi-byte locale, so for you and many others probably only 
since R 4.2. I've changed GraphApp to use a different bit.

Thanks for testing Rgui and reporting problems.

Best
Tomas