Flatpak on wayland error "cannot open display: " - gtk

Whenever I try to run any Gtk+ Flatpak-ed app on wayland I get error such as:
(porto:3): Gtk-WARNING **: 00:55:13.780: cannot open display: :99.0
(setzer:2): Gtk-WARNING **: 01:01:41.868: cannot open display:
(org.gnome.Maps:2): Gtk-WARNING **: 01:02:18.136: cannot open display:

The problem seems to be that GDK_BACKEND variable is for some reason set to X11. Run following commands to check whether you have the same problem. I'm using gnome maps, but you can use whichever app you like.
flatpak run --command=sh org.gnome.Maps
echo $GDK_BACKEND:$WAYLAND_DISPLAY:$DISPLAY
Your output should be something like wayland-0,x11:wayland-0,:0.0. If it's not you should try experimenting with those variables
export GDK_BACKEND="wayland,x11"
export WAYLAND_DISPLAY="wayland-0"
export DISPLAY="wayland-0"
gnome-maps
Variable changes aren't permanent and are set only until container's shell is closed.

In my case it was a Java app under flatpak refusing to launch with said cannot open display error.
I fixed it by changing "--socket=fallback-x11" to be just "--socket=x11" in the flatpak manifest "finish-args" element.

Related

GLib-CRITICAL message on Linux

i have a rcp application that run on windows and linux.
First off all, in windows all is working fine, but when i compile the app on linux i have a lot of this message outputs.
GLib-CRITICAL **: 09:40:58.143: g_base64_encode_step: assertion 'in !=
NULL' failed
Gtk-WARNING **: 09:41:00.169: Negative content height -7 (allocation
1, extents 4x4) while allocating gadget (node button, owner
GtkToggleButton)
the linux version is:
Linux 3.10.0-957.10.1.el7.x86_64 GNU/Linux
In the other hand i have problems with the visualization of the controls, maybe is releated with the other issue.
I try to change the --launcher.GTK_version 2 in the .ini file but the controls problems remains.
login problem
enter image description here

Visual Studio Code won't launch on virtual machine

I installed VSC recently on my VM, but after typing code in the terminal nothing happened. Afterwards typed code --verbose and I saw the following warning:
(code:16063): Gtk-WARNING **: 18:08:46.490: cannot open display:
I have tried both of the following suggestions and neither has worked:
$ export DISPLAY='IP:0.0'
X11Forwarding yes

Error "Did you compile with -rdynamic?" seen only when application installed using RPM

I have a Vala application that loads modules just gmodule-2.0, when installed through usual make install means everything works correctly. When I build an RPM file and install (on Fedora 27) using dnf install my-app I get a whole bunch of errors like
(my-app:15094): Gtk-WARNING **: Could not find signal handler 'btn_thing_changed_cb'. Did you compile with -rdynamic?
(my-app:15094): Gtk-WARNING **: Could not find signal handler 'adj_thing_value_changed_cb'. Did you compile with -rdynamic?
Even after I add -rdynamic to the build and reinstall I continue to see these errors. Somewhere I read that I need to use gmodule-export-2.0, but the diff on it's pkgconfig and the one for gmodule-2.0 shows that they're exactly the same. Soooo...
The application is written in Vala and built using valac. Also, the UI classes that I have are Gtk template classes which may be an issue, but the fact that it works when I install from source makes me think that it isn't.
This is because the default RPM build will strip the symbols out of executables. You can disable stripping by changing your spec file to include:
%global __os_install_post %{nil}
or:
%global __strip /bin/true

ArchLinux LibreOfficeFresh unable to start

My System:
- ArchLinux
- LibreOfficeFresh 5.0.2-3
- Xorg116
- Catalyst Graphics Drivers
Problem:
LibreOfficeFresh is unable to start since I have installed catalyst, so since i switched
from MESA to catalyst.
Error Description:
[tekkkz#thinkpad ~]$ libreoffice
(soffice:1022): GLib-GObject-CRITICAL **: g_value_set_boxed: assertion 'G_VALUE_HOLDS_BOXED (value)' failed
(soffice:1022): GLib-GObject-WARNING **: gtype.c:4268: type id '0' is invalid
(soffice:1022): GLib-GObject-WARNING **: can't peek value table for type '<invalid>' which is not currently referenced
Application Error
Someone an idea how I can get my LibreOffice working again?
Thanks for help,
Tekkkz
this is the message that I saw when upgrading today
(18/24) upgrading libreoffice-fresh [##############################] 100%
> LibreOffice now uses highly experimental gtk3 vcl by default
> on some desktops. To use stable gtk2 vcl uncomment
> it in /etc/profile.d/libreoffice-fresh.{sh,csh}
So you can try that, uncomment the line export SAL_USE_VCLPLUGIN=gtk
and re-login, if you don't want to logout, you have to export the variable manually in a terminal and run libreoffice from that terminal inmediately after exporting the variable.
export SAL_USE_VCLPLUGIN=gtk
soffice
I do that, and it works right now
It seems to be a problem with GTK themes (and a recent change between GTK2/3). Try changing themes and see if it starts working again (it did for me).

"ERROR : No emulator images (avds) found" running ionic on osx 10.10

This is the full error message I got after running ionic emulate android
*running cordova emulate android
Running command: /Users/DeadLift/Documents/ionic/myApp/hooks/after_prepare/010_add_platform_class.js /Users/DeadLift/Documents/ionic/myApp
add to body class: platform-android
Running command: /Users/DeadLift/Documents/ionic/myApp/platforms/android/cordova/run --emulator
ANDROID_HOME=/usr/local/Cellar/android-sdk/24.1.2
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home
/Users/DeadLift/Documents/ionic/myApp/platforms/android/cordova /node_modules/q/q.js:126
throw e;
^
ERROR : No emulator images (avds) found.
1. Download desired System Image by running: /usr/local/Cellar/android-sdk/24.1.2/bin/android sdk
2. Create an AVD by running: /usr/local/Cellar/android-sdk/24.1.2/bin/android avd
HINT: For a faster emulator, use an Intel System Image and install the HAXM device driver
Error: /Users/DeadLift/Documents/ionic/myApp/platforms/android/cordova/run: Command failed with exit code 1
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23) *emphasized text*
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)*
I follow all the above by creating an avd and it give me the same message again.
Thanks.
Vikas's answer is pretty spot on, however (sometimes) just running android avd won't work, which is what I found out after hours of trying to get it working.
When ever I ran android avd in my terminal it would give me the following error:
zsh: command not found: android
This is because I needed to add the Android SDK paths for the platform-tools and tools to my zshrc file (you might be running bash or something else on your terminal).
Simple fix was to add these files to my zshrc PATH environment, You can do this too by using your favourite text editor and depending on what shell you're using.
This link: http://docs.phonegap.com/en/2.8.0/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android helped me out a hell of a lot getting this fixed.
So I used subl ~/.zshrc (because sublime is my text editor and i've setup symlinks)
I Found my exports PATH and changed it to represent the following:
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/dev/.rbenv/versions/2.2.3/bin/ruby:/Users/dev/Library/Android/sdk/platform-tools:/Users/dev/Library/Android/sdk/tools:$PATH"
I then saved the file, closed down sublime and ran source ~/.zshrc in my terminal window, and now I can run android avd and it now opens the Android Virtual Device Manager with no problems.
A reminder your shell might be different to mine (i.e. not running with zsh)and your exports PATH might look different as well, but it's pretty easy to figure out, and the link above will also help if you get stuck.
Actually it is not able to find AVD (Android virtual device). You have to create one.
Type "android avd" from Command Promt to use the graphical manager to setup an emulator image to work with for running your app on. The graphical tool is fairly straight forward to use.