Games on wine, sometimes fullscreen, sometimes windowed

Hi everyone,

I have an issue with Wine on Ubuntu mate.
I run small games which function very well in Wine, however for some reason when I restart the laptop the games seem to be having difficulties and all of them start windowed… there is not much consistency in that. So it looks like some setting is interfering with the resolutionswitching which needs to take place.I have an intel graphics chipset.

So let me list some of the facts else people will ask me to press alt-enter or adjust size in-game :wink:

  • Setup: docking station, VGA connector with Linux resolution running in 1280x1024 60Hz
  • Frozen-Bubble (Native Linux game) doesn’t seem to have this issue and switches to 800x600.
  • Wine configured as Win XP, all Graphics options currently untagged, (with the window manager options the problem was existant)

The good part:

  • When launching a game, it pops up in windowed mode, the maximize screen button is greyed out and in the options menu of the game full screen is deselected. When I tag it, the screen blacks out, switches resolution and I’m full screen in 800x600 which is great.

The bad part:

  • I reboot the laptop and this full screen setting seems to be lost as my application starts in windowed mode again? At this stage when I try to change it into full screen in-game there is a small full screen black blink and the window is back windowed as if nothing happened. full-screen mode unselected.

I don’t have a clue where to start looking but would guess something with X.
My questions would be, why is my previous setting lost? Why doesn’t he start again after a reboot, and later if I reboot again he might allow to put it full screen. Why does he change mood?

Anyone up to helping me find this issue? I will try running Wine with Sudo now to see if there isn’t a permission issue or something. But would prefer to know the location of a log which indicates something on why he doesn’t switch resolution when requested by the game through Wine to Ubuntu.

thx

One additional fact I just noticed !
I didn’t reboot the laptop after the problem occured, and tested the game again and it started in windowed mode, tried to put it full screen and it did NOT work.
Then I decided to go to the display resolution configuration screen, did not adjust anything and just pressed apply…

Started the game and it works when requesting full screen option… the setting will of course get lost shortly but really, What the F?

To be honest, I have always found Wine to be a bit flaky when using anything but the most obvious MS Office type applications and, even then, can still act up a bit. Wine is a good idea in principle. But, in my own experience, in practice it often falls short of expectations.

When faced with MS Windows only games. I will, in order, try to find a Linux port of the game, run the game in Wine, run the game in Virtual-Box or run the game in a separate, dedicated MS Windows gaming partition that I can log into at the Grub boot screen.

Of all of the above, running the separate Windows partition is the one that is guaranteed to work every single time. But is the most hassle to set-up. However, having done it once, you’d find it easy on all subsequent occasions you needed to set it up.

Let me know if you want a walk-through of how to do any of the above.

Thanks for your feedback.
Well that’s really the thing I did not want to hear…
I was so happy with Wine, and it works super well… except for that full screen issue.

On the other hand I might go for the virtual box option just to see if the laptop can handle it all, it’s quite an old one. The laptop was made for WinXp, so I imagine that I should try virtualbox with some pirate version of win Xp? (considering MS isn’t selling it anymore :slight_smile: )

Not that I am suggesting you should (because that would be illegal…ahem), but you can be certain of downloading an old copy of, say, XP, if you go on any of the popular torrent sites.

In all seriousness, though, be warned that they could contain Trojans etc. Thus, if you intend to go down that route, ensure you always use it offline. In other words, if you intend to play on-line games on an MS windows partition, I would seriously recommend using a legit version of Ms Windows.

Thanks Steve, I am not intending to use it online so will certainly go down that route. even if it’s for playing around with virtual box.

I have to give an update though on the issue itself, I think I might have another clue.

As said before the problem disappears when I go into display settings and only apply the existing resolution config. So I went looking for the command behind it and came accross xrandr. In the man page I noticed that a dryrun extension is possible and when I reboot the laptop (closed screen, external monitor connected on docking) I confirm the windowing issue by opening the application through Wine. close it. and run “xrandr --dryrun” and this resolved the issue again.
Maybe there is something going on inside the xrandr realm with the 2 screens etc. I’m affraid to touch that.

So my thought for a workaround is that if I create a batch file and let it run automatically after the boot of the desktop this should resolve the issue as well. I hope there is a way to do this in Linux?
You think it’s ok to work in such a way?

I use Wine perfectly well for a number of Steam and non-Steam games. If the game is requesting a resolution that isn’t the same as my monitor (1920x1080) then I may encounter full-screen problems. It may change but not switch back for instance, or it may not apply the correct resolution and start spanning the screen with the cursor. :neutral_face:

I have an NVIDIA card with proprietary drivers, so it’s possible that your graphics card/driver and window manager (Marco/Compiz) will play a role here too.

One solution I came to is to enable a virtual desktop matching the resolution of your screen. Games that are full screen (to your native resolution) are displayed perfectly fine, and for games that use a smaller resolution (ie. 800x600) then they will be displayed in a window, despite thinking they’re full screen.

I have another bug where changing the workspace in a full-screen game will freeze it… this doesn’t happen when Wine is in a virtual desktop. Wine’s great but full-screen can be buggy when it differs to the current resolution in use.

You may wish to try installing the development versions of Wine, which are more up-to-date and may change the behaviours.


For 3D games, I wouldn’t recommend a virtual machine, the virtual graphics (even with 3D acceleration enabled) is not very powerful.


That’s slightly odd, since all --dryrun does:

Performs all the actions specified except that no changes are made.

(According to  man xrandr)

This looks like a placebo effect. In theory, this command isn’t actually do anything in particular. If (bizarrely) you can confirm this makes a difference, you can create a bash (shell) script and add it to Start-up Programs.

Hello

I understand very well that you suspect a Placebo issue but I tested it so many times now, just did it again to really be sure. Now I did:

  • Reboot Laptop
  • Start game
    = Windowed mode
  • In-game selected Options - Full screen
    = No result, still windowed
    Exited Game
    Now just to be certain about the second time, I repeated this process with the same result.

Then I ran following command:
“sudo xrandr --dryrun”
Got ouput in my terminal.

  • Start Game
    = Windowed mode
  • Options-Full screen
    = Screen Blacks out and transforms in a nice 800x600 (I think) full screen resolution.

Ok it seems I’m not allowed to upload a text file so will just paste the output I got from the xrandr --dryrun command. Maybe it helps. I’m actually quite curious about what the cause might be behind the problem :slightly_smiling:

So my external monitor connected over VGA to my docking station is in 1280x1024.
My laptop screen supports 1024x768 but I don’t use it so it’s closed.
I also have a VGA connector on my laptop, but not using it.

Screen 0: minimum 8 x 8, current 1280 x 1024, maximum 32767 x 32767
LVDS1 connected (normal left inverted right x axis y axis)
_ Identifier: 0x42_
_ Timestamp: 172058_
_ Subpixel: horizontal rgb_
_ Clones: _
_ CRTCs: 1_
_ Transform: 1.000000 0.000000 0.000000_
_ 0.000000 1.000000 0.000000_
_ 0.000000 0.000000 1.000000_
_ filter: _
_ EDID: _
_ 00ffffffffffff0006af512400000000_
_ 010f0103801e17780a87f594574f8c27_
_ 27505400000001010101010101010101_
_ 01010101010164190040410026301888_
_ 360030e4100000180000000f00000000_
_ 00000000000000000020000000fe0041_
_ 554f0a202020202020202020000000fe_
_ 004231353058473032205634200a0000_
_ BACKLIGHT: 10 _
_ range: (0, 10)_
_ Backlight: 10 _
_ range: (0, 10)_
_ scaling mode: Full aspect _
_ supported: None, Full, Center, Full aspect_
_ 1024x768 (0x47) 65.000MHz -HSync -VSync +preferred_
_ 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 (0x91) 40.000MHz +HSync +VSync_
_ 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_
_ 800x600 (0x92) 36.000MHz +HSync +VSync_
_ h: width 800 start 824 end 896 total 1024 skew 0 clock 35.16KHz_
_ v: height 600 start 601 end 603 total 625 clock 56.25Hz_
_ 640x480 (0x93) 25.175MHz -HSync -VSync_
_ h: width 640 start 656 end 752 total 800 skew 0 clock 31.47KHz_
_ v: height 480 start 490 end 492 total 525 clock 59.94Hz_
_ 512x384 (0x94) 14.901MHz -HSync +VSync_
_ h: width 512 start 520 end 568 total 624 skew 0 clock 23.88KHz_
_ v: height 384 start 385 end 388 total 398 clock 60.00Hz_
TV1 disconnected (normal left inverted right x axis y axis)
_ Identifier: 0x43_
_ Timestamp: 172058_
_ Subpixel: unknown_
_ Clones: _
_ CRTCs: 0 1_
_ Transform: 1.000000 0.000000 0.000000_
_ 0.000000 1.000000 0.000000_
_ 0.000000 0.000000 1.000000_
_ filter: _
_ bottom margin: 37 _
_ range: (0, 100)_
_ right margin: 46 _
_ range: (0, 100)_
_ top margin: 36 _
_ range: (0, 100)_
_ left margin: 54 _
_ range: (0, 100)_
_ mode: NTSC-M _
_ supported: NTSC-M, NTSC-443, NTSC-J, PAL-M, PAL-N, PAL, 480p, 576p, 720p@60Hz, 720p@50Hz, 1080i@50Hz, 1080i@60Hz_
VGA1 connected primary 1280x1024+0+0 (0x48) normal (normal left inverted right x axis y axis) 376mm x 301mm
_ Identifier: 0x44_
_ Timestamp: 172058_
_ Subpixel: unknown_
_ Gamma: 1.0:1.0:1.0_
_ Brightness: 1.0_
_ Clones: _
_ CRTC: 0_
_ CRTCs: 0 1_
_ Transform: 1.000000 0.000000 0.000000_
_ 0.000000 1.000000 0.000000_
_ 0.000000 0.000000 1.000000_
_ filter: _
_ EDID: _
_ 00ffffffffffff0022f0822601010101_
_ 0d11010368261e78eeee95a3544c9926_
_ 0f5054adef8081800101010101010101_
_ 010101010101302a009851002a403070_
_ 1300782d1100001e000000fd00384c1e_
_ 530e000a202020202020000000fc0048_
_ 50204c31393430540a0a0a0a000000ff_
_ 00434e4b373133303258300a202000bf_
_ 1280x1024 (0x48) 108.000MHz +HSync +VSync *current +preferred_
_ h: width 1280 start 1328 end 1440 total 1688 skew 0 clock 63.98KHz_
_ v: height 1024 start 1025 end 1028 total 1066 clock 60.02Hz_
_ 1280x1024 (0xc1) 135.000MHz +HSync +VSync_
_ h: width 1280 start 1296 end 1440 total 1688 skew 0 clock 79.98KHz_
_ v: height 1024 start 1025 end 1028 total 1066 clock 75.02Hz_
_ 1152x864 (0xc2) 108.000MHz +HSync +VSync_
_ h: width 1152 start 1216 end 1344 total 1600 skew 0 clock 67.50KHz_
_ v: height 864 start 865 end 868 total 900 clock 75.00Hz_
_ 1024x768 (0xc3) 78.800MHz +HSync +VSync_
_ h: width 1024 start 1040 end 1136 total 1312 skew 0 clock 60.06KHz_
_ v: height 768 start 769 end 772 total 800 clock 75.08Hz_
_ 1024x768 (0xc4) 75.000MHz -HSync -VSync_
_ h: width 1024 start 1048 end 1184 total 1328 skew 0 clock 56.48KHz_
_ v: height 768 start 771 end 777 total 806 clock 70.07Hz_
_ 1024x768 (0x47) 65.000MHz -HSync -VSync_
_ 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_
_ 832x624 (0xc5) 57.284MHz -HSync -VSync_
_ h: width 832 start 864 end 928 total 1152 skew 0 clock 49.73KHz_
_ v: height 624 start 625 end 628 total 667 clock 74.55Hz_
_ 800x600 (0xc6) 50.000MHz +HSync +VSync_
_ h: width 800 start 856 end 976 total 1040 skew 0 clock 48.08KHz_
_ v: height 600 start 637 end 643 total 666 clock 72.19Hz_
_ 800x600 (0xc7) 49.500MHz +HSync +VSync_
_ h: width 800 start 816 end 896 total 1056 skew 0 clock 46.88KHz_
_ v: height 600 start 601 end 604 total 625 clock 75.00Hz_
_ 800x600 (0x91) 40.000MHz +HSync +VSync_
_ 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_
_ 640x480 (0xc8) 31.500MHz -HSync -VSync_
_ h: width 640 start 656 end 720 total 840 skew 0 clock 37.50KHz_
_ v: height 480 start 481 end 484 total 500 clock 75.00Hz_
_ 640x480 (0xc9) 31.500MHz -HSync -VSync_
_ h: width 640 start 664 end 704 total 832 skew 0 clock 37.86KHz_
_ v: height 480 start 489 end 491 total 520 clock 72.81Hz_
_ 640x480 (0xca) 25.200MHz -HSync -VSync_
_ h: width 640 start 656 end 752 total 800 skew 0 clock 31.50KHz_
_ v: height 480 start 490 end 492 total 525 clock 60.00Hz_
_ 720x400 (0xcb) 28.320MHz -HSync +VSync_
_ h: width 720 start 738 end 846 total 900 skew 0 clock 31.47KHz_
_ v: height 400 start 412 end 414 total 449 clock 70.08Hz_
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
_ Identifier: 0x45_
_ Timestamp: 172058_
_ Subpixel: no subpixels_
_ Clones: _
_ CRTCs: 2_
_ Transform: 1.000000 0.000000 0.000000_
_ 0.000000 1.000000 0.000000_
_ 0.000000 0.000000 1.000000_
_ filter:_

So I created a bash script… maybe not the best way, feel free to correct me but it works manually.

Chown’ed it to root
Chmod’ed it to a+x
Content:
#!/bin/bash
xrandr --dryrun

Made a reference to the file in the start-up programs, but it didn’t do the trick.
Once I tried the game I manually clicked on it, and it worked without me having to run the command manually.

Maybe there is some sequence of events taking place which requires this to be run later?

EDIT: I added a sleep command of 20 seconds to the script and now it seems to function properly.
The games start like a charm now. I’m still having a double feeling though, how is it possible that I have to run a command which shouldn’t do anything to make this work?

Here is my XORG log

[ 39.929] (II) intel(0): Printing DDC gathered Modelines:
[ 39.929] (II) intel(0): Modeline "1024x768"x0.0 65.00 1024 1048 1184 1344 768 771 777 806 -hsync -vsync (48.4 kHz eP)
[ 77.769] (II) intel(0): switch to mode [email protected] on VGA1 using pipe 0, position (0, 0), rotation normal, reflection none
[ 87.508] (II) intel(0): switch to mode [email protected] on VGA1 using pipe 0, position (0, 0), rotation normal, reflection none
[ 428.953] (II) intel(0): switch to mode [email protected] on VGA1 using pipe 0, position (0, 0), rotation normal, reflection none
[ 439.828] (II) intel(0): switch to mode [email protected] on VGA1 using pipe 0, position (0, 0), rotation normal, reflection none
[ 950.671] (II) intel(0): switch to mode [email protected] on VGA1 using pipe 0, position (0, 0), rotation normal, reflection none
[ 976.133] (II) intel(0): switch to mode [email protected] on VGA1 using pipe 0, position (0, 0), rotation normal, reflection none
[ 984.956] (II) intel(0): switch to mode [email protected] on VGA1 using pipe 0, position (0, 0), rotation normal, reflection none
[ 1006.745] (II) intel(0): switch to mode [email protected] on VGA1 using pipe 0, position (0, 0), rotation normal, reflection none

Really,you just needed to chmod +x (can also be right clicked to properties and marked as executable) and keep yourself as the owner, as root is not needed for this command. The entry in start-up programs should look something like '/home/username/my script.sh' with surrounding hyphens/speech marks if it contains a space.


If you’d like to investigate if this is a bug with Wine, then you can record a log by launching the program via the terminal. For severe issues, you’ll notice an err: but many fixme: are quite harmless.

wine 'C:\Program Files\The Game\executable.exe' &>wine.log

This runs the application in the default prefix [~/.wine] and writes a log wine.log to the current directory.


Consider pasting future logs to pastebin and linking them here to save space.


You could try the latest version to see if Wine itself has resolved this issue. Current version in Ubuntu repositories is 1.6.2, the latest development build is 1.9.2 via their official PPA:

sudo add-apt-repository ppa:wine/wine-builds
sudo apt-get update
sudo apt-get install winehq-wine-devel

Bash scripts are our friends!..:slight_smile:

For the record, until recently I had an old LCD TV I was using as a monitor and found that the resolution I set on the system would not load properly at login. However, after login, if I checked the resolution settings, it read the settings I had previously implemented. I then found if I changed changed the resolution to any other setting and them immediately changed it back to the one I had originally chosen then, hey-presto, the resolution worked! So, I wrote a simple bash script using xrandr to implement the switch-back in resolutions automatically and set it as a start-up script. It worked like a treat.

The commands in the script were simply:

xrandr -s 1024x768
xrandr -s 1280x768

None of which is of any direct relevance, of course…:slight_smile: But just serves to illustrate the point that where there’s a will there’s a bash script!