Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gdk-CRITICAL **: gdk_screen_get_root_window: assertion 'GDK_IS_SCREEN (screen)' failed #922

Closed
ediowar opened this issue May 15, 2020 · 11 comments
Labels
bug priority:high Fix sooner than later

Comments

@ediowar
Copy link

ediowar commented May 15, 2020

openSUSE Tumbleweed 20200511 KDE
Desktop Sessions: Plasma, Plasma (Wayland), Plasma (Full Wayland), Openbox
Running from source code, Git revision f93647a
BleachBit version 4.0.1
GTK version 3.24.20

dzmitry@dhcppc0:~/Downloads/bleachbit-master> sudo python3 bleachbit.py
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused

(bleachbit.py:10332): Gdk-CRITICAL **: 17:00:29.248: gdk_screen_get_root_window: assertion 'GDK_IS_SCREEN (screen)' failed
Unable to init server: Could not connect: Connection refused

(bleachbit.py:10332): Gtk-WARNING **: 17:00:29.255: cannot open display: 

Same with https://download.opensuse.org/repositories/home:/andrew_z/openSUSE_Tumbleweed/noarch/bleachbit-4.0.0-1.11.noarch.rpm

dzmitry@dhcppc0:~> sudo zypper dup
Loading repository data...
Reading installed packages...
Warning: You are about to do a distribution upgrade with all enabled repositories. Make sure these repositories are compatible before you continue. See 'man zypper' for more information about this command.
Computing distribution upgrade...

Problem: problem with installed package bleachbit-4.0.0-1.11.noarch
 Solution 1: install bleachbit-4.0.0-1.1.noarch (with vendor change)
  obs://build.opensuse.org/home:andrew_z  -->  openSUSE
 Solution 2: keep obsolete bleachbit-4.0.0-1.11.noarch

Choose from above solutions by number or cancel [1/2/c/d/?] (c): 2
Resolving dependencies...
Computing distribution upgrade...

The following item is locked and will not be changed by any action:
 Installed:
  bleachbit

Nothing to do.
@ediowar ediowar changed the title Gtk-WARNING **: 17:00:29.255: cannot open display: Gtk-WARNING **: cannot open display: May 15, 2020
@ediowar ediowar changed the title Gtk-WARNING **: cannot open display: Gdk-CRITICAL **: gdk_screen_get_root_window: assertion 'GDK_IS_SCREEN (screen)' failed May 15, 2020
@fkru
Copy link

fkru commented May 16, 2020

I confirm your observation with openSUSE TW20200514 and KDE. Seems to be a dup of #919.

@topas-rec
Copy link

Have this on Debian Buster (10.4) using Wayland and Gnome.
Do NOT have this when I switch to Gnome on Xorg.

@mkhon mkhon added the bug label Jun 23, 2020
@az0 az0 added this to the 4.4 milestone Aug 14, 2020
@az0 az0 added the priority:high Fix sooner than later label Nov 6, 2020
@abitrolly
Copy link
Contributor

abitrolly commented Nov 7, 2020

@ediowar can you paste the output of sudo python3 bleachbit.py --sysinfo here for your openSUSE? I guess you get the same error when running gedit, meld or any other GTK app with sudo, is that right?

I see that BleachBit is quite popular on openSUSE forums. There are hints to use xdg-su run desktop apps with sudo there. Would be nice to get confirmation that it helps.

There is also a thread about new package which suggests that some fixes were landed in openSUSE packages including the Gdk-CRITICAL bug mentioned.

Let's also see if the bug could be repeated with newer official package.

@abitrolly
Copy link
Contributor

@topas-rec may I ask you to open a new issue with the output of bleachbit --sysinfo for Debian Buster and Wayland?

@ediowar
Copy link
Author

ediowar commented Nov 7, 2020

@ediowar can you paste the output of sudo python3 bleachbit.py --sysinfo here for your openSUSE? I guess you get the same error when running gedit, meld or any other GTK app with sudo, is that right?

dzmitry@localhost:~/Downloads/bleachbit/bleachbit-master> sudo python3 bleachbit.py --sysinfo
[sudo] password for root: 
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused

(bleachbit.py:8032): Gdk-CRITICAL **: 01:46:23.967: gdk_screen_get_root_window: assertion 'GDK_IS_SCREEN (screen)' failed
BleachBit version 4.1.0
GTK version 3.24.22
SQLite version 3.33.0
local_cleaners_dir = None
locale_dir = /usr/share/locale/
options_dir = /root/.config/bleachbit
personal_cleaners_dir = /root/.config/bleachbit/cleaners
system_cleaners_dir = /home/dzmitry/Downloads/bleachbit/bleachbit-master/cleaners
locale.getdefaultlocale = ('en_US', 'UTF-8')
os.getenv('DESKTOP_SESSION') = None
os.getenv('LOGNAME') = root
os.getenv('USER') = root
os.getenv('SUDO_UID') = 1000
os.path.expanduser('~') = /root
platform.linux_distribution() = ('', '', '')
platform.platform = Linux-5.9.1-1-default-x86_64-with-glibc2.2.5
platform.version = #1 SMP Mon Oct 26 07:02:23 UTC 2020 (435e92d)
sys.argv = ['bleachbit.py', '--sysinfo']
sys.executable = /usr/bin/python3
sys.version = 3.8.5 (default, Jul 20 2020, 17:41:41) [GCC]
__file__ = /home/dzmitry/Downloads/bleachbit/bleachbit-master/bleachbit/Diagnostic.py
dzmitry@localhost:~/Downloads> sudo gedit
Unable to init server: Could not connect: Connection refused

(gedit:28908): Gtk-WARNING **: 01:27:06.267: cannot open display: 

I see that BleachBit is quite popular on openSUSE forums. There are hints to use xdg-su run desktop apps with sudo there. Would be nice to get confirmation that it helps

I confirm it helps.

@abitrolly
Copy link
Contributor

abitrolly commented Nov 8, 2020

@ediowar thanks for the testing. I'd say the resolution of the problem is on the openSUSE side. It may be the policy that GUI tools should not be run with sudo, and those users who still want it, should be advanced enough to use xdg-su. The best way to confirm this is to ask at https://forums.opensuse.org/forumdisplay.php/669-Applications if packages like BleahBit and gedit deliberately do not support running GUI apps under sudo.

I guess openSUSE package needs setup with environment that is required by GTK when run with sudo. I can't say what is that environment - it may be different for X11 and for Wayland, but from forum threads it looks like there are knowledgeable people who can help with that.

I'd keep this issue open until you can get the reply there.

@ediowar
Copy link
Author

ediowar commented Nov 10, 2020

There is no issue in the Terminal - Super User Mode. Can I close issue?

@abitrolly
Copy link
Contributor

@ediowar yes, please. xdg-su is the solution for other users coming from openSUSE.

@ediowar
Copy link
Author

ediowar commented Nov 10, 2020

Why only xdg-su if Terminal - Super User Mode is installed by default during openSUSE Tumbleweed installation? Or is xdg-su just preferable?

@abitrolly
Copy link
Contributor

@ediowar I didn't know about that. Sound like a proper solution to me.

@ediowar ediowar closed this as completed Nov 10, 2020
@az0 az0 removed this from the 4.4 milestone Jan 3, 2021
@rei-vilo
Copy link

rei-vilo commented Jul 25, 2021

Using xhost +SI:localuser:root before launching sudo bleachbit solved the issue on my case.

  • BleachBit version 4.4.0
  • Debian 4.19.181-1 (2021-03-19)
  • Gnome 3.30.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug priority:high Fix sooner than later
Projects
None yet
Development

No branches or pull requests

7 participants