mirror of
https://github.com/brl/mutter.git
synced 2025-07-20 08:54:13 +00:00
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:
@ -392,6 +392,22 @@ meta_core_show_window_menu (Display *xdisplay,
|
||||
meta_window_show_menu (window, menu, root_x, root_y);
|
||||
}
|
||||
|
||||
void
|
||||
meta_core_show_window_menu_for_rect (Display *xdisplay,
|
||||
Window frame_xwindow,
|
||||
MetaWindowMenuType menu,
|
||||
MetaRectangle *rect,
|
||||
guint32 timestamp)
|
||||
{
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
|
||||
if (meta_prefs_get_raise_on_click ())
|
||||
meta_window_raise (window);
|
||||
meta_window_focus (window, timestamp);
|
||||
|
||||
meta_window_show_menu_for_rect (window, menu, rect);
|
||||
}
|
||||
|
||||
const char*
|
||||
meta_core_get_workspace_name_with_index (Display *xdisplay,
|
||||
Window xroot,
|
||||
|
Reference in New Issue
Block a user