You are not logged in.

#1 2020-01-21 17:50:16

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

apps starting up on the wrong tty

I am running X (i3) and Wayland (sway) on separate ttys because, currently my workflow consists of some apps that don't play well with wayland. But I was also trying to see if eventually I can move over to wayland.

In any case, apps like galculator -- start up only in wayland -- whether I use the keybinding that I have defined or whether I pull up dmenu and then launch an app or if I use the command galculator to start it up from CLI.

I have this in my i3 config as well as my sway config:

bindsym $super+c exec galculator

However, if both i3 and sway are running, then galculator only spawns new windows in the sway environment even when initiated from the X environment, with no indication on the X environment? If I exit out of the Wayland/Sway environment, then galculator starts up correctly in the X environment.


Has anyone seen this and if so, is there a solution?


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#2 2020-01-21 20:36:57

seth
Member
Registered: 2012-09-03
Posts: 51,310

Re: apps starting up on the wrong tty

echo $GDK_BACKEND
GDK_BACKEND=x11 galculator

?

Online

#3 2020-01-23 04:41:16

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: apps starting up on the wrong tty

Wouldn't that mean that the app would then only start in X and not in wayland if I have that in my profile?

I guess I could change the command alias to explicitly set the gdk backend every time I start galculator, but I was wondering why galculator chooses to start only in the wayland environment by default.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#4 2020-01-23 08:17:51

seth
Member
Registered: 2012-09-03
Posts: 51,310

Re: apps starting up on the wrong tty

in my profile

The plan was to enforce the backend for a single instance of galculator and see what happens then.
Also to check whether the value is maybe exported somewhere atm.

It's not meant as a solution and certainly not to suggest to put that into /etc/profile or similar.
You might however indeed have to export that for the i3 session, in case GDK applies a "open wayland client || open x11 client" logic by default.

One more thing: are you running both displays on the same session bus?

echo $DBUS_SESSION_BUS_ADDRESS
loginctl session-status # on either display

Online

#5 2020-01-25 07:39:08

Brocellous
Member
Registered: 2017-11-27
Posts: 146

Re: apps starting up on the wrong tty

Yeah unfortunately concurrent X and Wayland sessions do not play nice right now.

I wrote a bit about this in response to a similar question on the subreddit a while ago here: https://www.reddit.com/r/archlinux/comm … t/fbyk6px/

I'll quote a bit of that reply here for completeness:

/u/Megame50 wrote:

When there is only one session type, X and Wayland sessions do not interfere with themselves because they have the internal concepts of the xdisplays/wayland-socket each communicated by their respective environment variables. But when both X and Wayland sessions are available, how is the application to know which server to contact? That is for the application to decide. Deciding a session type (along with internal concepts in each display server protocol) should uniquely identify which server to contact, but there is no universal way for applications to decide on a session type at this time.

Since the environment is one of the things inherited from parent to child when sway/i3 start a new application with exec, and since it's clear that the user probably has the intention of starting an application in the same desktop that exec'd it, many applications and toolkits have settled on using environment variables for deciding which session type to use. The de facto standard variable for this purpose is XDG_SESSION_TYPE, but not all parties agree on its usage[2] , and not all sessions set an appropriate value[3] .

You can check the links in that post for some more discussion on why gtk applications specifically behave the way they do.

Offline

#6 2020-01-25 22:19:50

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: apps starting up on the wrong tty

Thanks @Brocellous. That explains things. I wonder why I didn't find that when I was googling. Maybe my google-fu was weak that day.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

Board footer

Powered by FluxBB