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 765159 - [regression] nautilus-classic does not work
[regression] nautilus-classic does not work
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Desktop
unspecified
Other Linux
: Normal normal
: 3.22
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-04-16 22:32 UTC by Alberts Muktupāvels
Modified: 2016-04-23 04:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
desktop: add command line options for override gsettings (6.10 KB, patch)
2016-04-19 15:51 UTC, Carlos Soriano
none Details | Review
application: remove unneeded register-session (870 bytes, patch)
2016-04-22 09:46 UTC, Carlos Soriano
committed Details | Review
desktop-application: register with session manager (1001 bytes, patch)
2016-04-22 09:46 UTC, Carlos Soriano
committed Details | Review
desktop: add command line options for override gsettings (5.30 KB, patch)
2016-04-22 09:46 UTC, Carlos Soriano
committed Details | Review

Description Alberts Muktupāvels 2016-04-16 22:32:20 UTC
Nautilus has nautilus-autostart.desktop and nautilus-classic.desktop. First is supposed to start nautilus-desktop only if show-desktop-icons is set to true. Second should start nautilus-desktop always and this does not work.
Comment 1 Carlos Soriano 2016-04-18 13:10:00 UTC
with master?
Comment 2 Alberts Muktupāvels 2016-04-18 13:11:50 UTC
Yes.
Comment 3 Carlos Soriano 2016-04-18 21:49:29 UTC
How are yous testing btw? Since you need a gnome-session from jhbuild to autostart correctly those services.
Comment 4 Alberts Muktupāvels 2016-04-18 22:03:53 UTC
Just tried:
jhbuild buildone gnome-session - was up date.
jhbuild buildone nautilus - there was new commits - updated.

I have set up everything so I can select JHBuild sessions from login screen. Also I am building full GNOME - meta-gnome-core + meta-gnome-flashback.

Previously there was option --force-desktop to force desktop window no matter what show-desktop-icons settings was set to. That command line option was in nautilus-classic desktop file.

Now both desktop files (nautilus-classic & nautilus-autostart) has nautilus-desktop in Exec line.

nautilus-autostart of course works as expected - desktop is started if setting is enabled and closed when dissabled.

nautilus-classic should create desktop always - at least that is how it worked. Probably to fix this --force-desktop option must be restored in nautilus-desktop.
Comment 5 Carlos Soriano 2016-04-19 13:34:06 UTC
Hm strange.

So far it doesn't need any command line options, now the nautilus-desktop is a different binary that doesn't check any setting. If someone starts it, it runs, and that's it.

So it should be something different, let's see if I can set up the gnome-session from jhbuild and try it...
Comment 6 Alberts Muktupāvels 2016-04-19 13:46:42 UTC
Ok, lets forget about *.desktop for now...

When nautilus-desktop is started from command-line it does nothing if show-desktop-icons == false.

Desktop visibility is set based on gsettings key:
https://git.gnome.org/browse/nautilus/tree/nautilus-desktop/nautilus-desktop-application.c#n128

If setting is false - desktop window is destroyed / closed:
https://git.gnome.org/browse/nautilus/tree/nautilus-desktop/nautilus-desktop-application.c#n108

And now back to *.desktop files:
- nautilus-autostart works as expected because it should start / stop desktop window based on gsettings key.
- nautilus-classic does not work because it will be started only if setting is set to true. If it is false - it started and then closed.

So nautilus-desktop does need command-line option to force desktop. And if it is forced then it should ignore settings. It worked that way...
Comment 7 Carlos Soriano 2016-04-19 15:51:32 UTC
Created attachment 326337 [details] [review]
desktop: add command line options for override gsettings

Sometimes we want to override the show-desktop-icons gsettings, as we
were doing before splitting the desktop.

Wrongly I assumed that since it's a different binary, once can simply
run it or not, but of course that was an oversimplification, and forgot
all what I needed to do in order to support all the cases for the
desktop handling.

This patch adds the missing command line options we had, --force-desktop
and --no-desktop, and also adds the --force-desktop to the classic
desktop file, since we needed to enable the classic mode.
Comment 8 Carlos Soriano 2016-04-19 15:53:14 UTC
Your thoughts are right (also for the --no-desktop command line option, which I completely forgot). Can you check this patch?
Comment 9 Alberts Muktupāvels 2016-04-19 16:23:41 UTC
--force-desktop did work, but I was logged out of my session and it seems related to nautilus-desktop window... Might be bug in gnome-session, but I got warning that nautilus-desktop failed to register with session manager. 

1. nautilus-desktop needs to register with session manager as it is started in DESKTOP phase. In nautilus_desktop_application_new add this:
"register-session", TRUE,

And remove it from nautilus_application_new as applications that is started in APPLICATION phase is not required to register with session manager.

This change was enough to get my session working as it should.

2. I think --force-desktop now can be simply --force as nautilus-desktop is only about desktop window. Does not make any sense to include -desktop in command-line option name.

3. Also I think that --no-desktop is not needed. Was not that option used to just make sure that nautilus does not crate desktop window? To allow start nautilus instance without creating desktop window? Previously when nautilus was stared and show-desktop-icons was enabled it would create desktop window and now it is no longer true as separate application must be used to get desktop window.
Comment 10 Carlos Soriano 2016-04-19 21:06:48 UTC
(In reply to Alberts Muktupāvels from comment #9)
> --force-desktop did work, but I was logged out of my session and it seems
> related to nautilus-desktop window... Might be bug in gnome-session, but I
> got warning that nautilus-desktop failed to register with session manager. 
> 
> 1. nautilus-desktop needs to register with session manager as it is started
> in DESKTOP phase. In nautilus_desktop_application_new add this:
> "register-session", TRUE,
> 
> And remove it from nautilus_application_new as applications that is started
> in APPLICATION phase is not required to register with session manager.
> 
> This change was enough to get my session working as it should.

I see, thanks for the info!

I saw that error before, but after restarting everything was fine, so I though it was because some nasty state of the system (I saw this error previous this patch several times when running from jhbuild).

> 
> 2. I think --force-desktop now can be simply --force as nautilus-desktop is
> only about desktop window. Does not make any sense to include -desktop in
> command-line option name.

I don't want to change the names, as it might be used by other people scripts or whatnot. So I was thinking either remove them (as I was planning) or let them like before.

> 
> 3. Also I think that --no-desktop is not needed. Was not that option used to
> just make sure that nautilus does not crate desktop window? To allow start
> nautilus instance without creating desktop window? Previously when nautilus
> was stared and show-desktop-icons was enabled it would create desktop window
> and now it is no longer true as separate application must be used to get
> desktop window.

Not actually, this one is used to prevent the nautilus desktop to "fight" with a different desktop manager like dolphin or whatnot. It's used by KDE or some users. I actually removed this command line option previously as I though like you, and someone from KDE reported a bug.
Comment 11 Alberts Muktupāvels 2016-04-19 21:27:35 UTC
(In reply to Carlos Soriano from comment #10)
> > 2. I think --force-desktop now can be simply --force as nautilus-desktop is
> > only about desktop window. Does not make any sense to include -desktop in
> > command-line option name.
> 
> I don't want to change the names, as it might be used by other people
> scripts or whatnot. So I was thinking either remove them (as I was planning)
> or let them like before.

Whatever people use it is 'nautilus --something' and it already requires updating, no? So if name is changed, then this is best time. :) nautilus-desktop --force sounds better then nautilus-desktop --force-desktop.

> > 3. Also I think that --no-desktop is not needed. Was not that option used to
> > just make sure that nautilus does not crate desktop window? To allow start
> > nautilus instance without creating desktop window? Previously when nautilus
> > was stared and show-desktop-icons was enabled it would create desktop window
> > and now it is no longer true as separate application must be used to get
> > desktop window.
> 
> Not actually, this one is used to prevent the nautilus desktop to "fight"
> with a different desktop manager like dolphin or whatnot. It's used by KDE
> or some users. I actually removed this command line option previously as I
> though like you, and someone from KDE reported a bug.

Well if we speak about KDE then I see that it could have been problem when desktop window was part of nautilus. When someone tried to start nautilus and that setting was enabled than nautilus would try to create desktop windows - so in this case that option was needed to prevent this.

But now starting nautilus desktop window will not be created - so option is no longer needed.

For KDE desktop window could be only started by autostart file, but it has OnlyShowIn=GNOME;Unity; - so it will be never started.

If KDE user used 'nautilus --no-desktop' he can use simply 'nautilus'.

--

Then thinking even more... What will happen if I start 'nautilus-desktop --no-desktop'? Simply it will start and exit. After that if someone will enable show-desktop-icons then it will be auto-started by nautilus-autostart.

To get something from that option you need to keep nautilus-desktop running if that option was passed...
Comment 12 Carlos Soriano 2016-04-22 09:46:15 UTC
Created attachment 326538 [details] [review]
application: remove unneeded register-session

This is only needed for the desktop since it gets started in the
DESKTOP phase.
Comment 13 Carlos Soriano 2016-04-22 09:46:20 UTC
Created attachment 326539 [details] [review]
desktop-application: register with session manager

This is needed to make the desktop work, since this is started
in the DESKTOP phase of the session.
Comment 14 Carlos Soriano 2016-04-22 09:46:25 UTC
Created attachment 326540 [details] [review]
desktop: add command line options for override gsettings

Sometimes we want to override the show-desktop-icons gsettings, as we
were doing before splitting the desktop.

Wrongly I assumed that since it's a different binary, once can simply
run it or not, but of course that was an oversimplification, and forgot
all what I needed to do in order to support all the cases for the
desktop handling.

This patch adds the missing command line options we had, --force-desktop
and --no-desktop, and also adds the --force-desktop to the classic
desktop file, since we needed to enable the classic mode.
Comment 15 Carlos Soriano 2016-04-22 09:49:39 UTC
> Whatever people use it is 'nautilus --something' and it already requires
> updating, no? So if name is changed, then this is best time. :)
> nautilus-desktop --force sounds better then nautilus-desktop --force-desktop.
> 

right...

> Well if we speak about KDE then I see that it could have been problem when
> desktop window was part of nautilus. When someone tried to start nautilus
> and that setting was enabled than nautilus would try to create desktop
> windows - so in this case that option was needed to prevent this.
> 
> But now starting nautilus desktop window will not be created - so option is
> no longer needed.
> 
> For KDE desktop window could be only started by autostart file, but it has
> OnlyShowIn=GNOME;Unity; - so it will be never started.
> 
> If KDE user used 'nautilus --no-desktop' he can use simply 'nautilus'.
> 

you are right. fwiw this was the bug report https://bugzilla.gnome.org/show_bug.cgi?id=750528

----

Thanks a lot for reviewing this! (I would love to have these kind of reviews for more changes)
Comment 16 Alberts Muktupāvels 2016-04-22 12:21:24 UTC
Just applied all patches and it seems to work as I am expecting it to work. Thanks! :)

About last patch - most likely I would also rename 'force_enable_desktop' to just 'force', bet that is only my personal opinion.

--

Unrelated question - would you consider accepting patch/patches that brings back desktop drawing (under command-line switch '--background' or something like that)? Right now I am interested in short answer - 'yes' or 'no, not going to happen'.
Comment 17 Carlos Soriano 2016-04-22 12:28:27 UTC
(In reply to Alberts Muktupāvels from comment #16)
> Just applied all patches and it seems to work as I am expecting it to work.
> Thanks! :)
> 
> About last patch - most likely I would also rename 'force_enable_desktop' to
> just 'force', bet that is only my personal opinion.
> 

right, sounds like a good idea. Thanks!

> --
> 
> Unrelated question - would you consider accepting patch/patches that brings
> back desktop drawing (under command-line switch '--background' or something
> like that)? Right now I am interested in short answer - 'yes' or 'no, not
> going to happen'.

Sorry, I don't know what's that.
Comment 18 Carlos Soriano 2016-04-22 12:42:14 UTC
(adding to previous comment) So feel free to explain to me here or reach me on IRC. Now that the desktop is split I'm open, as long as they are a need and are not overcomplicated or a burden to maintain them.
Comment 19 Alberts Muktupāvels 2016-04-22 13:00:35 UTC
Nautilus used to draw desktop background, but that was removed in 3.7.91. Now nautilus have just transparent background/window.

This becomes problem when someone uses nautilus desktop window without compositing manager - it will be black instead of transparent. So it would be nice if nautilus-desktop could draw background, but only if enabled with some command-line switch.

This will be never needed in GNOME Shell or GNOME Classic - that is why I ask if you would consider accepting this. Will open new bug (when I have more free time) if your answer is not big NO.
Comment 20 Carlos Soriano 2016-04-22 13:06:23 UTC
What are the use cases? Why a compositor won't have compositing? Are this for old compositors or something? I think I'm just missing history context (and also knowledge).

Cosimo, any thoughts (short answer from now) on this?
Comment 21 Carlos Soriano 2016-04-22 13:56:20 UTC
Attachment 326538 [details] pushed as 2e4531b - application: remove unneeded register-session
Attachment 326539 [details] pushed as 9c17d88 - desktop-application: register with session manager
Attachment 326540 [details] pushed as a93e1a5 - desktop: add command line options for override gsettings
Comment 22 Cosimo Cecchi 2016-04-23 04:52:55 UTC
(In reply to Alberts Muktupāvels from comment #16)
> Unrelated question - would you consider accepting patch/patches that brings
> back desktop drawing (under command-line switch '--background' or something
> like that)? Right now I am interested in short answer - 'yes' or 'no, not
> going to happen'.

Short answer: no, not going to happen :-)

Longer answer: it's up to the GNOME desktop shell to render the background. If you are not running GNOME shell (e.g. the old fallback mode scenario), it would be the responsibility of gnome-settings-daemon's old background plugin to render it. If you also are not running gnome-settings-daemon, then you most likely are also not using gnome-control-center to set the desktop background (e.g. you use another DE), so there's no point in having nautilus read those settings to draw the background.