Very odd resolution glitch

Questions about Wine on Linux
Locked
ObsequiousNewt
Level 2
Level 2
Posts: 15
Joined: Wed Oct 15, 2014 8:19 pm

Very odd resolution glitch

Post by ObsequiousNewt »

I only use Wine for a couple programs, namely, here, Pinball, and League of Legends. That said, I usually prefer to play pinball in fullscreen, and usually I have no trouble—once I exit fullscreen the desktop reverts to my usual resolution. However, a short while ago I was playing pinball, and I did something, I don't remember what, but apparently by hitting f4 (fullscreen) enough times I confused the program, and when I exited, the resolution stayed at 640x480 (I think—I don't quite recall.) So I opened up the Display Settings to change it back to 1366x768, my native and usual resolution, and thought that was the end of it.

It wasn't.

The next time I started up League of Legends, I discovered that the windows drew themselves aligned to the upper left of the screen, instead of centered as usual, but more pertinently that the second loading screen and the main screen would only render a section in the upper-left-hand corner. Pinball, on the other hand, worked fine, although it, like the windows, rendered to the upper-left of the screen—and as soon as I entered fullscreen, I was presented with a superposition of two windows, only one of which functioned (and whose area my mouse could not leave), but neither of which took up the entire screen as usual.

I discovered that by running League on a virtual desktop, I could workaround this issue... but then I discovered that avconv, which I use to record myself playing, records the screen as if it were shifted upwards and to the left, that is, that it records a portion of my screen in the lower right of the video, and all else is blank space.

And as I then, in an attempt to get to the bottom of this glitch, took a screenshot, I found out that wine, avconv, KSnapshot, and who knows what else actually see my desktop as having an area of 1701x905! My resolution is set to 1366x768 in Display Manager, I have ensured, and so now I can only show you examples of my curious glitch.

Screenshot of first League loading screen: here
What I see: here

Screenshot of second League loading screen: here
—It is apparent that the window renders only to the top-left 1366x768 of the 1701x905 screen.
What I see: here
Example of moving the second League loading screen: screenshot, what I see

Screenshot of fullscreen Pinball: here
What I see: here
—The portion of the screen that I see is the top-left 640x480 of the bottom-right 1366x768 of the screen. I have attached the following image to put it in context.
Bottom-right 1366x768 corner of the screen: here

Screenshot of winecfg: here
What I see: here

I'm running wine-1.6.2.
User avatar
olivierfrdierick
Level 5
Level 5
Posts: 258
Joined: Thu Sep 13, 2012 12:09 pm

Re: Very odd resolution glitch

Post by olivierfrdierick »

What happens if you take a screenshot of your desktop with no program running? Is the screenshot correct?
ObsequiousNewt
Level 2
Level 2
Posts: 15
Joined: Wed Oct 15, 2014 8:19 pm

Re: Very odd resolution glitch

Post by ObsequiousNewt »

It appears not. The only reason I'm posting this to Wine is because Wine appears to have caused the problem, and so I guess may be able to fix it.
User avatar
olivierfrdierick
Level 5
Level 5
Posts: 258
Joined: Thu Sep 13, 2012 12:09 pm

Re: Very odd resolution glitch

Post by olivierfrdierick »

I see. It is probable that Wine caused the problem. I have a surround display that combines 3 monitors through a triplehead2go. I have to juggle with xrandr, nvidia-settings and wine desktop to get fullscreen apps to run at proper resolutions. I cannot let Wine handle the resolution switching: It always messes the screen resolution up.

Check the output of xrandr, and if you're using proprietary video drivers, check if everything is correct in nvidia-settings or catalyst control center (or whatever software is provided with your video driver). Display manager may lack some advanced settings like Panning and ViewPortIn/Out.
Manually switching resolution with xrandr may reset video settings, too.
ObsequiousNewt
Level 2
Level 2
Posts: 15
Joined: Wed Oct 15, 2014 8:19 pm

Re: Very odd resolution glitch

Post by ObsequiousNewt »

Well, nvidia-settings does show the problem plain: under "display configuration" it says 1366x768, but under "X Screen 0" I see "Dimensions: 1701x905 pixels (423x225 millimeters)". And xrandr returns the following:

Code: Select all

zeb@endor:~$ xrandr 
Screen 0: minimum 8 x 8, current 1701 x 905, maximum 16384 x 16384
VGA-0 connected primary 1366x768+335+137 (normal left inverted right x axis y axis) 344mm x 193mm
   1366x768       59.8*+
   1280x800       59.8  
   1280x720       60.0  
   1024x768       75.0     70.1     66.0     60.0  
   800x600        75.0     72.2     60.3     56.2  
   640x480        75.0     72.8     59.9  
DVI-D-0 disconnected (normal left inverted right x axis y axis)
HDMI-0 disconnected (normal left inverted right x axis y axis)
zeb@endor:~$
I don't know quite how to use xrandr to set anything... if you could spare another minute to give me the correct command, I would be grateful.

And thanks for your help already!
User avatar
olivierfrdierick
Level 5
Level 5
Posts: 258
Joined: Thu Sep 13, 2012 12:09 pm

Re: Very odd resolution glitch

Post by olivierfrdierick »

Code: Select all

$ nvidia-settings --assign CurrentMetaMode="DFP-0: 1366x768 { ViewPortIn=1366x768, ViewPortOut=1366x768+0+0, Panning=1366x768}"
This would bring your 1366x768 resolution to its default settings.

You can also set this from the nvidia-settings GUI: In X Server Display Configuration, click on Advanced... you'll see the ViewPortIn, ViewPortOut and Panning. The advantage of the GUI is that it reverts the changes after a few seconds if you don't confirm. This is usefull for testing new settings. Also the Selection listbox is where DFP-0 in the command line comes from. Mine says "Matrox (DFP-0 on GPU-0)".

nvidia-settings remembers the settings for each mode. xrandr only switches from mode to mode. It does not change those settings.

Here is an example command line that will display a 640x480 screen without distortion on a 1366x768, centered and upscaled to fit the screen height:

Code: Select all

$ nvidia-settings --assign CurrentMetaMode="DFP-0: 1366x768 { ViewPortIn=640x480, ViewPortOut=1024x768+171+0, Panning=640x480}"
ObsequiousNewt
Level 2
Level 2
Posts: 15
Joined: Wed Oct 15, 2014 8:19 pm

Re: Very odd resolution glitch

Post by ObsequiousNewt »

It worked nicely. Thank you very much!
Locked