Conversation
The header is not installed by wlroots when the DRM backend is disabled. We don't need it here, so don't include it. Closes: swaywm#7943 (cherry picked from commit ca40663)
Co-authored-by: Ian Fan <ianfan0@gmail.com> Co-authored-by: Nathan Schulte <nmschulte@gmail.com> Signed-off-by: Felix Weilbach <felix.weilbach@t-online.de>
- Rebased against master - Made sure only the tray dbus menu patches are in
| for (int i = 0; i < menu->items->length; ++i) { | ||
| struct swaybar_dbusmenu_menu_item *item = menu->items->items[i]; | ||
| if (item->id == item_id) { | ||
| return item; | ||
| } | ||
| if (item->submenu && item->submenu->item_id != 0) { | ||
| struct swaybar_dbusmenu_menu_item *found_item = | ||
| find_item_under_menu(item->submenu, item_id); | ||
| if (found_item) { | ||
| return found_item; | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Should there be checks to prevent excessive recursion?
There was a problem hiding this comment.
To be quite honest, I've read the whole dbusmenu.c file twice and I'm still trying to understand things. I have been using the patch for a while and it works, but we need to do some more work before it can be merged against master.
Co-authored-by: Demi Marie Obenour <demiobenour@gmail.com>
| #include <wlr/types/wlr_session_lock_v1.h> | ||
| #include <wlr/types/wlr_server_decoration.h> | ||
| #include <wlr/types/wlr_text_input_v3.h> | ||
| #include <wlr/types/wlr_xdg_shell.h> |
There was a problem hiding this comment.
Those #includes seems to be a leftover from the rebase and should be dropped from the PR.
More generally, any unrelated change should be entirely dropped from the PR's commit history via rebase.
There was a problem hiding this comment.
I can squash later the commits, once the PR is fully ready to be merged. But I'll remove these includes.
| cairo_surface_destroy(recorder); | ||
| return; | ||
| } | ||
| int surface_x, surface_y, surface_width, surface_height = 0; |
There was a problem hiding this comment.
[Nitpick] I'd prefer surface_height to be zero-initialized inside draw_menu_items just like the other three variables are.
| #include <xdg-shell-client-protocol.h> | ||
| #include <xdg-shell-protocol.h> | ||
|
|
||
| #include "background-image.h" |
There was a problem hiding this comment.
This header does not exist anymore and should be changed to #include "swaybar/image.h".
| list_free(icon_search_paths); | ||
|
|
||
| if (icon_path) { | ||
| cairo_surface_t *icon = load_background_image(icon_path); |
There was a problem hiding this comment.
This function does not exist anymore and should be changed to load_image.
| static void wl_pointer_leave(void *data, struct wl_pointer *wl_pointer, | ||
| uint32_t serial, struct wl_surface *surface) { | ||
| #if HAVE_TRAY | ||
| struct swaybar_seat *seat = data; |
There was a problem hiding this comment.
shouldn't this line be outside of the #if HAVE_TRAY part?
apart from that, nice that you've picked it up! was subscribed on the old PR and have seen this now :)
|
Feel free to cherry pick commits from my branch as well https://github.com/llyyr/sway/commits/dbus-tray/ Thanks for picking this up, I sort of gave up on it because the whole thing seemed very fragile to me. Menus from applications like Fcitx5 cause crashes and I didn't have time to figure out why |
|
For what it's worth I updated the patch to latest (to date) master for my own use @ https://github.com/gwenhael-le-moine/slackbuilds/blob/main/xap/sway/patches/8405_gwh_tray.patch |
|
This might be useful here: I'm currently working on a new widget library and as an example I implemented a swaybar with full tray dbusmenu support: https://github.com/pd2s/sw/tree/master/examples/sw_swaybar |
This PR takes all the patches from #6249 and I just did some code cleanup but other than that, did not touch any of the code. Also, incorporated some patches.