mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 18:11:05 -05:00
wayland/gtk: Only perform allowed titlebar gestures
The window functions "work" regardless of whether the client allows the behavior or not. That is, it's up to the caller to not call maximize and friends when the action isn't allowed. Add appropriate checks, which should make the titlebar_gesture() behavior identical to titlebar actions for server-side decorations. https://gitlab.gnome.org/GNOME/mutter/-/issues/2139 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2281>
This commit is contained in:
parent
338eea7a37
commit
7ff52b6128
@ -253,6 +253,9 @@ gtk_surface_titlebar_gesture (struct wl_client *client,
|
||||
switch (action)
|
||||
{
|
||||
case G_DESKTOP_TITLEBAR_ACTION_TOGGLE_MAXIMIZE:
|
||||
if (!window->has_maximize_func)
|
||||
break;
|
||||
|
||||
if (META_WINDOW_MAXIMIZED (window))
|
||||
meta_window_unmaximize (window, META_MAXIMIZE_BOTH);
|
||||
else
|
||||
@ -260,6 +263,9 @@ gtk_surface_titlebar_gesture (struct wl_client *client,
|
||||
break;
|
||||
|
||||
case G_DESKTOP_TITLEBAR_ACTION_TOGGLE_MAXIMIZE_HORIZONTALLY:
|
||||
if (!window->has_maximize_func)
|
||||
break;
|
||||
|
||||
if (META_WINDOW_MAXIMIZED_HORIZONTALLY (window))
|
||||
meta_window_unmaximize (window, META_MAXIMIZE_HORIZONTAL);
|
||||
else
|
||||
@ -267,6 +273,9 @@ gtk_surface_titlebar_gesture (struct wl_client *client,
|
||||
break;
|
||||
|
||||
case G_DESKTOP_TITLEBAR_ACTION_TOGGLE_MAXIMIZE_VERTICALLY:
|
||||
if (!window->has_maximize_func)
|
||||
break;
|
||||
|
||||
if (META_WINDOW_MAXIMIZED_VERTICALLY (window))
|
||||
meta_window_unmaximize (window, META_MAXIMIZE_VERTICAL);
|
||||
else
|
||||
@ -274,6 +283,9 @@ gtk_surface_titlebar_gesture (struct wl_client *client,
|
||||
break;
|
||||
|
||||
case G_DESKTOP_TITLEBAR_ACTION_MINIMIZE:
|
||||
if (!window->has_minimize_func)
|
||||
break;
|
||||
|
||||
meta_window_minimize (window);
|
||||
break;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user