Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Cuando salgo de un videojuego que tiene una resolución inferior a la del sistema, Ubuntu se queda con una resolución baja. Tengo que cerrar sesión y volver a entrar para corregir el problema. ¿Como lo puedo solucionar?

When I leave a game that has a lower resolution than the system, Ubuntu is stuck in a low resolution. I have to log off and log back in to correct the problem. How can I fix this?

share|improve this question
    
Actually many apps/games do this. Specially when we maximized the resolution or let wine take the max resolution that we are using as base. –  Luis Alvarado Oct 23 '11 at 18:17

3 Answers 3

SPANISH

Hola David, lo que mencionas es un problema con WINE muy pero muy viejo. Tiene que ver con que no detecte el modo actual de resolucion sino que lo sustituya con el que estaba usando el juego. Esto pasa por dejar que wine utilice la actual resolution como base para la del juego o aplicacion. Para estos problemas te tengo 3 opciones.

OPCION 1 - Abrir winecfq, luego haz click en el tab de Graficos/Graphics y la 4ta opcion que dice sobre "Emular un Escritorio Virtual" / "Emulate a Virtual Desktop" haz click alli para activar esa opcion y luego colocas una resolucion igual o menor a la que estas utilizando en tu escritorio real. Por ejemplo en mi caso tengo 1920x1080 pero la resolucion que le coloco a winehq es 1280x1024. De esta forma evito el problema del cambio de resolucion ya que aislo la resolucion de wine de la resolucion real.

OPCION 2 - Agregas al atajo de wine del juego una resolucion especifica. Por ejemplo para NEED 4 SPEED MOST WANTED yo tengo un icono en el escritorio con la siguiente data:

env WINEPREFIX="/home/cyrex/.wine" wine explorer /desktop=MostWanted,1280x1024 "/home/cyrex/.wine/drive_c/Program Files/EA GAMES/Need for Speed Most Wanted/speed.exe"

la parte que te importa es explorer /desktop=WoW,1280x1024 en donde mencionas 2 elementos, el nombre de la ventana MostWanted y la resolucion de dicha ventana 1280x1024. Que ganas con esta opcion. Que la resolucion sea ESPECIFICA para este juego o programa en vez de afectar a todos los juegos o programas como en la opcion 1.

OPCION 3 - Crear un atajo/shortcut que al ocurrir el problema de resolucion simplemente presionas una combinacion de teclas y tiene la resolucion que querias. Para realizar esto debes seguir los siguientes pasos:

  1. Abre una consola/terminal y escribes xrandr
  2. Te saldran varias opciones de resolucion. Comenzando con la primera en la lista se enumeran del 0 hasta donde llegue la ultima mostrada.

        cyrex@cyrex:~$ xrandr  
        xrandr: Failed to get size of gamma for output default  
        Screen 0: minimum 320 x 240, current 1920 x 1080, maximum 1920 x 1080  
        default connected 1920x1080+0+0 0mm x 0mm  
           1920x1080      50.0*    51.0   
           1680x1050      52.0     53.0  
           1440x900       54.0  
           1400x1050      55.0  
           1360x768       56.0     57.0  
           1280x1024      58.0     59.0  
           1280x960       60.0  
           1280x720       61.0  
           1152x864       62.0  
           1024x768       63.0     64.0  
           960x600        65.0  
           960x540        66.0  
           840x525        67.0     68.0  
           800x600        69.0     70.0     71.0     72.0  
           720x450        73.0  
           700x525        74.0  
           680x384        75.0     76.0  
           640x480        77.0     78.0  
           512x384        79.0  
           320x240        80.0 
    

    Como puedes ver mi primera opcion es 1920x1080. La segunda es 1680*1050 y asi sucesivamente. La primera opcion tiene el valor 0, la siguiente 1, la siguiente 2 y ya imagino que tienes la idea. Estos valores, 0, 1, 2... son para el comando xrandr.

Si algo llega a pasar y quieres regresar a la resolucion que tenias antes, asumiendo que sea la 0 (O sea 1920x1080 en mi caso). Simplemente escribes xrandr -s 0 en consola. Ahora bien, no TODO el tiempo podras hacerlo ya que la resolucion estara TAN MALA que no podras ver nada o en algunos casos ni siquiera la consola. Asi que para eso vamos a crear el atajo. Ya con la resolucion que quieres nos vamos a la ventana del TECLADO (Esto lo buscas en el menu o a traves del Dash. De una u otroa forma debes llegar a la ventana donde uno configura el teclado). Sigue las imagenes para tener una idea:

Ventana del Teclado enter image description here

Tab de Atajos/Shortcuts enter image description here

Seleccion de Atajos/Shortcuts CUSTOMIZADOS enter image description here

Seleccion del simbolo + para agregar un Atajo/Shortcut Customizado enter image description here

Ventana para agregar Atajo/Shortcut Customizado enter image description here

En esta parte es donde le colocaremos un atajo que al ejecutarlo nos solucionara el problema de la resolucion cuando nos pase. Agregamos nu nombre al atajo que nos sea familiar a la funciona que tendra y abajo el comando que se ejecutara.

enter image description here

Hacemos doble click en donde dice Disable/Desactivado para colocar la nueva combinacion de teclas que ejecutaran el comando. enter image description here

Aqui puedes ver una que invente como ejemplo. enter image description here

Estas son las 3 opciones mas comunes para resolver este problema.


ENGLISH

Hello David, what you mention here is an old problem related to WINE. It has to do with how wine detects the actual desktop resolution and substitutes it with the game resolution. This happens because we let wine take the resolution we are using in that moment as base for the one it will use inside the game or app. For this problem there are 3 possible options:

OPTION 1 - Open winecfq, click on the Graphics tab and on the 4th option that says "Emulate a Virtual Desktop" click on it to activate it and the input the resolution you want WINE to open future games. For example, in my case, I have a 1920x1080 desktop resolution but I a smaller 1280x1024 for the WINE resolution. This way I avoide the problem of wine changing the real resolution for the wine resolution used in a game..

OPTION 2 - Add to the game shortcut in the desktop a specific resolution. For example for NEED 4 SPEED MOST WANTED I have an icon in the desktop with the following shortcut:

env WINEPREFIX="/home/cyrex/.wine" wine explorer /desktop=MostWanted,1280x1024 "/home/cyrex/.wine/drive_c/Program Files/EA GAMES/Need for Speed Most Wanted/speed.exe"

The section that matters is explorer /desktop=WoW,1280x1024 in which you tell WINE 2 things, the name of the window the game will run MostWanted and the resolution that window will run on 1280x1024. What do you gain with this option, you gain the fact that the specific resolution will only affect that game and not all games runned, asi in the case of Option 1 which will affect all games/apps runned in wine.

OPCION 3 - Create a shortcut that when the resolution problem appears you simply execute the shortcut combination and it will fix the problem right then and there. To do this we follow a simple set of steps:

  1. Open console/terminal and type xrandr
  2. You will a list of resolutions. Starting from the first in the list they will enumerate from 0 to the last resolution shown (0,1,2,3...10)

        cyrex@cyrex:~$ xrandr  
        xrandr: Failed to get size of gamma for output default  
        Screen 0: minimum 320 x 240, current 1920 x 1080, maximum 1920 x 1080  
        default connected 1920x1080+0+0 0mm x 0mm  
           1920x1080      50.0*    51.0   
           1680x1050      52.0     53.0  
           1440x900       54.0  
           1400x1050      55.0  
           1360x768       56.0     57.0  
           1280x1024      58.0     59.0  
           1280x960       60.0  
           1280x720       61.0  
           1152x864       62.0  
           1024x768       63.0     64.0  
           960x600        65.0  
           960x540        66.0  
           840x525        67.0     68.0  
           800x600        69.0     70.0     71.0     72.0  
           720x450        73.0  
           700x525        74.0  
           680x384        75.0     76.0  
           640x480        77.0     78.0  
           512x384        79.0  
           320x240        80.0 
    

As you can see my first option is 1920x1080. The second is 1680*1050 and so forth and so on.. The first option has a value of 0, the next one 1, and the one after that 2. This continues for all resolutions in the list. This 0,1,2... values are for the xrandr command.

If the problem happens and you want to go back to the resolution you had before, assuming it is 0 (0 in my case been 1920x1080), you simply type xrandr -s 0 in the terminal. Now, the problem sometimes is that the resolution WINE creates after the problem is not visible/all black/too small. In this cases you will not know what you are doing. This is the reason to create a shortcut for the xrandr command. After knowing what resolution you want (0,1,2..) we go to the Keyboard Shortcut Window (Search for it in the menu, dash, terminal..) and then follow the next images to configure it:

Keyboard Shortcut Window enter image description here

Shortcut Tab enter image description here

Shortcut Selection (Customized) enter image description here

Select + Symbol to add a Shortcut enter image description here

Shortcut Add Windows enter image description here

In this part we will add the shortcut that when executed will solve the resolution problem caused by wine. We add the shortcut name related to the action the shortcut will do and then the actual command the shortcut will execute. enter image description here

Double Click on the word Disable to add the key combination to execute the shortcut. enter image description here

Here you can see one that I made up. enter image description here

This are the 3 options you have to solve this problem.

share|improve this answer

Usually that means that the game crashed or quit before it finished cleaning up, so you could check your ~/.xsession-errors file and see if it says anything. If using wine, check the wine logs as well.

A better workaround to fix the resolution is:

  1. click on the little gear icon in the top right menu
  2. choose "displays"
  3. choose the appropriate resolution from the list
share|improve this answer

This isn't an answer for why this happens (because I don't know), this is a workaround.

Before you launch the game, go to a terminal and type xrandr. You should see something like this:

$ xrandr
Screen 0: minimum 320 x 200, current 1600 x 900, maximum 1600 x 1600
DFP1 disconnected (normal left inverted right x axis y axis)
CRT1 connected 1600x900+0+0 (normal left inverted right x axis y axis) 443mm x 249mm
   1600x900       60.0*+
   1366x768       59.9 +
   1280x1024      75.0     60.0  
   1440x900       59.9  
   1280x960       75.0     60.0  
   1360x768       60.0  
   1280x800       75.0     60.0  
   1152x864       75.0     60.0  
   1280x768       74.9     59.9  
   1280x720       60.0  
   1024x768       75.0     60.0  
   800x600        75.0     60.3  
   720x480        60.0  
   640x480        75.0     60.0 

See the asterisk? That line is the mode (which includes resolution) that it's set to. In my case, my resolution is 1600x900. Write your resolution down.

Later, after you have a messed up screen resolution, go to the terminal and type

xrandr -s YOUR_RESOLUTION_HERE

This should reset your resolution to it's pre-game state.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.