-
Notifications
You must be signed in to change notification settings - Fork 165
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
tilda.c: wayland dbus visibility toggler #495
Conversation
This is related to #487 |
tested on ubuntu 23.10. This doesn't work. |
Hmm, that's from a year ago. I'll see if i have time next week to check it, but the project looks abandoned, so I'm not sure if it's worth to focus on that. |
Hello, thanks for this contribution. I merged a few other open pull requests and I will try to find some time in the next weeks to review this as well and get it merged. If you could double check and confirm if it works on 23.10 that would be great. I am still on Ubuntu 22.04. I will try and aim for a new release before February, so that we can get the next release into Ubuntu 24.04. |
Thanks for your replies on my comments. Somehow I don't see the changes on your branch. Can you double check if you correctly pushed your additional commits after you made the update and make sure they show up here in this pull request? |
@kkrolczyk I still don't see the updated code, any chance you could push it and post the link to the updated commits here? Then I will take another look and merge them. |
f9e1c30
to
69b6ca8
Compare
Sorry for the delay @lanoxx - I've updated the branch & tested on 23.10 with Wayland |
I have made the following additional changes to your commit:
Long story short, this allows calls like See commit: 9fbc5dc1cddc0c5c535e2c2542066c2d67f2776d. I will probably merge this tomorrow or Friday as I just finished it and want to read over it one more time to catch any typos. |
Hey, thanks, changes seem reasonable; I've tested them, they still work.
I've spotted a tiny typo
should be
but i guess this can be fixed together with some code style/formatting commit, if needed.
|
You are right, this is unnecessary, I reordered the initialization a little to make the D-Bus call before the lock is acquired and the config is opened. What do you think?
Yes, it would be better to make the keybinding optional so that it can be cleared when we are on Wayland. I had started to work on this a while a go but then did not merge it since there were still a few missing pieces. Basically, we want be able to clear the pull-down hotkey in the preferences, but then the tilda-keybinding validation needs to accept "NULL" as a valid value. However, I think we want to do this only when D-Bus is enabled and since we are not storing the Anyway, I cherry-picked my original commit that I had worked on and pushed it to our new branch. It needs more work, so I will probably not merge it right away, but you can take a look it you want.
Well, in this case you could just set the "Non-Focus Pull Up Behaviour" option to "Hide Terminal" or am I missing something?
Fixed, thanks for spotting this. If you think the reordering of the initialization steps that I mentioned above are fine, then I would merge that first, and we can follow-up with another change that makes the pull toggle optional. |
I cleaned up that commit from yesterday and added a solution that I think will work reasonable well. I also added a new desktop file, so that tilda can be started with D-Bus support directly from the application menu. |
Hey, I've just checked - seems desktop file breaks the build on 23.10:
i guess small change in index 9d5c57b..b0b41eb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -47,11 +47,11 @@ Pixmaps_DATA = tilda.png
EXTRA_DIST = tilda.desktop.in tilda.png tilda.appdata.xml README.md
-tilda.desktop: tilda.desktop.in
+%.desktop: %.desktop.in
+
sed -e 's|\@BINDIR\@|$(bindir)|' \
-e 's|\@PIXMAPSDIR\@|$(Pixmapsdir)|' $< > $@
-
-
+
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} I guess it might be also worth a while to add to a readme, that one has to change the key shortcut in Tilda first, before setting up the global handler, otherwise you won't be able to assign/change the key inside Tilda's config (well, other than manually editing config file, though). You were right about
Right, to be honest passing keybinding validation to a functions seems somewhat unwieldy for me, but alternative is also poor - one could simply do a D-BUS query, to check if bus name exists. User might also be confused, "why is this not working?!" if they forget to start Tilda with |
To toggle visibility in Wayland, commands have to be sent via dbus. Tilda has to be started with `--dbus` argument, which exposes a D-Bus action that toggles the tilda window. Next, the user is expected to define its own shortcut in their desktop environment (i.e, Gnome) via `tilda -T 0`. If more Tilda processes are running, 0 corresponds to D-Bus acquired name id. The steps during Tilda startup are changed, given that window creation is not needed, if we intend to exit right after sending the D-Bus cmd. Additionally, the argument after the `-T` option is optional if the first tilda process with instance id 0 should receive the toggle cmd. Signed-off-by: Krzysztof Królczyk <Krzysztof.Krolczyk@o2.pl> Signed-off-by: Sebastian Geiger <sbastig@gmx.net>
69b6ca8
to
402e0af
Compare
Many thanks for the merge request and all the feedback. I have just merged it. There are certainly more improvements that could be made but I think this should be good enough to merge now. According to the Ubuntu Wiki the Debian import freeze for Ubuntu 24.04 starts on Feb. 29: I will try to make a new upload to Debian before that so these changes and several other bug fixes can make it into the next Ubuntu release. |
Happy to hear! I guess we can close this PR then |
in order to toggle visibility in Wayland, commands have to be sent via dbus.
This commit introduces command line switch & function to call dbus method.
It changes the order of tilda startup, as a window is not needed,
if we intend to exit right after sending cmd.
Lastly, there are a couple of formatting fixes, and readme entry.
In order to use it:
--dbus
tilda -T 1
Signed-off-by: Krzysztof Królczyk Krzysztof.Krolczyk@o2.pl