After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 572876 - [PATCH] gnome-settings-daemon does not load the saved RandR configuration
[PATCH] gnome-settings-daemon does not load the saved RandR configuration
Status: RESOLVED OBSOLETE
Product: gnome-settings-daemon
Classification: Core
Component: xrandr
2.25.x
Other All
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
: 578120 (view as bug list)
Depends on:
Blocks: randr-tracker
 
 
Reported: 2009-02-23 17:41 UTC by Alberto Milone
Modified: 2011-01-21 15:51 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26


Attachments
Patch which fixes the bug (552 bytes, patch)
2009-02-23 17:45 UTC, Alberto Milone
needs-work Details | Review

Description Alberto Milone 2009-02-23 17:41:57 UTC
Please describe the problem:
gnome-settings-daemon ignores ~/.config/monitors.xml therefore the saved screen settings are not applied.

Steps to reproduce:
1. Save a multi-screen configuration with the display capplet
2. Restart the settings daemon
3. 


Actual results:


Expected results:
it should load the saved settings

Does this happen every time?
yes

Other information:
Comment 1 Alberto Milone 2009-02-23 17:45:21 UTC
Created attachment 129350 [details] [review]
Patch which fixes the bug

The following patch solves the problem. Basically moving a "goto" solved the problem as the intended configuration file was never applied otherwise.
Comment 2 Jens Granseuer 2009-02-23 18:53:54 UTC
Well. I don't have a multi-mnitor setup so I can't test that but I do get my configuration applied on startup. Your patch also says "ignore all errors" which is a very bad thing to do and might easily lead to crashes with other setups/drivers.

If you could try to poke bit deeper at what causes your problem (e.g. what's in the GError when this happens) that might help pin it down.
Comment 3 Alberto Milone 2009-02-23 19:12:02 UTC
My patch simply says:

If there's an error in the backup file, no matter what kind of error, simply apply settings in the intended file instead of just freeing memory.

Currently, if I don't have a backup file, my intended file is ignored. This condition should be caught by G_FILE_ERROR_NOENT though.
Comment 4 Jens Granseuer 2009-02-23 19:27:33 UTC
Yes, however, you only should have that file around if something went wrong the last time you tried to change the resolution. What's the case where you happen to run into this?
Comment 5 Alberto Milone 2009-02-23 20:38:41 UTC
If I copy my monitors.xml to monitors.xml.backup, the settings in the backup are applied. If no backup file is available monitors.xml is ignored (as apply_intended_configuration is never called).
Comment 6 Jens Granseuer 2009-02-23 20:42:57 UTC
What error do you get back from gnome_rr_config_apply_from_filename, then. Apparently, it's not the expected G_FILE_ERROR_NOENT, then.
Comment 7 Alberto Milone 2009-02-23 21:56:00 UTC
if I do this inside the if-block which is supposed to catch G_FILE_ERROR_NOENT:

if (!g_error_matches (my_error, G_FILE_ERROR, G_FILE_ERROR_NOENT)) {
               if (!my_error) {
                    g_debug("my_error is NULL\n");
               }

                unlink (backup_filename);
                goto out;
}


I get exactly "my_error is NULL". I guess the GError is NULL, which explains why my_error->code is not G_FILE_ERROR_NOENT.
Comment 8 Jens Granseuer 2009-02-23 22:19:42 UTC
Interesting. I suspect you have found a bug in gnome-desktop.

Could you use gdb to step through what happens here:

        success = gnome_rr_config_apply_from_filename (manager->priv->rw_screen, backup_filename, &my_error);

and find out what function ultimately returns FALSE but doesn't set the error? Looking at the code, I don't see anything obviously suspicious.
Comment 9 Federico Mena Quintero 2009-02-25 18:35:16 UTC
Yes, as Jens says, please step through gnome_rr_config_apply_from_filename() and see what makes it return FALSE without setting an error.

The only case I know in the GnomeRR API where that could happen (return FALSE without setting the error) is in gnome_rr_screen_refresh(), but gnome_rr_config_apply_from_filename() already handles that case --- it means "I didn't refresh the screen because nothing has changed".
Comment 10 Federico Mena Quintero 2009-04-07 20:05:25 UTC
*** Bug 578120 has been marked as a duplicate of this bug. ***
Comment 11 Ohad 2009-05-09 15:59:34 UTC
hey all.

I am still experiencing that problem in ubuntu jaunty.
how can i solve it?
how do i apply the patch that is attached here?

thanks
Comment 12 EvilGnome 2009-11-20 18:40:45 UTC
(In reply to comment #11)
> hey all.
> 
> I am still experiencing that problem in ubuntu jaunty.
> how can i solve it?
> how do i apply the patch that is attached here?
> 
> thanks

I can't personally confirm that this works yet, but you should probably just

cp ~/.config/monitors.xml ~/.config/monitors.xml.backup

for now.

(source: Alberto Milone, Comment 5)
Comment 13 Gabriel Burt 2010-04-15 02:21:40 UTC
There is a related issue (though a different bug) in that 'Detect Monitors', `xrandr`, or just opening 'Configure Display Settings...' causes an auto-config of any new monitor setup, instead of loading the save config.  I've filed that as bug #615804.
Comment 14 Bastien Nocera 2010-11-10 19:04:08 UTC
Alberto, any chance you could check what error comes out of the apply_configuration_from_filename() call?
Comment 15 Federico Mena Quintero 2011-01-21 14:55:03 UTC
I'll mark this bug as obsolete for the following reason.

Since this bug was opened, the GnomeRR code in gnome-desktop got changed to return very detailed errors when a RANDR configuration can't be applied.

If you still have the problem, please get one of those detailed errors and reopen the bug with the error log:

1. touch ~/gsd-debug-randr
2. Restart your session; reproduce the problem
3. Get ~/gsd-debug-randr.log and attach it here.
Comment 16 Alberto Milone 2011-01-21 15:51:16 UTC
Bastien, Federico, sorry about my late reply. It's fine to close this bug report as I can't reproduce the problem any more.