mirror of
https://github.com/brl/mutter.git
synced 2025-08-03 15:14:46 +00:00
Add back coordinates to the window menu
It looks weird to have Alt+Space pop up under the cursor instead of the top-left corner of the window, and the Wayland request will pass through the coordinates as well. Add it to the compositor interface, and extend the _GTK_SHOW_WINDOW_MENU ClientMessage to support it as well.
This commit is contained in:
@@ -374,6 +374,8 @@ meta_core_change_workspace (Display *xdisplay,
|
||||
void
|
||||
meta_core_show_window_menu (Display *xdisplay,
|
||||
Window frame_xwindow,
|
||||
int root_x,
|
||||
int root_y,
|
||||
guint32 timestamp)
|
||||
{
|
||||
MetaWindow *window = get_window (xdisplay, frame_xwindow);
|
||||
@@ -382,7 +384,7 @@ meta_core_show_window_menu (Display *xdisplay,
|
||||
meta_window_raise (window);
|
||||
meta_window_focus (window, timestamp);
|
||||
|
||||
meta_window_show_menu (window);
|
||||
meta_window_show_menu (window, root_x, root_y);
|
||||
}
|
||||
|
||||
const char*
|
||||
|
@@ -134,6 +134,8 @@ const char* meta_core_get_workspace_name_with_index (Display *xdisplay,
|
||||
|
||||
void meta_core_show_window_menu (Display *xdisplay,
|
||||
Window frame_xwindow,
|
||||
int root_x,
|
||||
int root_y,
|
||||
guint32 timestamp);
|
||||
|
||||
|
||||
|
@@ -2726,7 +2726,16 @@ handle_activate_window_menu (MetaDisplay *display,
|
||||
gpointer dummy)
|
||||
{
|
||||
if (display->focus_window)
|
||||
meta_window_show_menu (display->focus_window);
|
||||
{
|
||||
int x, y;
|
||||
|
||||
meta_window_get_position (display->focus_window, &x, &y);
|
||||
|
||||
if (meta_ui_get_direction() == META_UI_DIRECTION_RTL)
|
||||
x += display->focus_window->rect.width;
|
||||
|
||||
meta_window_show_menu (display->focus_window, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -605,7 +605,9 @@ void meta_window_set_focused_internal (MetaWindow *window,
|
||||
|
||||
void meta_window_current_workspace_changed (MetaWindow *window);
|
||||
|
||||
void meta_window_show_menu (MetaWindow *window);
|
||||
void meta_window_show_menu (MetaWindow *window,
|
||||
int x,
|
||||
int y);
|
||||
|
||||
gboolean meta_window_handle_mouse_grab_op_event (MetaWindow *window,
|
||||
const ClutterEvent *event);
|
||||
|
@@ -5313,10 +5313,12 @@ meta_window_recalc_features (MetaWindow *window)
|
||||
}
|
||||
|
||||
void
|
||||
meta_window_show_menu (MetaWindow *window)
|
||||
meta_window_show_menu (MetaWindow *window,
|
||||
int x,
|
||||
int y)
|
||||
{
|
||||
g_return_if_fail (!window->override_redirect);
|
||||
meta_compositor_show_window_menu (window->display->compositor, window);
|
||||
meta_compositor_show_window_menu (window->display->compositor, window, x, y);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -7976,7 +7978,9 @@ meta_window_handle_ungrabbed_event (MetaWindow *window,
|
||||
{
|
||||
if (meta_prefs_get_raise_on_click ())
|
||||
meta_window_raise (window);
|
||||
meta_window_show_menu (window);
|
||||
meta_window_show_menu (window,
|
||||
event->button.x,
|
||||
event->button.y);
|
||||
return TRUE;
|
||||
}
|
||||
else if (fully_modified && (int) event->button.button == 1)
|
||||
|
Reference in New Issue
Block a user