GNOME Bugzilla – Bug 707061
Can make calculator window to exit the screen
Last modified: 2013-11-12 13:04:36 UTC
User can notice that copying a string with a space and pasting it in calculator will make the calculator window exit the screen in some circumstances. Please note this was tested on ubuntu and it does not have the same problem. Steps : 1. Boot system 2. Open gedit, type a string, press enter and copy the string with the EOL 3. Open calculator and paste this 4. Paste 15 times, observe calculator exists the screen 5. Reopen calculator and try to press enter to add EOL (end of line) 6. Observe you can't Expected outcome You cannot paste EOL in calculator, it gets trimmed Actual outcome You can paste EOL in calculator, making the app exit the screen
This bug is still present in gnome-calculator 3.10.0 r1, tested on Fedora 20.
Created attachment 258308 [details] [review] Replaces '\n' chars by ' ' chars in strings before pasting them in gnome-calcutaor. This patch prevents '\n' chars from being entered in the calculator by replacing them by ' ' chars before pasting the text. Note that this patch does not prevent the gnome-calculator window from being longer than the display since it can be reproduced without using the copy/paste feature by entering a long string with spaces. Since the string is very long, gnome-calculator will display it on several lines using some of the spaces as new lines. Eventually, if the string is long enough, gnome-calculator's window will exit the screen. I see two ways of correcting that : - add a vertical scroll bar in the input window; - limit the number of lines. IMO the first one is better since it doesn't restrict the user from using as many lines as he wants.
Created attachment 258446 [details] [review] Removes the wrap feature in the input/display widget. Here is a simple way to correct the bug by removing the wrap feature in the input widget. This patch removes the possibility to get a more-than-one-line expression. If this was a feature then a better way to correct this bug would be to add a vertical scroll bar when a defined number of lines is reached. Note that this patch does not contain the modification made in the previous patch since they both correct a different problem.
Review of attachment 258308 [details] [review]: Committed. Thank you for the patch. :)
Review of attachment 258446 [details] [review]: Committed. Had to update the patch, as it wouldn't rebase properly. Thank you for the patch. :)
commits: 76e7f0a65c76cc9d88679f8a2b24bf631ca97abb a09ebdba22d3c19167f39e518f4995e15a490b09