mirror of
https://github.com/swaywm/sway.git
synced 2026-03-30 11:10:59 -04:00
Correct context menu placement if bar is bottom
Originally the context menu would draw at the top of the screen, which is incorrect.
This commit is contained in:
parent
2f1eb30c38
commit
5c8dc9cb73
3 changed files with 8 additions and 1 deletions
|
|
@ -432,9 +432,13 @@ err:
|
|||
return -1;
|
||||
}
|
||||
|
||||
void tray_mouse_event(struct output *output, int x, int y,
|
||||
void tray_mouse_event(struct output *output, int rel_x, int rel_y,
|
||||
uint32_t button, uint32_t state) {
|
||||
|
||||
int x = rel_x;
|
||||
int y = rel_y + (swaybar.config->position == DESKTOP_SHELL_PANEL_POSITION_TOP
|
||||
? 0 : (output->state->height - output->window->height));
|
||||
|
||||
struct window *window = output->window;
|
||||
uint32_t tray_padding = swaybar.config->tray_padding;
|
||||
int tray_width = window->width * window->scale;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue