-
Notifications
You must be signed in to change notification settings - Fork 213
Switch to Gtk.Application and make ulauncher
command "toggle" by default
#988
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
Conversation
…r command launch faster like ulauncher-toggle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm really liking it, and it didn't really require as much changes as you might have thought! Seems to work great for me (once I updated my workaround shortcut to point to the right place)
|
||
def do_command_line(self, *args, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this message signature just be def do_command_line(self, appcl):
or similar? Looks like according to doc that is all that will be passed in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I did originally, but then I get these linting errors locally (my pylint is way more recent than the docker image one though):
ulauncher/main.py:47:4: W0221: Number of parameters was 3 in 'Application.do_command_line' and is now 2 in overridden 'UlauncherApp.do_command_line' method (arguments-differ)
ulauncher/main.py:47:4: W0221: Variadics removed in overridden 'UlauncherApp.do_command_line' method (arguments-differ)
Same for do_activate()
.
…ow.get_application()
…nch command or hotkey)
Pushed some more fixes. I was surprised after doing some tests that the wmctrl workaround just wasn't needed any more at all. When I implemented it it wasn't working to set the focus without it, but now it is (and yes, I'm still on wayland). So we can remove it after all, and no need to create a new window each time fore that 🎊 Also removed the toggle behavior in favor of always showing. It never really made sense to me have the the hotkey hide the window if it's showing. At least I think it's better to have the behavior consistent, and the new behavior is much better. Might want to add wmctrl back as an optional dependency for #979 though (if we decide we want to pick up from that PR). I also considered other reasons to use wmctrl more. But in this PR it's not used, so it could be removed. |
Merging. We can always tweak the details later. |
can I somehow redo the toggle behavior like it was before? I just have issues with v5, and v6 is working fine, but not having ability to toggle normally is just annoying and I have to workaround that, and also there why launcher is not disappearing after I open application? It;'s just strange and weird for me, other launchers close by default... |
It's definitely not more "normal" than how we do it now, and it's not coming back. Just press Esc to close. It's standard for windows like this.
This was fixed and released two days ago: https://github.com/Ulauncher/Ulauncher/releases/tag/v6.0.0-beta10 If you have more feedback for this, please use https://github.com/Ulauncher/Ulauncher/discussions |
Alternative implementation of #987, using Gtk.Application for the main loop. This handles stuff we had to do manually before with dbus, so we can remove the
python-dbus
dependency.I also removed
gi.require_version('GLib', '2.0')
because I recently learned it's not neededAs a nice side effect, this seems to get rid of the race condition issue with ulaucher-toggle. Previously I ran into that a lot on Wayland, but now I removed the
sleep 0.03
bit completely and it works every time (still need wmctrl though).I kept things in the same file mostly because I wanted to keep the changes minimal. This PR is just the first part and there' s so much more this opens up for:
UlauncherApp
to it's own singleton moduleulauncher-toggle
)Checklist
./ul test
is passing (the CI server will check this if you don't)