viewport width doesn't match display width; how to fix?

My display is 1920 pixels wide, but the viewport I’m getting on one of my machines is too wide by 1024, so 2944 instead of 1920. I had noticed this because if I move the mouse to the right it disappears into the phantom part of the viewport. Now I’m trying to create a centered button bar and it’s showing up 512 pixels too far to the right. (I confirmed that $[vp.width] is 2944.)

What could cause this? How do I fix it?

You wrote “machines”. I guess you connected them remote via … ?

In general you could calculate the button bar position depending on $[vp.width]]
PipeRead ‘echo InfoStoreAdd bbar_geometry x+$(($[vp.width]/2-/2))+<your-bbar-y-pos’
[/code]
Add the infostore variable to your FvwmButtons configuration]
DestroyModuleConfig YourButtonBar: *
*YourButtonBar: Geometry $[infostore.bbar_geometry][/code]
Remember: infostore is available since FVWM 2.6.3 I guess. For older FVWM versions use SetEnv instead.

– Thomas –

I’m using the machines directly on the console—several different machines with the same .fvwm2rc file. The problem I am describing is limited (I believe) to only one of four machine. (Manifestation is kind of subtle if you aren’t computing something from $[vp.width], so it’s possible I overlooked it.)

Yeah, in general it seems like I could calculate the button position using $[vp.width] except that $[vp.width] is 2944 and the actual screen width is 1920. So the button comes out in the wrong place, 512 pixels too far to the right.

Then you could try this]PipeRead perl -e \ 'my $center = ($[vp.width]-<your-bbar-width>)/2; \ if ($[vp.width] > 1920) { \ printf "InfoStoreAdd bbar_x_pos %.0f\\n", $center-(($[vp.width]-1920)/2); \ } else { \ printf "InfoStoreAdd bbar_x_pos %.0f\\n", $center; \ }'[/code]andDestroyModuleConfig YourButtonBar: * *YourButtonBar: Geometry <your-bbar-width>x<your-bbar-height>+$[infostore.bbar_x_pos]+<your-bbar-y-pos>
– Thomas –

It appears that the problem is with xrandr, which has mysteriously decided to give me extra width in my display. I’m not sure why, but it’s not an fvwm issue.

You could set your prefered resolution in xorg.conf of the problematic machine.
Or set the wanted resolution there with xrandr. Then restart FVWM.

At the moment, xorg.conf doesn’t exist. (At least I can’t find one.) I got the impression xrandr was supposed to eliminate the need for this file. The cause of the problem seems to be that xrandr thinks I have a DVI and a VGA signal and it’s making the virtual screen big enough for both to coexist. I’m not sure why xrandr thinks that, since only one cable (dvi) is connected, and there isn’t even a VGA out on this computer. But there you have it. If I select the correct size with xrandr and restart fvwm then everything works as desired.

Per default Xorg determine its settings depending on your hardware and /usr/share/X11/xorg.conf.d/. So xorg.conf isn’t needed at all. But sometimes it helps to create a default xorg.conf with sudo Xorg -configure and then editing the parts you have to change for proper work.

Would you post the output of xrandr -q

If the hardware/driver shows a VGA (could be internal only) xrandr displays it. Normally xrandr doesn’t change anything unless you do it wit this tool. Check the Xorg.log and the scripts in /usr/share/X11/xorg.conf.d/. Perhaps this configuration will be set from a xorg script … who knows :confused:

Good to hear 8)

– Thomas –

My configuration is the default I got when I installed ubuntu.

The initial status from xrandr is:

Screen 0: minimum 320 x 200, current 2944 x 1200, maximum 8192 x 8192
DVI-I-1 connected primary 1920x1200+0+0 (normal left inverted right x axis y axis) 582mm x 364mm
   1920x1200     59.95*+
   1600x1200     60.00  
   1280x1024     75.02    60.02  
   1152x864      75.00  
   1024x768      75.08    60.00  
   800x600       75.00    60.32  
   640x480       75.00    60.00  
   720x400       70.08  
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
VGA-1-1 connected 1024x768+1920+0 0mm x 0mm
   1024x768      60.00* 
   800x600       60.32    56.25  
   848x480       60.00  
   640x480       59.94  
  1024x768 (0x43) 65.000MHz
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock  48.36KHz
        v: height  768 start  771 end  777 total  806           clock  60.00Hz
  800x600 (0x44) 40.000MHz
        h: width   800 start  840 end  968 total 1056 skew    0 clock  37.88KHz
        v: height  600 start  601 end  605 total  628           clock  60.32Hz

When I change the virtual display size I get this, where it complains about lacking space for the VGA:

feynman> xrandr --fb 1920x1200
xrandr: specified screen 1920x1200 not large enough for output VGA-1-1 (1024x768+1920+0)
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  140 (RANDR)
  Minor opcode of failed request:  21 (RRSetCrtcConfig)
  Value in failed request:  0x780
  Serial number of failed request:  40
  Current serial number in output stream:  40

Afterwords it looks like this:

Screen 0: minimum 320 x 200, current 1920 x 1200, maximum 8192 x 8192
DVI-I-1 connected primary 1920x1200+0+0 (normal left inverted right x axis y axis) 582mm x 364mm
   1920x1200     59.95*+
   1600x1200     60.00  
   1280x1024     75.02    60.02  
   1152x864      75.00  
   1024x768      75.08    60.00  
   800x600       75.00    60.32  
   640x480       75.00    60.00  
   720x400       70.08  
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
VGA-1-1 connected
   1024x768      60.00  
   800x600       60.32    56.25  
   848x480       60.00  
   640x480       59.94  
  1024x768 (0x43) 65.000MHz
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock  48.36KHz
        v: height  768 start  771 end  777 total  806           clock  60.00Hz
  800x600 (0x44) 40.000MHz
        h: width   800 start  840 end  968 total 1056 skew    0 clock  37.88KHz
        v: height  600 start  601 end  605 total  628           clock  60.32Hz

Looks like your system is configured in Xinerama mode.
Have you Xinerama on in your .fvwmrc? If so disable it with Xinerama off

Yeah, it does what the manpage says:

Ok, now VGA-1-1 is connected but off. You could also do this without error message]
xrandr --output VGA-1-1 --off; xrandr --output DVI-I-1 --auto
[/code](Probably only the --off part is enough).

I’ve googled a bit around and found this: xrandr shows two displays (LVDS1), but how can I use VGA1 only?
This looks similar to your szenario. Perhaps it’s a solution :confused:

But at all it’s a strange behaviour which cannot explained completely, I’m afraid :confused:

Hope you find a satisfiable workaround. Best,

– Thomas –

I found that running your command to disable VGA worked. However, I had trouble finding a way to run it. If I run it from fvwm, it’s too late. Then fvwm needs to be restarted afterwards.

I tried to get lightdm to run it but after messing around for a while with its config file I still couldn’t get this working. (lightdm wasn’t running my script at all) I was about to try writing an xorg.conf but then I got the idea of installing the nvidia binary driver. Installing this driver fixed the problem. So there’s a workaround, of sorts.