Closed fiete201 closed 1 year ago
Thanks for letting me know.
Given that the docs say "Note that calling any GTK function or instantiating any GTK type after this function returns False results in undefined behavior", it'd be better to do something like this just before the app =
line:
# Work around a "the Gtk.Application ::startup handler does it for you" bug
if not Gtk.init_check():
raise XInitError("Gtk failed to connect to the X server. Cannot start.")
(Just before the app =
line so the "failed to connect to X11" error messages I was able to be more specific about have a chance first.)
At that point it is too late since we need the Gtk init before we instantiate WindowManager since the error itself is thrown there.
Sorry if I use some wrong naming I'm new to python programming to be honest and just tried to get it working with some googling around :-D
At that point it is too late since we need the Gtk init before we instantiate WindowManager since the error itself is thrown there.
That's fine. I'd just like to have it...
XDisplay
since that's the one with the detailed error message and the narrow scope of what could go wrong.Gtk.init_check()
returns False
and raise an XInitError
so it won't try to make calls into GTK after a failure.Sorry if I use some wrong naming I'm new to python programming to be honest and just tried to get it working with some googling around :-D
No problem. Jargon doesn't have to be perfect as long as you're making a good-faith effort.
Hope that it is fine now :-)
*chuckle* Yeah, that looks good.
I'm at the end of my day now, but I'll try to get it tested and merged tomorrow.
(And fix that gtkexcepthook.py
MyPy failure on Travis while I'm at it.)
OK, works fine here.
I realized that I forgot to actually unit-test having an invalid DISPLAY
environment variable value and the error handling doesn't work as expected, but that's not a problem with your contribution... just something I need to fix when I have time to work on QuickTile again.
Also, I realized that there's something I forgot to ask. Could you please add yourself to docs/authors/index.rst
and then run docs/update_authors.sh
to regenerate the AUTHORS
file in the root of the repo?
(Looks like I forgot to mention that in CONTRIBUTING.rst
since it's only mentioned in the developer's guide at docs/developing.rst
.)
Given how it seems kind of unfair to keep going back and forth like this over a little hobby project, I could pull your branch, correct it myself, and then merge it manually if you'd prefer that, but there are three issues with your authors text:
3.24.20-0ubuntu1
, and the code you're patching was developed on Kubuntu 16.04, on GTK 3.18.9-1ubuntu3
.<code>
styling for mentions of modules and other language constructs.If you have Sphinx set up so you can run make html
in the docs
directly and check that my memory of those finicky cross-reference links is correct, this would probably be best:
`Fritz Reichwald`_
Added :func:`Gtk.init_check` to :mod:`quicktile.__main__` to work around a
bug in some builds of GTK.
If not, I'll accept ordinary code literals.
`Fritz Reichwald`_
Added ``Gtk.init_check`` to ``__main__.py`` to work around a bug in some
builds of GTK.
Thanks for your suggestion! I tried to incorporate that but the first suggestion generated the following:
/home/fiete/freichw/proj/quicktile/docs/authors/index.rst:80: WARNING: py:mod reference target not found:
quicktile.__main__
So I now pushed the second version :-)
Please tell me if I missed something else ;-)
I tried to incorporate that but the first suggestion generated the following:
Yeah. That's the "check that my memory of those finicky cross-reference links is correct" part. I know there exists a way to make that work, but I have to dig out my Sphinx cross-reference index inspector to figure out what it wants if I spend more than a day or two away from it.
Please tell me if I missed something else ;-)
Today isn't a good day, but I'll try to give it one more look-over within the next couple of days.
Sorry for not getting back to you. I'm normally nocturnal and they've been doing road work for the last few days, so I've been too tired to work on this. I'll get back to this as soon as I can think again.
Sorry for going silent. I hadn't realized that COVID's effects on society had me on a downward trajectory and pretty much everything I was doing in the sphere of hobby programming fell apart.
Just faced an issue on openSUSE Leap 15.2 where quicktile told me that it can't connect to X.
After I did this change it worked. Seems that with the versions on my openSUSE tumbleweed work without the explicit init. (The change does no harm on my tumbleweed machine so it may work for everyone?)
Hope that this might help somehow.
Cheers fiete