Bug 163707

Summary: kde4 does not restore screen resolution at login
Product: [Unmaintained] krandr Reporter: Viesturs Zarins <viesturs.zarins>
Component: generalAssignee: Gustavo Pichorim Boiko <gustavo.boiko>
Status: RESOLVED FIXED    
Severity: normal CC: chealer, curan, danielstefanmader+kde, didier.garde, dietrichmathias, enleth, flacycads, kde.org, kennethlakin, l.lunak, long, maciekmal, mfeerf, mroeben, myriam, oren, ransom, shaolinestu, stephanolbrich, sven.burmeister, tropikhajma, v.kiril, wstephenson
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Viesturs Zarins 2008-06-10 15:28:24 UTC
Version:            (using Devel)
Installed from:    Compiled sources
OS:                Linux

First, i'm using kde4daily on VirtualBox, updated today

Steps to reproduce:
Open SystemSettings, Screen, change resolution to 640x480 (or any except default), apply it.
Logout (you get the default resolution back).
Login again (the display stays at the default resolution).

Expected behavior: Display changes to the set resolution (640x480).

Note that as you open SystemSettings->Screen after logging back in, the display is set to the needed resolution (640x480).
Comment 1 Christophe Olinger 2008-06-28 17:34:11 UTC
I have the same problem.
It was marked as resolved in bug 157139.
(kde4.1 beta2 in kubuntu)
Comment 2 Kenneth Lakin 2009-01-11 01:56:48 UTC
I can confirm this behaviour and have a "bandaid" resolution.

**THE SYSTEM**
I'm running a unstable (~x86) Gentoo Linux system.
I've built KDE from R908976 of the 4.2 SVN branch. 
I'm using QT version 4.4.2
I'm using version 6.9.0 of xf86-video-ati on an AGP R420 (Radeon X800)
I'm using version 7.4 of xorg-x11.

**THE BUG**
This behaviour is seen when setting KDE's resolution to anything lower than the display adaptor/monitor's maximum resolution, then logging out, and logging back in.
Repro recipe for a system with a maximum resolution of 1600x1200:
* Start KDE.
* Open the "Display" System Settings applet.
* Set the "Size" of your monitors to something smaller than 1600x1200.
* Click "Apply".
* Close the System Settings window and log out.
* Start KDE.
* Watch the display size be set to 1600x1200.
** Opening the "Display" System Settings applet correctly reset the screen resolution.
** Starting krandrtray also correctly resets the screen resolution.

I've repro'd this with a monitor whose max resolution was 1024x768 and one whose max resolution was 1856x1392. I would imagine that this bug is triggered regardless of max resolution.

**THE PROPOSED BANDAID**
Add krandrtray to the list of applications that get started at default.

**THE RATIONALE**
The prototypical visually-impaired grandma with the 24" CRT that her geeky son set to 1024x768 will have to reconfigure her system each and every time she logs in. This would get really annoying, really fast. (It's annoying when it happens to me, at least.)
Also, -unless the "automatically start Strigi, Nepomuk, and Akonadi" setting is stored somewhere other than ~/.kde4- we're starting Strigi, Nepomuk, and Akonadi on startup as well. I imagine that an average user would care about his desktop resolution decision being constantly ignored long before he worried about file indexing.

And, Half-Left in #kde spoke to Aaron Seigo about it. Siego agreed that it should be started by default.

Let me know if I can provide more info. I'm not afraid of applying patches or experimental code, either!
Comment 3 Gerard 2009-02-07 17:47:43 UTC
Woah! 640x480! This is a very old resolution and you will see thing so big! Why you want to change to so few resolution?

That annoying bug happened to me from 1st installation of Kubuntu 8.10 with KDE 4.13, then updated to 4.12 Beta2 adn 4.2 RC1 and is not solved! I dont know why so many effects with KWin (that Im affraid to use from fist version for turned black my creen) cause that is MOST IMPORTANT cs evetime I had to set it to my res! I have reolution set to 1024 and Im not "visually-impaired" or have an 24" CRT, Ive a 19"LCD. It si for fonts are very small (size 9) and hard to read, in Konqueror more, this didnt happened in Kubuntu 8.04 with KDE 3.5.9. Iv to force to 96DPI, and this is not fixed too!I like big icons, btw some install the Apple panel that has more big icons...
I started krandrtray in first kde 4 versions but when I reboot disapeared from SysTray and res was set to max. I ran it now on KDE 4.2 but when IO reboot prob I ll get he same error. As I dont know how to add krandrtray to the list of applications that get started at default and I think that is better find a solution at the root of that really fixes the problem to future releses but I dont understand las solution Kenet said:

" **THE RATIONALE**
The prototypical visually-impaired grandma with the 24" CRT that her geeky son
set to 1024x768 will have to reconfigure her system each and every time she
logs in. This would get really annoying, really fast. (It's annoying when it
happens to me, at least.)
Also, -unless the "automatically start Strigi, Nepomuk, and Akonadi" setting is
stored somewhere other than ~/.kde4- we're starting Strigi, Nepomuk, and
Akonadi on startup as well. I imagine that an average user would care about his
desktop resolution decision being constantly ignored long before he worried
about file indexing.

And, Half-Left in #kde spoke to Aaron Seigo about it. Siego agreed that it
should be started by default."


Comment 4 Kubuntiac 2009-02-24 23:54:37 UTC
Um, I'm getting this even when I *do* set my screen resolution to maximum. (1680 x 1050). The only possible exception I can think of is that I have a second monitor plugged in but not being used. Maybe "maximum resolution" here is defined as using the big desktop (both screens)?

Anyway, I'm still getting this today with Jaunty-Dev using KDE 4.2 and Kdebase-workspace 4:4.2.0-0ubuntu8
Comment 5 Gerard 2009-03-07 01:10:32 UTC
You mean, 2 monitors in a graphic card with TV output? Cause my old nVidia FX 5200 has TV output too, but I dont think that is the problem as when I started using Kubuntu 8.10 with KDE 3.5.9 that bug didnt occur..
Comment 6 Gerard 2009-03-07 01:12:00 UTC
with the same graphic card I mean.
Comment 7 Matyas Ferenc 2009-03-25 15:23:14 UTC
I can confirm this bug on KDE 4.2.1. (openSUSE 11.1 64 bit, KDE4 Factory Desktop repository).

I'd brought a new monitor. Initially, the old monitor's resolution was set to 1280x1024 (max. resolution). Then I installed this new LCD, changed the settings in System Settings Display applet to 1680x1050 (max. resolution). After restart the resolution was 1280x1024, but when I start the Display applet (after every restart) the resolution automatically changes to 1680x1050.
Comment 8 Matyas Ferenc 2009-03-25 15:25:54 UTC
*** This bug has been confirmed by popular vote. ***
Comment 9 Kiril Vladimiroff 2009-11-14 12:56:30 UTC
Is there any progress with resolving this bug? Because right now the settings made in Display section at System Settings are totally useless. It doesn't matter what I set, because it doesn't get working after each logout->login, until I open the System Settings -> Display again.

Is there a fast way for the screen config(.kde4/share/config/krandrrc I think it was) to gets loaded right after each login in kde4? It is good solution for me if I should add it as a Startup script in kde4 configuration.

KDE 4.3.3
Comment 10 ransom 2010-05-26 04:10:48 UTC
(In reply to comment #9)
> Is there any progress with resolving this bug? Because right now the settings
> made in Display section at System Settings are totally useless. 

I agree! And I can confirm this bug- have had the issue under jaunty, karmic and now lucid. I am running kubuntu 10.04 with the 31-22 kernel and kde 4.4.3 on a Toshiba Satellite w P4-M 2.0 ghz, nvidia geforce 460 go (using default drivers not nvidia drivers) and 1gb ram.

From surfing around it appears that this bug has been known for about 18 months and seems to be independent of video card (ati, nvidia, intel) as well as indifferent to native resolution and secondary displays.

cheers, ransom
Comment 11 Kai Wb. 2010-05-27 13:55:27 UTC
I'm seeing this issue (restoration of the wrong resolution* on login) only since the update to KDE 4.4.3, but it's still annoying to have to change the resolution to the preferred one on login.

I'm on Debian testing (Squeeze).

* I thirst thought KRandR restores always the default resolution of the screen on login, but by accident I've discovered, that it seems to keep/restore the resolution in which KDM ran. And KDM starts up (for me) with the default resolution of the screen. But when I logout, KDM is loaded with the last used resolution (that is higher than the default resolution). This higher resolution is kept/restored after I relogin to my account. After a reboot KDM starts with the default resolution again, which is then set for the session itself and not changed by KRandR on its start-up.
Comment 12 tropikhajma 2010-06-05 13:20:02 UTC
This is so annoying.
I'm running KDE4.4.4 inside VirtualBox. I don't want to screen set to its max resolution since then I have to scroll the VirtualBox window.
Comment 13 Remigiusz Marcinkiewicz 2010-07-11 23:14:40 UTC
This bug and some relevant feature reqests have been reported several timeas already (#220079, #235883, #238278 among others). It is annoying and it makes the Display section of the System Settings useless and misleading - "System Settings" sounds very much like something that should be saved and restored when appropriate, while leaving temporary configuration changes (e.g. for use with beamers on laptops) to the KRandRTray and the likes.

Additionally, the assignee, Gustavo Pichorim Boiko, is reportedly no longer an active KDE developer. I've got nothing against the guy, it was his right to quit, but it would be nice if someone stepped up for the task because right now, loads of bug reports related to display configuration are being assigned to a dead email address.
Comment 14 Lubos Lunak 2010-08-31 15:09:27 UTC
You are welcome to be this somebody.
Comment 15 Lubos Lunak 2010-08-31 15:55:55 UTC
SVN commit 1170315 by lunakl:

- move the somewhat long krandr setup code from startkde
  into its own separate script that is called from startkde
- use properly krandrrc instead of kcmrandrrc in the script
- implement support for randr1.2 (non-legacy) setup, which
  is done by kcm_krandr simply saving a list of CLI xrandr commands
  and those are executed by the script
- add a buttom to kcm_krandr to save the current setup
  as the default to be used during desktop startup

FEATURE: 157839
FEATURE: 219704
FEATURE: 235883
FEATURE: 238278
FEATURE: 163707
FEATURE: 141999
FEATURE: 229529
BUG: 246298
FEATURE: 183143



 M  +5 -0      kcontrol/randr/CMakeLists.txt  
 AM            kcontrol/randr/krandrstartup  
 M  +5 -1      kcontrol/randr/legacyrandrconfig.cpp  
 M  +22 -0     kcontrol/randr/legacyrandrscreen.cpp  
 M  +1 -0      kcontrol/randr/legacyrandrscreen.h  
 M  +46 -0     kcontrol/randr/randrconfig.cpp  
 M  +2 -0      kcontrol/randr/randrconfig.h  
 M  +8 -1      kcontrol/randr/randrconfigbase.ui  
 M  +31 -2     kcontrol/randr/randrdisplay.cpp  
 M  +3 -1      kcontrol/randr/randrdisplay.h  
 M  +31 -0     kcontrol/randr/randroutput.cpp  
 M  +1 -0      kcontrol/randr/randroutput.h  
 M  +11 -0     kcontrol/randr/randrscreen.cpp  
 M  +1 -0      kcontrol/randr/randrscreen.h  
 M  +7 -48     startkde.cmake  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1170315
Comment 16 François Rey 2010-10-06 00:37:00 UTC
Just upgraded my arch linux to 4.5.2, but krandrtray is still not restoring screen resolutions.
Did this fix go into 4.5.2?
Is there anything special to do to make sure it restores screen resolutions?
Comment 17 Robert Crawford 2010-10-07 19:05:31 UTC
Apparently, the 1170315 fix is sadly NOT included for kde-4.5.2, in Gentoo or any other distro I've used.  I'm extremely disappointed, as this has gone on for so long it's becoming a kde deal-breaker for me.  As far as I'm concerned there's no excuse.  No use repeating it all here, so anyone interested see my posts (wrc1944) on the Gentoo forum praising this fix in kde-live (svn), and my rant about this long standing problem not being addressed in any 4.x.x release for almost 2 years. http://forums.gentoo.org/viewtopic-t-844013-start-0.html
Comment 18 Mathias Dietrich 2010-10-09 10:40:12 UTC
Unfortunately it is not fixed here too, in KDE 4.5.2 (with Kubuntu).
Comment 19 Robert Crawford 2010-10-09 18:19:53 UTC
1170315 does work great on my kde-live (4.6 svn) install on the Gentoo kde overlay.  I was considering trying to untar.bz2 the released 4.5.2 /workspace/kcontrol/krandr source file and copy over all the relevant 1170315 files from my kde-live source files, replacing the 4.5.2 versions.  However, it probably isn't as simple as that, and might cause a bunch of other problems with related 4.5.2 packages. I read that it won't be in until kde-4.6.x (maybe something to do with qt-4.7?). I am successfully using qt-4.7 on my kde-live install.  But even if 1170315 files worked on 4.5.2, you'd have to do it on 4.5.3, and 4.5.4, until 4.6.0 was actually released (next March?).  Not sure it's worth the trouble, but I sure can't see running kde-live 4.6 on all my kde installs, either Gentoo or other distros.
Comment 20 Christoph Feck 2010-10-13 14:20:30 UTC
*** Bug 253792 has been marked as a duplicate of this bug. ***
Comment 21 Stephan Olbrich 2011-02-11 10:33:49 UTC
This is not working for me as line 9 in krandrstartup is wrong:

$ cat test
#!/bin/sh
krandrrc_display_startupcommands="xrandr --output "VGA1" --pos 0x0 --mode 1680x1050 --refresh 59.9543\nxrandr --noprimary"
echo -e "$krandrrc_display_startupcommands" | \
while read command; do
   echo "$command"
done

$ ./test
-e xrandr --output VGA1 --pos 0x0 --mode 1680x1050 --refresh 59.9543
xrandr --noprimary

As you can see, the "-e" is included in $command which then obviously fails.
If I remove the "-e" it sort of works, but I still have the wrong resolution in kdm
Comment 22 Philippe Cloutier 2011-06-13 10:53:31 UTC
Stefan, that issue was reported in #275360.
Comment 23 MR 2011-07-11 09:53:41 UTC
Issue is still not fixed. I tried it here with openSUSE 11.4, Tumbleweed repository and KDE 4.6.5.

Changing the resolution to 1680x1050, logging out and in again brings back the native resolution of 1920x1080.

All changes have been made with the KDE system controls.