Skip to content

Commit

Permalink
Merge #1219 #1220
Browse files Browse the repository at this point in the history
1219: Only use `--disable-factory` with gnome-terminal when launched from the script. r=wmww a=AlanGriffiths

Only consider using `--disable-factory` with gnome-terminal when launched from the script.

This workaround is broken and not needed with miral-shell.

1220: Exec errors after forking need to be fatal r=RAOF a=AlanGriffiths

Exec errors after forking need to be fatal. (Fixes: #1218)

Co-authored-by: Alan Griffiths <[email protected]>
  • Loading branch information
bors[bot] and AlanGriffiths committed Feb 17, 2020
1 parent 6b3676c commit 063a537
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
12 changes: 6 additions & 6 deletions examples/miral-shell/miral-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ do
fi
done

# Fixup for weird gnome-terminal script on Ubuntu
if [ "${terminal}" == "gnome-terminal" ] && [ -e "/usr/bin/gnome-terminal.real" ]
then
terminal="gnome-terminal --disable-factory"
fi

if [ "$(lsb_release -c -s)" != "xenial" ]
then
qt_qpa=wayland
Expand Down Expand Up @@ -87,6 +81,12 @@ else
# miral-kiosk (and mir_demo_server) need a terminal launched
sh -c "MIR_SERVER_FILE=${socket} WAYLAND_DISPLAY=${wayland_display} ${hostsocket} ${bindir}${miral_server} ${enable_mirclient} $*"&

# Fixup for weird gnome-terminal script on Ubuntu
if [ "${terminal}" == "gnome-terminal" ] && [ -e "/usr/bin/gnome-terminal.real" ]
then
terminal="gnome-terminal --disable-factory"
fi

while [ ! -e "${XDG_RUNTIME_DIR}/${wayland_display}" ]; do echo "waiting for ${wayland_display}"; sleep 1 ;done

MIR_SOCKET=${socket} XDG_SESSION_TYPE=mir GDK_BACKEND=${gdk_backend} QT_QPA_PLATFORM=${qt_qpa} SDL_VIDEODRIVER=${sdl_videodriver} WAYLAND_DISPLAY=${wayland_display} NO_AT_BRIDGE=1 dbus-run-session -- ${terminal}
Expand Down
5 changes: 3 additions & 2 deletions src/miral/launch_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
*/

#include "launch_app.h"
#include <mir/log.h>

#include <unistd.h>

#include <stdexcept>
#include <cstring>


auto miral::launch_app(
std::vector<std::string> const& app,
mir::optional_value<std::string> const& wayland_display,
Expand Down Expand Up @@ -80,7 +80,8 @@ auto miral::launch_app(

execvp(exec_args[0], const_cast<char*const*>(exec_args.data()));

throw std::logic_error(std::string("Failed to execute client (") + exec_args[0] + ") error: " + strerror(errno));
mir::log_warning("Failed to execute client (\"%s\") error: %s", exec_args[0], strerror(errno));
exit(EXIT_FAILURE);
}

return pid;
Expand Down

0 comments on commit 063a537

Please sign in to comment.