Issues with IntelliJ on a 4K screen - intellij-idea

I splurged and bought one of those high definition 4K screens. More specifically, the Dell UltraSharp 4k UP3216Q 31.5", combined with a new PC running Windows 10.
When the computer occasionally reboots, it goes into a mode where when I load IntelliJ, it shows the following error message:
8:16 PM You may need to manually configure the HiDPI mode to prevent UI scaling issues. See the troubleshooting guide.
The interesting thing is that when it's running in this mode, I actually like the way IntelliJ looks. I like it because it's running in true sharp 4K mode, and at the same time, all the fonts are large enough to be legible, and not require a magnetic resonance microscope or a monocle to make out the letters.
However, other times, when the system boots up, I do not get that error, meaning everything is functioning normally, but in that case, all the fonts are so tiny as to be illegible. It literally hurts my eyes to look at it, and the only alternatives I have left at that point is to either drop down from 3840x2160 into 1920x1080, or to go into the settings, and start increasing the font sizes, which is annoying. Not to mention that if I drop down into 1920x1080 mode, then the quality of what I am looking at degrades, everything starts looking pixelated...
Is there anything that can be done to stabilize the situation on these new 4K screens so that IntelliJ looks normal?

Try this:
Help > Edit Custom VM Options:
-Dsun.java2d.uiScale.enabled=true
More information can be found here:
https://intellij-support.jetbrains.com/hc/en-us/articles/115001260010-Troubleshooting-IDE-scaling-DPI-issues-on-Windows
If that does not help create a ticket in the JetBrains issue tracker: https://youtrack.jetbrains.com/
They are usually very responsive.

Another possibility is that you have the Windows UI scaling value for the screen set to a non-integral value in display settings. This messed me up, I had the setting to 175%, while the default is 200%. Intellij (and many other applications) will not scale properly if that is set to a non-integral scaling value.
As soon as I switch this back to 200% Intellij scales perfectly.

I fix this problem after setted env variable IDEA_JDK_64 to jdk path in windows 10

Related

How do I fix garbled text in my react-pdf viewer?

I have created a pdf viewer using react-pdf. When I display certain pdfs, the text is choppy and unreadable. I have tried zooming in and out of the document and it is choppy in different ways at different scales. Sometimes the text even looks okay at a certain scale after zooming out and then zooming back in.
(Sample at 1.5 scale)
(Sample at 1.6 scale)
At first, I thought it might be an issue with react-pdf, but I saw that react-pdf is basically a wrapper around PDF.js. I found that I can replicate the issue in the PDF.js demo page.
Unfortunately, I'm working with a pdf that contains identifying information, so I can't share the full pdf or full screenshot. I'll include as much as I can figure out to share.
What I have tried
My initial thought was that maybe the component was rendering small initially and then had issues scaling up. So I made the initial size really large, but that didn't fix it.
I made sure that standard fonts were included following the instructions on the react-pdf home page
I tried using pdf repair tools online to maybe fix the pdf itself. That didn't help.
I tried changing the renderMode to 'svg' as detailed in the Document api documentation. This was the most helpful fix, as it does render the text correctly, but it then makes it so the images on the pdf don't load.
Thanks for your help/suggestions.
If I can find a way to edit the pdf to not have sensitive information, I'll try to find a place to make it available for testing. I apologize that I cannot provide that at this time. I know it's difficult to give advice when you can't replicate it yourself. I'll work on that.
From a programming point of view there is only "Providing a standardFontDataUrl and disabling the font face" (see later), however it affects many pdf.js based code developers outputs, thus I consider as still "OnTopic"
This issue is still open in react-pdf, though I have seen it mentioned by other pdf.js users since mid year (MS or Chrome update ?) , so unsure if it is not a wider fail affecting Mozilla PDF.js code users.
https://github.com/wojtekmaj/react-pdf/issues/1010
https://github.com/wojtekmaj/react-pdf/issues/1025
There semes to be earlier reports back in Early March and then later suggestions to change win 10 drivers. However also reported by win 11 Pro users. PDF.js versions from 2.8.335 to 2.14.305, and it doesn't affect version 2.7.570. so partially down to updated versions ! But seen only in Chromium.
It is entirely possible that we started doing something that trips Chrome,
The symptoms seem to be hardware or settings orientated since it is reportedly seen on some identical groups of users but not affecting others.
toggling back and forth between single page and multi-page views the issue resolves. It also seems dependent on the resolution or appears on some machines and not others so it is a little tricky to repro.
I am not getting it personally, but a guy in my team get it.
Unclear which browsers are affected but looks like its a chromium / web kit rendering bug ?
Several browsers have been tested and only chrome faces this.
My colleague gets the same in Edge Version 101.0.1210.47 (Official build) (64-bit) and Brave (1.38.118 Chromium 101.0.4951.67) Will edit the issue
The suggested workaround is :-
Providing a standardFontDataUrl and disabling the font face fixes the issue.
if we disable Accelerated 2D canvas in chrome://flags then the preview appears nice and okay. But since this flag is on by default so user see the pixelated preview. Unless we ask them to turn off this flag.
Figured out that this only happens when hardware acceleration is enabled in your Chrome settings.
When its turned off the issue does not happen.
In address bar paste chrome://gpu or edge://gpu etc (its a long report of current onboard fixes) in my case (currently unconfirmed via reboot for my Edge) is showing Accelerated 2D canvas is unavailable: either disabled via blocklist or the command line. Disabled Features: 2d_canvas, thus I cannot see problems.
To change setting you can use
chrome://flags/#disable-accelerated-2d-canvas
but its a manual choice between options.
so on reboot I see
Graphics Feature Status
Canvas: Hardware accelerated
Canvas out-of-process rasterization: Disabled
but have little problem with the domo (except normal fuzzy text as pixels) so either Edge update or my hardware is not visibly affected or my default settings are reasonable.
This issue has been finally fixed in the latest version of react-pdf library. Check here: https://github.com/wojtekmaj/react-pdf/releases/tag/v6.2.2
I also faced the same error and I fixed it by setting render mode to canvas (earlier it was SVG) and scale value to more than 1. Try scale = 1.5

Workable alternative to "Presentation Mode" in Intellij and Pycharm

As detailed in this YouTrack issue https://youtrack.jetbrains.com/issue/PY-40008 Presentation Mode is basically a one-way ticket: you can check in but you just can't leave.
One of the "misses" of returning to "normal" mode is that only the Editor panel is displayed: the Explorer, Debugger, etc. are all invisible.
That's a hassle to rectify in real time when presenting to a group of people. When I am actually giving presentations that include code snippet walk-throughs going back and forth between modes is mandatory so then Presentation Mode is a non-starter.
But then what? I code at a small font to view lots of code at one time. This is incompatible with displaying code on a projector. Here are some attempted band-aids:
Hit Command-+ a few times to increase the font. This does work, but if I switch to another file then I have to repeat that process: the new file does not "inherit" the zoomed-in preference. Then if I switch back to the first file it too has forgotten the zoom. That is very annoying for me and the audience
Change the Editor|Font .
This is a potentially better solution: at least it does affect all files and is "sticky". However I do find that the optimal resolution often requires tweaking for a given audience due to differing viewer characteristics e.g. Zoom vs Hangouts. So then I end up going into that dialog more than once with a gaggle of folks watching/waiting. Also not ideal.
The behavior is identical across recent releases of both Intellij (Ultimate 2019.3.1) and Pycharm (Ultimate 2019.2.3).
Anyone have alternative/better approaches?
I setup several Color Scheme Font schemes for desktop/laptop/presentation with different font sizes. I then use Ctrl-~ to quickly switch between them. Doesn't solve all the issues you mentioned, though.
I took a separate approach to fix this actually. When your font size is messed up after exiting the presentation mode, you can do the following.
Go to Preferences and then Appearance. Find the font size of the presentation mode and set it to the default font size (in my case it was 13). Then click Apply and you are good to go. Set the font size to 20 (or any other bigger size) back again for presentation mode.

IntelliJ text looks HUGE after update to 2019.2

I updated IntelliJ to 2019.2 this morning. After the update, all the fonts (actually, fonts and widgets) on the window look absolutely HUGE (even the splashscreen is much bigger when it starts). Main window has the look (in terms of the size of widgets) as being in presentation mode, more or less.
I tried decreasing the size of the fonts in Settings -> Appearance & Behavior - > Appearance (set it to 8) and in Settings -> Font (also set to 8). And the font in the text editor now is back to almost usable (still a little bigger that I'd like) and the menu text as well.... but everything else still looks too big (buttons, tabs, text on the tabs that are on the left side)... so, it's CRAZY. How can I get it back to normal?
I'm on ubuntu 19.04 (actually running KDE) and using OpenJDK.
PS I just downloaded 2019.1 and tried starting it. It looks normal, the way I expect it to. I'm downloading 2019.2 now and let's see what happens what I start it (not from the updated IDE directory).
Just checked starting 2019.2. It looks the way it looked when I started from the updated one. Will stick to using 2019.1 for the time being.
Please refer to the HiDPI configuration document, there were some changes in handling HiDPI on Linux with the move to JetBrains Runtime 11.
It may help if you switch to the IDE-managed HiDPI mode (legacy mode) by adding
-Dsun.java2d.uiScale.enabled=false
in Help | Edit Custom VM Options and restarting the IDE.

Windows 8 XAML possible bug - using images causes text controls to disappear

I have a strange problem happening intermittently with my apps where textbox controls would disappear intermittently. I have narrowed the cause of this down to having image files (small logos etc) on my page.
I have managed to create a simple project which contains an xaml page with an image and 2 textblocks (these are in grids).
I have found on two test tablets that I can re-create the problem by going to task manager and creating a dump file for the running app.
After I do this twice and resume the app, the two textblocks disappear.
This exact problem is happening intermittently in my live apps.
Has anyone any ideas why this might be happening or what I should try next? I have no idea why creating a dump file forces the issue.
You can see a video of me re-creating the issue here:
https://onedrive.live.com/redir?resid=DF2BE823348DEA6C!74381&authkey=!AIvSU05r0363S3Y&ithint=video%2cMOV
The test project in the video can be downloaded from here:
https://onedrive.live.com/redir?resid=DF2BE823348DEA6C!74382&authkey=!AIGHSdezFcCbEZQ&ithint=file%2czip
So far I can re-create it with the exact same steps on my two different tablets - both running Windows 8.1 Pro 32bit.
If you are familiar with sideloading apps and you have a 64bit tablet I would be really appreciative if someone was able to test out the exact same steps as seen in the video.
Any help would be extremely appreciated as I am clueless as to where to go next.
I finally got to the bottom of this. The problem was down to the intel graphics driver that was installed on the tablets.
An updated driver was released around April which seemed to resolve the issue.
I have observed this problem of disappearing controls on views that do not contain image files but rather a background image. After reading your method of how to reproduce the issue, I've since removed the background image and replaced with a LinearGradientBrush and retested with the dump file process. The problem seems to have disappeared. (I'm running 32-bit as well.)

Possible to get _all_ rendered text on OS X?

I'm looking to log all the text that gets displayed on my OS X 10.6 machine. e.g. all webpage text (no matter the browser), PDF text (not necessarily the entire PDF, but at very least all the text that was actually viewed), anything I type into emacs, any email I write.
I've looked at the Accessibility API, but it seems to be more about describing function than content - and in any case relies on application developers to have implemented accessibility objects. Is there something lower-level? perhaps I can watch everything that goes through the OS font renderer?
After searching for a while my impression is that Apple doesn't explicitly make this possible, I'm open to any hackish suggestions you might have.
You'd have to get deep inside the Window Server to have any hope of getting all the text that was written to the screen. I suppose you could patch it yourself, but it's hard to see how without source. What you want has obvious nefarious uses so there's hardly going to be a public API for it.
Just a shot in the dark, but what about turning on Screen Sharing on the 'target' Mac and pointing a modified VNC client at it? I don't know whether text is sent as text over VNC or not, but if it was that might be one place to start. It's effectively giving you a Window Server equivalent that you control.