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

GTK error "Argument 0 does not allow None as a value" in Linux #467

Closed
h5rdly opened this issue Oct 16, 2021 · 12 comments
Closed

GTK error "Argument 0 does not allow None as a value" in Linux #467

h5rdly opened this issue Oct 16, 2021 · 12 comments
Labels

Comments

@h5rdly
Copy link

h5rdly commented Oct 16, 2021

Safeeyes 2.1.3
OpenSUSE Tumbleweed

Running safeeyes from the command line, I get:

user@localhost:~> safeeyes
Traceback (most recent call last):
  File "/usr/bin/safeeyes", line 33, in <module>
    sys.exit(load_entry_point('safeeyes==2.1.3', 'console_scripts', 'safeeyes')())
  File "/usr/lib/python3.8/site-packages/safeeyes/__main__.py", line 147, in main
    safe_eyes = SafeEyes(system_locale, config)
  File "/usr/lib/python3.8/site-packages/safeeyes/safeeyes.py", line 84, in __init__
    self.break_screen = BreakScreen(
  File "/usr/lib/python3.8/site-packages/safeeyes/ui/break_screen.py", line 62, in __init__
    Gtk.StyleContext.add_provider_for_screen(Gdk.Screen.get_default(), css_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)
TypeError: Argument 0 does not allow None as a value

I'm trying to set up a Linux environment on a new computer, not having safeeyes gives me all the bad side effects of staring at the screen..

@h5rdly h5rdly added the bug label Oct 16, 2021
@archisman-panigrahi
Copy link
Collaborator

Is this still valid with latest version (2.2.1)? If not, I will close the issue in one week.

@h5rdly
Copy link
Author

h5rdly commented Jul 17, 2024

I installed it on my current Opensuse Tumbleweed today using sudo zypper install safeeyes.

It shows in the KDE app menu, but nothing happens when you select it.

@deltragon
Copy link
Collaborator

Hmm, I assume you are on KDE Wayland? Are you using the "Plasma (Wayland)" or "Plasma (Wayland Full)" session? (Assuming that split still exists for Plasma 6).

@archisman-panigrahi
Copy link
Collaborator

Ensure that you have installed the latest version of safeeyes 2.2.1. Then run safeeyes on terminal and post the full error message.

@deltragon
Copy link
Collaborator

Tumbleweed does have 2.2.1 in its repos: https://software.opensuse.org/package/safeeyes?search_term=safeeyes
I think this might have to do with the "Plasma (Wayland Full)" session, where they force applications to run without X11. I did run into an error with this in #561, and also have a fix for that in that PR.
I can pull that fix out into a separate PR, and submit it so it can be tested.

@archisman-panigrahi
Copy link
Collaborator

I can pull that fix out into a separate PR, and submit it so it can be tested.

Unless it involves too much work, and unless it breaks anything without the rest of the PR, please send a different PR for fix so that it can be tested. I have KDE 6.1 in Arch (I was using X.Org so far), and I can test it too.

@deltragon
Copy link
Collaborator

So, it turns out that was a different error - when running in a pure Wayland session (no XWayland) it throws an error here:
image
Which is a few lines above - so I would have kept that in the gtk4 PR.

However, it could have to do with this: https://stackoverflow.com/a/43650391/3067153 - according to that, gtk_init() must be called before any other call to Gtk.
Quoting the docs,

And if you are using GtkApplication, you don’t have to call any of the initialization functions either; the GtkApplication::startup handler does it for you.

However, we call BreakScreen.__init__ inside of SafeEyes.__init__, which happens before the do_startup handler.
(The switch to Gtk.Application in #560 didn't change anything there - there, BreakScreen.__init__ was called before Gtk.main().)

I've submitted #610 that changes the order we handle things.

@deltragon
Copy link
Collaborator

Actually, it turns out, if I do zypper install safeeyes in OpenSuse Tumbleweed, i get this error:
image
With zypper install python3-packaging, it works.
So this might just be a simple packaging issue.
I don't have the time to go and report it now, but I will in the next few days (unless someone beats me to it).

@archisman-panigrahi
Copy link
Collaborator

@deltragon I added a comment to my existing bug report https://bugzilla.opensuse.org/show_bug.cgi?id=1227743 I don't know if I should have created a new bug report.

@h5rdly
Copy link
Author

h5rdly commented Jul 18, 2024

Actually, it turns out, if I do zypper install safeeyes in OpenSuse Tumbleweed, i get this error: image With zypper install python3-packaging, it works. So this might just be a simple packaging issue. I don't have the time to go and report it now, but I will in the next few days (unless someone beats me to it).

I ran pip3 install --break-system-packages packaging and it starts for me as well, thanks!

@archisman-panigrahi
Copy link
Collaborator

So, I guess the problem is fixed, and only python3-packaging needs to be added as a dependency.

In that case, is #610 necessary?

So, it turns out that was a different error - when running in a pure Wayland session (no XWayland) it throws an error here:

I think this is a different issue. @deltragon Can you create a new issue?

@deltragon
Copy link
Collaborator

@archisman-panigrahi The issue in the pure Wayland session already is tracked here: #367
I think #610 still makes sense to do, because the current situation does violate what the Gtk docs say you should do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants