Paulo Barata
2022-Aug-27 18:46 UTC
[Rd] Mismatch between the Rconsole file and the RGui Configuration editor
To the R developers, In R version 4.2.1 (2022-06-23 ucrt), and also in R version 4.2.1 Patched (2022-08-24 r82762 ucrt), something strange is happening with the GUI Preferences x Rconsole file. I open the GUI Preferences (RGui Configuration editor), and I define the number of console rows and columns, the I click Apply and then I Save the Preferences to the Rconsole file (which is in the Documents folders of my Windows 10 Pro) -- I overwrite the existing Rconsole file. Then I close R. When I open R again, there is always a mismatch between the number of console rows and columns correctly recorded in the Rconsole file and the numbers actually shown in the RGui Configuration editor. If this list allows attachments, the attached PNG image shows the mismatch between the Rconsole file and the RGui Configuration editor, just after opening R version 4.2.1 (2022-06-23 ucrt). Windows 10 Pro for Workstations Version 21H2 Installed on 23/?08/?2022 OS build 19044.1889 Processor Intel(R) Xeon(R) W-1350 @ 3.30GHz 3.31 GHz Installed RAM 64.0 GB (63.7 GB usable) R version 4.2.1 (2022-06-23 ucrt) -- "Funny-Looking Kid" Copyright (C) 2022 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 (64-bit) > Sys.info() sysname release version nodename "Windows" "10 x64" "build 19044" "XXXXXXXXXXXXXXX" machine login user effective_user "x86-64" "XXXXX "XXXXX" "XXXXX" > win.version() [1] "Windows 10 x64 (build 19044)" > .Platform $OS.type [1] "windows" $file.sep [1] "/" $dynlib.ext [1] ".dll" $GUI [1] "Rgui" $endian [1] "little" $pkgType [1] "win.binary" $path.sep [1] ";" $r_arch [1] "x64" Thank you. Regards, Paulo Barata (Rio de Janeiro - Brazil) -------------- next part -------------- A non-text attachment was scrubbed... Name: R-4.2.1-configuration-Rconsole.png Type: image/png Size: 30854 bytes Desc: not available URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20220827/02f03f99/attachment.png>
Duncan Murdoch
2022-Aug-27 19:35 UTC
[Rd] Mismatch between the Rconsole file and the RGui Configuration editor
I would guess what is happening is the following. R reads your file, and asks the window to resize as you specify. Then when it is populating the config editor, it measures the size of the window, and computes the equivalent number of rows and columns. The fact that these numbers don't match suggests that one calculation is for the outer dimensions of the window (the one that resizes it at the start), and the other is for the inner dimensions (not including the frame). This is going to cause problems if you repeatedly start R and save the config, because the window will keep getting smaller. But who does that? If the discrepancy really bothers you, then you could try to figure out exactly where it occurs by looking at the source file src/gnuwin32/console.c (or one of the other files in that directory). The source is mirrored on Github at https://github.com/wch/r-source/blob/trunk/src/gnuwin32/console.c . Duncan Murdoch On 27/08/2022 2:46 p.m., Paulo Barata wrote:> > To the R developers, > > In R version 4.2.1 (2022-06-23 ucrt), and also in R version 4.2.1 > Patched (2022-08-24 r82762 ucrt), something strange is happening with > the GUI Preferences x Rconsole file. I open the GUI Preferences (RGui > Configuration editor), and I define the number of console rows and > columns, the I click Apply and then I Save the Preferences to the > Rconsole file (which is in the Documents folders of my Windows 10 Pro) > -- I overwrite the existing Rconsole file. Then I close R. > > When I open R again, there is always a mismatch between the number of > console rows and columns correctly recorded in the Rconsole file and the > numbers actually shown in the RGui Configuration editor. > > If this list allows attachments, the attached PNG image shows the > mismatch between the Rconsole file and the RGui Configuration editor, > just after opening R version 4.2.1 (2022-06-23 ucrt). > > Windows 10 Pro for Workstations > Version 21H2 > Installed on 23/?08/?2022 > OS build 19044.1889 > Processor Intel(R) Xeon(R) W-1350 @ 3.30GHz 3.31 GHz > Installed RAM 64.0 GB (63.7 GB usable) > > > R version 4.2.1 (2022-06-23 ucrt) -- "Funny-Looking Kid" > Copyright (C) 2022 The R Foundation for Statistical Computing > Platform: x86_64-w64-mingw32/x64 (64-bit) > > > Sys.info() > sysname release version nodename > "Windows" "10 x64" "build 19044" "XXXXXXXXXXXXXXX" > machine login user effective_user > "x86-64" "XXXXX "XXXXX" "XXXXX" > > win.version() > [1] "Windows 10 x64 (build 19044)" > > > .Platform > $OS.type > [1] "windows" > $file.sep > [1] "/" > $dynlib.ext > [1] ".dll" > $GUI > [1] "Rgui" > $endian > [1] "little" > $pkgType > [1] "win.binary" > $path.sep > [1] ";" > $r_arch > [1] "x64" > > Thank you. Regards, > > Paulo Barata > > (Rio de Janeiro - Brazil) > > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel
Tomas Kalibera
2022-Aug-30 16:33 UTC
[Rd] Mismatch between the Rconsole file and the RGui Configuration editor
On 8/27/22 20:46, Paulo Barata wrote:> > To the R developers, > > In R version 4.2.1 (2022-06-23 ucrt), and also in R version 4.2.1 > Patched (2022-08-24 r82762 ucrt), something strange is happening with > the GUI Preferences x Rconsole file. I open the GUI Preferences (RGui > Configuration editor), and I define the number of console rows and > columns, the I click Apply and then I Save the Preferences to the > Rconsole file (which is in the Documents folders of my Windows 10 Pro) > -- I overwrite the existing Rconsole file. Then I close R. > > When I open R again, there is always a mismatch between the number of > console rows and columns correctly recorded in the Rconsole file and > the numbers actually shown in the RGui Configuration editor.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> > If this list allows attachments, the attached PNG image shows the > mismatch between the Rconsole file and the RGui Configuration editor, > just after opening R version 4.2.1 (2022-06-23 ucrt). > > Windows 10 Pro for Workstations > Version 21H2 > Installed on 23/?08/?2022 > OS build 19044.1889 > Processor Intel(R) Xeon(R) W-1350 @ 3.30GHz? 3.31 GHz > Installed RAM 64.0 GB (63.7 GB usable) > > > R version 4.2.1 (2022-06-23 ucrt) -- "Funny-Looking Kid" > Copyright (C) 2022 The R Foundation for Statistical Computing > Platform: x86_64-w64-mingw32/x64 (64-bit) > > ?> Sys.info() > ?????????? sysname?????????? release?????????? version nodename > ???????? "Windows"????????? "10 x64"???? "build 19044" "XXXXXXXXXXXXXXX" > ?????????? machine???????????? login????????????? user effective_user > ????????? "x86-64"?????????? "XXXXX???????? "XXXXX" "XXXXX" > ?> win.version() > [1] "Windows 10 x64 (build 19044)" > > ?> .Platform > $OS.type > [1] "windows" > $file.sep > [1] "/" > $dynlib.ext > [1] ".dll" > $GUI > [1] "Rgui" > $endian > [1] "little" > $pkgType > [1] "win.binary" > $path.sep > [1] ";" > $r_arch > [1] "x64" > > Thank you. Regards, > > Paulo Barata > > (Rio de Janeiro - Brazil) > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel