Bug 47920 - [bug] Apps that default to X backend can't be launched from weston launcher
Summary: [bug] Apps that default to X backend can't be launched from weston launcher
Status: RESOLVED FIXED
Alias: None
Product: Wayland
Classification: Unclassified
Component: weston (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Wayland bug list
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-26 11:54 UTC by Darxus
Modified: 2012-07-24 07:34 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Darxus 2012-03-26 11:54:35 UTC
There is no way to get environment variables to the client, like $QT_QPA_PLATFORM or $GDK_BACKEND - even if you set them in your default shell, then run weston from that shell, and verify those variables in weston-terminal within weston, apps run from the launcher still won't see them.  I think something like this might be what X uses ~/.xsessionrc for.

If you try to include a command line argument like "-platform wayland", the launcher assumes that's part of the file name.
Comment 1 Kristian Høgsberg 2012-07-20 18:58:08 UTC
Yeah, good point.  We could add

[environment]
GDK_BACKEND=wayland

to weston.ini.
Comment 2 Scott Moreau 2012-07-20 21:41:46 UTC
On Fri, Jul 20, 2012 at 7:58 PM, <bugzilla-daemon@freedesktop.org> wrote:

> https://bugs.freedesktop.org/show_bug.cgi?id=47920
>
> --- Comment #1 from Kristian Høgsberg <krh@bitplanet.net> 2012-07-20
> 18:58:08 PDT ---
> Yeah, good point.  We could add
>
> [environment]
> GDK_BACKEND=wayland
>
> to weston.ini.
>
> --
>
>
Perhaps you might still want to start with the X backend on some launchers
and wayland backend on others? Typically,
I guess if you want to explicitly set an env var that's not part of your
global environment, you'd run it from a terminal shell.
A user can use a quick wrapper script to do what they want and call that
from the launcher instead. Aside from that,
would it be feasible to have something like this? I'm not sure if it would
be sane or easy to parse something like this
but the idea is that you'd be able to set any number of arbitrary env vars
for each launcher (probably easier to just use a
wrapper script at this point).


[launcher]
icon=/path/to/icon.ext
path=/path/to/program
environment="ENV_VAR1=foo"
environment="ENV_VAR2=bar"
Comment 3 Kristian Høgsberg 2012-07-24 03:00:40 UTC
(In reply to comment #2)
> On Fri, Jul 20, 2012 at 7:58 PM, <bugzilla-daemon@freedesktop.org> wrote:
> 
> > https://bugs.freedesktop.org/show_bug.cgi?id=47920
> >
> > --- Comment #1 from Kristian Høgsberg <krh@bitplanet.net> 2012-07-20
> > 18:58:08 PDT ---
> > Yeah, good point.  We could add
> >
> > [environment]
> > GDK_BACKEND=wayland
> >
> > to weston.ini.
> >
> > --
> >
> >
> Perhaps you might still want to start with the X backend on some launchers
> and wayland backend on others? Typically,
> I guess if you want to explicitly set an env var that's not part of your
> global environment, you'd run it from a terminal shell.
> A user can use a quick wrapper script to do what they want and call that
> from the launcher instead. Aside from that,
> would it be feasible to have something like this? I'm not sure if it would
> be sane or easy to parse something like this
> but the idea is that you'd be able to set any number of arbitrary env vars
> for each launcher (probably easier to just use a
> wrapper script at this point).
> 
> 
> [launcher]
> icon=/path/to/icon.ext
> path=/path/to/program
> environment="ENV_VAR1=foo"
> environment="ENV_VAR2=bar"

Yeah, I think that would work.  Alternatively, we could just be a little better about parsing path=, so that you can specify arguments and environment varibles like this

  path=GDK_BACKEND=wayland gnome-terminal --full-screen

similar to what you'd do in a shell.

(hack hack hack)... which I just pushed to master:

commit d1936b9e2b352e93ace1b3609740ce4902b33a9e
Author: Kristian Høgsberg <krh@bitplanet.net>
Date:   Mon Jul 23 22:59:33 2012 -0400

    desktop-shell: Break command lines into env vars, executable and arguments
    
    We now support specifying environment variables and arguments in launchers
    by saying
    
      path=GDK_BACKEND=wayland gnome-terminal --full-screen
    
    for example.
Comment 4 Scott Moreau 2012-07-24 03:29:07 UTC
>
>
> Yeah, I think that would work.  Alternatively, we could just be a little
> better
> about parsing path=, so that you can specify arguments and environment
> varibles
> like this
>
>   path=GDK_BACKEND=wayland gnome-terminal --full-screen
>
> similar to what you'd do in a shell.
>
>
Yes, that seems better.
Comment 5 Scott Moreau 2012-07-24 07:34:51 UTC
Marking this as fixed.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.