Bug 1509822

Summary: GNOME Wayland cannot be launched due to OnlyShowIn in org.gnome.Shell.desktop
Product: Red Hat Enterprise Linux 7 Reporter: fujiwara <tfujiwar>
Component: gnome-sessionAssignee: Ray Strode [halfline] <rstrode>
Status: CLOSED DUPLICATE QA Contact: Desktop QE <desktop-qa-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.5CC: fmuellner, jkoten, mclasen, ofourdan, tpelka
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-11-13 20:58:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1482140    

Description fujiwara 2017-11-06 07:19:59 UTC
RHEL 7.5 gnome-session modifies DesktopNames in /usr/share/wayland-sessions/gnome-wayland.desktop in the spec file:

http://pkgs.devel.redhat.com/cgit/rpms/gnome-session/tree/gnome-session.spec?h=rhel-7.5#n142

sed -i -e 's/GNOME/GNOME on Wayland/g' $RPM_BUILD_ROOT%{_datadir}/wayland-sessions/gnome-wayland.desktop


And then gnome-shell is disabled to be launched by gnome-session-binary because OnlyShowIn is GNOME only in /usr/share/applications/org.gnome.Shell.desktop

#0  0x000000000041f064 in is_disabled (app=0xe540f0) at gsm-autostart-app.c:141
#1  0x000000000041e668 in gsm_app_peek_is_disabled (app=0xe540f0)
    at gsm-app.c:412
#2  0x0000000000430051 in _start_app (id=0xe50f30 "/org/gnome/SessionManager/App1", app=0xe540f0, manager=0xe40140) at gsm-manager.c:744
#3  0x00007f233822025f in g_hash_table_find (hash_table=0xe360c0 = {...}, predicate=0x42ffe7 <_start_app>, user_data=0xe40140) at ghash.c:1675
#4  0x000000000042cb16 in gsm_store_foreach (store=0xe460a0, func=0x42ffe7 <_start_app>, user_data=0xe40140) at gsm-store.c:116
#5  0x0000000000430192 in do_phase_startup (manager=0xe40140)
    at gsm-manager.c:784
#6  0x00000000004316d3 in start_phase (manager=0xe40140) at gsm-manager.c:1469
#7  0x000000000042fae9 in end_phase (manager=0xe40140) at gsm-manager.c:559
#8  0x00000000004301e2 in do_phase_startup (manager=0xe40140)
    at gsm-manager.c:795
#9  0x00000000004316d3 in start_phase (manager=0xe40140) at gsm-manager.c:1469
#10 0x000000000042fae9 in end_phase (manager=0xe40140) at gsm-manager.c:559
#11 0x00000000004301e2 in do_phase_startup (manager=0xe40140)
    at gsm-manager.c:795
#12 0x00000000004316d3 in start_phase (manager=0xe40140) at gsm-manager.c:1469
#13 0x0000000000431a02 in gsm_manager_start (manager=0xe40140)
    at gsm-manager.c:1548
#14 0x000000000042beaa in on_name_acquired (connection=0xe2c0c0, name=0xe289d0 "
org.gnome.SessionManager", data=0x0) at main.c:131
#15 0x00007f233885e2b1 in actually_do_call (client=0xe3baa0, connection=0xe2c0c0, call_type=CALL_TYPE_NAME_ACQUIRED) at gdbusnameowning.c:154
#16 0x00007f233885e478 in do_call (client=0xe3baa0, call_type=CALL_TYPE_NAME_ACQUIRED) at gdbusnameowning.c:215
#17 0x00007f233885e4dd in call_acquired_handler (client=0xe3baa0)
    at gdbusnameowning.c:229
#18 0x00007f233885e7b4 in request_name_cb (source_object=0xe2c0c0, res=0xe999e0, user_data=0xe3baa0) at gdbusnameowning.c:334
#19 0x00007f233880baba in g_task_return_now (task=0xe999e0) at gtask.c:1145
#20 0x00007f233880bbbd in g_task_return (task=0xe999e0, type=G_TASK_RETURN_SUCCESS) at gtask.c:1203
#21 0x00007f233880c618 in g_task_return_pointer (task=0xe999e0, result=0xe38730, result_destroy=0x4099d0 <g_variant_unref@plt>) at gtask.c:1601
#22 0x00007f23388536bc in g_dbus_connection_call_done (source=0xe2c0c0, result=0xe99ab0, user_data=0xe999e0) at gdbusconnection.c:5722
#23 0x00007f233880baba in g_task_return_now (task=0xe99ab0) at gtask.c:1145
#24 0x00007f233880bb02 in complete_in_idle_cb (task=0xe99ab0) at gtask.c:1159
#25 0x00007f233823624a in g_idle_dispatch (source=0x7f2318008c50, callback=0x7f233880baea <complete_in_idle_cb>, user_data=0xe99ab0) at gmain.c:5502
#26 0x00007f233823362a in g_main_dispatch (context=0xe2bb00) at gmain.c:3146
#27 0x00007f23382345de in g_main_context_dispatch (context=0xe2bb00)
    at gmain.c:3811
#28 0x00007f23382347d4 in g_main_context_iterate (context=0xe2bb00, block=1, dispatch=1, self=0xe21300) at gmain.c:3884
#29 0x00007f2338234c17 in g_main_loop_run (loop=0xe34500) at gmain.c:4080
#30 0x000000000042bd72 in gsm_main () at main.c:73
#31 0x000000000042c81b in main (argc=1, argv=0x7ffd627fc698) at main.c:442


Breakpoint 5, is_disabled (app=0xe540f0) at gsm-autostart-app.c:120
139	        /* Check OnlyShowIn/NotShowIn/TryExec */
140	        if (!g_desktop_app_info_get_show_in (priv->app_info, NULL)) {
141	                g_debug ("app %s is not for the current desktop",
142	                         gsm_app_peek_id (app));
143	                return TRUE;
144	        }

$8 = {const char *(GAppInfo *)} 0x7f2338893ad1 <g_desktop_app_info_get_name>
(gdb) print g_desktop_app_info_get_name(priv->app_info)
$9 = 0xe50ea0 "GNOME Shell"
(gdb) print g_desktop_app_info_get_show_in (priv->app_info, 0)
$10 = 0


After I modified /usr/share/applications/org.gnome.Shell.desktop, gnome-shell is succeeded to be launched.

--- /usr/share/applications/org.gnome.Shell.desktop.orig	
+++ /usr/share/applications/org.gnome.Shell.desktop	
@@ -162,7 +162,7 @@ X-GNOME-Bugzilla-Product=gnome-shell
 X-GNOME-Bugzilla-Component=general
 X-GNOME-Bugzilla-Version=3.25.4
 Categories=GNOME;GTK;Core;
-OnlyShowIn=GNOME;
+OnlyShowIn=GNOME;GNOME on Wayland;
 NoDisplay=true
 X-GNOME-Autostart-Phase=DisplayServer
 X-GNOME-Provides=panel;windowmanager;

Comment 3 Olivier Fourdan 2017-11-07 10:04:18 UTC
No, I don't think this is correct, the issue is that gnome-session changes DesktopNames to be "GNOME on Wayland" (using a wide scope sed in the spec file), that causes all desktop files to fail on GNOME on Wayland.

The DesktopNames should remain "GNOME" even on Wayland.

Try changing /usr/share/wayland-sessions/gnome-wayland.desktop and replace "DesktopNames=GNOME on Wayland" with "DesktopNames=GNOME", log out. log in and magically gsd deamons will start, gnome-control-center panels will show, etc.

Comment 4 fujiwara 2017-11-07 11:47:17 UTC
OK, I see.
Reverting gnome-wayland.desktop fixes this problem.

--- /usr/share/wayland-sessions/gnome-wayland.desktop.orig	
+++ /usr/share/wayland-sessions/gnome-wayland.desktop
@@ -180,4 +180,4 @@ Exec=gnome-session
 TryExec=gnome-session
 Icon=
 Type=Application
-DesktopNames=GNOME on Wayland
+DesktopNames=GNOME

Transferring to gnome-session.

Comment 5 Ray Strode [halfline] 2017-11-13 20:58:32 UTC

*** This bug has been marked as a duplicate of bug 1510391 ***