-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Tray D-Bus Menu #8405
base: master
Are you sure you want to change the base?
Tray D-Bus Menu #8405
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 <[email protected]> Co-authored-by: Nathan Schulte <[email protected]> Signed-off-by: Felix Weilbach <[email protected]>
- 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be checks to prevent excessive recursion?
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.
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 <[email protected]>
#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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
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.