Pass button_rect when opening window menu from button
When opening the window menu without an associated control - e.g. by right-clicking the titlebar or by keyboard - using coordinates for the menu position is appropriate. However when the menu is associated with a window button, the expected behavior in the shell can be implemented much easier with the full button geometry: the menu will point to the center of the button's bottom edge rather than align to the left/right side of the titlebar as it does now, and the clickable area where a release event does not dismiss the menu will match the actual clickable area in mutter. So add an additional show_window_menu_for_rect() function and use it when opening the menu from a button. https://bugzilla.gnome.org/show_bug.cgi?id=731058
This commit is contained in:
@ -5251,6 +5251,15 @@ meta_window_show_menu (MetaWindow *window,
|
||||
meta_compositor_show_window_menu (window->display->compositor, window, menu, x, y);
|
||||
}
|
||||
|
||||
void
|
||||
meta_window_show_menu_for_rect (MetaWindow *window,
|
||||
MetaWindowMenuType menu,
|
||||
MetaRectangle *rect)
|
||||
{
|
||||
g_return_if_fail (!window->override_redirect);
|
||||
meta_compositor_show_window_menu_for_rect (window->display->compositor, window, menu, rect);
|
||||
}
|
||||
|
||||
void
|
||||
meta_window_shove_titlebar_onscreen (MetaWindow *window)
|
||||
{
|
||||
|
Reference in New Issue
Block a user