diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2015-11-04 11:24:36 +0100 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2015-11-19 15:04:03 -0500 |
commit | 1080ffdf19fe49c803da0baa4047cce3c29815b6 (patch) | |
tree | 24ecabd62475cb40d31f6175cc62bafe23e8af9a /gtk/gtkwindow.c | |
parent | 6a69c01e429a303b21f5a438466f257c2b4bc68a (diff) | |
download | gtk+-1080ffdf19fe49c803da0baa4047cce3c29815b6.tar.gz |
window: maximize on double click only if allowed
GtkHeaderBar will not show the maximize button if the window in not of
type normal or not resizeable.
Use the same restriction for double-click actions as well.
Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=757530
Diffstat (limited to 'gtk/gtkwindow.c')
-rw-r--r-- | gtk/gtkwindow.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 7b05341b15..f87acd9b60 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -1383,7 +1383,16 @@ gtk_window_titlebar_action (GtkWindow *window, retval = FALSE; /* treat all maximization variants the same */ else if (g_str_has_prefix (action, "toggle-maximize")) - _gtk_window_toggle_maximized (window); + { + /* + * gtk header bar won't show the maximize button if the following + * properties are not met, apply the same to title bar actions for + * consistency. + */ + if (gtk_window_get_resizable (window) && + gtk_window_get_type_hint (window) == GDK_WINDOW_TYPE_HINT_NORMAL) + _gtk_window_toggle_maximized (window); + } else if (g_str_equal (action, "lower")) gdk_window_lower (_gtk_widget_get_window (GTK_WIDGET (window))); else if (g_str_equal (action, "minimize")) |