Issues with UI bleeding through from background
I have a multi-monitor setup as I imagine most people have. When using LinqPad I find that sometimes if I have moved the linqpad application to one of my other monitors, the results when running queries gives me a wierd effect. It's like parts of whatever application is behind the LinqPad application are bleeding through parts of the screen. I have found a small work around, which is to adjust the results pane after executing and the problem goes away until I run another query. I do believe this only happens when I have docked the application to a monitor that it did not originally open on. So I am not sure if it is a resolution issue or what, but it can get to be annoying after a while.
Comments
Open LINQPad on a Windows 10 machine with multiple monitors.
Move LINQPad to a monitor that is not the default.
Open the sample query "A simple query expression".
Switch the query to display results in the data grid (Ctrl-Shift-G)
Run the query.
The results window will be misplaced and there will be a "hole" in the main LINQPad window where the results grid should be. (I can post a screenshot, if needed)
Move or Resize the LINQPad window and the results grid will pop back into place.
Based on experimentation, I can tell you if make the LINQPad window narrow enough (roughly 400 pixels wide on my setup), the results grid will briefly open misplaced and then relocate back to its proper place. If the initial position of the grid window is off-screen, you won't even notice.
Also, this doesn't happen on the monitor you designate as the "main monitor" in the Windows Display Settings. Unfortunately for me, I never use LINQPad on my main monitor because I move my Surface Pro 3 daily between two different multi-monitor setups (home and work). I prefer keeping the Surface as the main monitor to avoid Windows display hell when I move between the two setups.
(Not related to main monitor since it occurs on both primary and secondary screen)
- Run "A simple query expression" in data grid mode
- Maximize/restore window a few times (hotkey: Win+Up, Win+Down, maybe 10 times)
I think both issues are related to incorrect data grid panel dimensioning and placement.
Also note that it's possible to maximize the data grid using Win+Up when grid has focus.. this is a hidden feature
Thanks for the reply. I'm running the latest release version of LINQPad 5. I'm running plain vanilla Windows 10 on a Surface Pro 3. No virtual desktops or anything like that.
I have developed a work around that other folks may want to try.
Provided "as is" without warranty of any kind, either expressed or implied, including limitation warranties of merchantability, fitness for a particular purpose, and noninfringement.
Create a C# program script like this: Save it to your query directory. I called mine GridFix.Linq. Now, add this line to the end of a query that sends its results to the grid: The script moves the LINQPad window 1 pixel down and 1 pixel to the right. This has the effect of making the grid pop back into place. The reason you need to use Util.Run is that the code has to execute after the grid has painted. I originally tried this as a method in MyExtensions, but that didn't work consistently.By the way, I know this is a horrible hack, but it works, at least until LINQPad 6 comes out and you have to update the string to match for the MainWindowTitle.
For convenience, I also created a script named a.linq (so it sorts to the top of My Queries) that looks like this: I'll be using that as a template for most of my LINQPad work. And don't forget the small print above...
By the way, is there any way to change the default blank template to include this line?
http://www.linqpad.net/download.aspx#beta
I'm not certain it will fix the problem (because I can't repro), but there's a reasonable chance, based on the workaround you posted.
In my setup, my main display is the Surface Pro 3's screen. Because it is a high resolution screen (2160 x 1440), the default display settings include magnification to 150% ("Change the size of text, apps, and other items: 150% (Recommended)"). My external monitors are 1920 x 1080 and default to 100%.
The distance of the grid window from its proper position (when the main LINQPad window is on one of my external monitors) is directly proportional to the magnification setting on my main monitor. If I reduce the magnification of the main screen to 125%, the grid window is still positioned incorrectly, but it is not as far off. If I set the main screen to 100%, the grid shows up where it is supposed to be.
I hope this is helpful and I do appreciate your willingness to investigate the issue.
I've written a workaround into the 5.22.05 beta which works on my setup:
http://www.linqpad.net/download.aspx#beta
Let me know how you get along.
(Different screen sizes, different DPI's, both 100% scaling)