Add gtk_application_prefers_app_menu()

Applications can call this to determine if they should an app menu.
This will be %FALSE on desktop environments that do not have an
application menu like the one in gnome-shell.  It is %FALSE on Windows
and Mac OS.

Applications are completely free to totally ignore this API -- it is
only provided as a hint to help applications that may be interested in
supporting non-GNOME platforms with a more native 'look and feel'.

https://bugzilla.gnome.org/show_bug.cgi?id=722092
This commit is contained in:
Ryan Lortie
2014-06-30 12:16:19 -04:00
parent d8934ea233
commit d3b34d3cf2
6 changed files with 101 additions and 0 deletions

View File

@ -41,6 +41,7 @@ gtk_application_impl_init (GtkApplicationImpl *impl)
}
static guint do_nothing (void) { return 0; }
static gboolean return_false (void) { return FALSE; }
static void
gtk_application_impl_class_init (GtkApplicationImplClass *class)
@ -59,6 +60,7 @@ gtk_application_impl_class_init (GtkApplicationImplClass *class)
class->inhibit = (gpointer) do_nothing;
class->uninhibit = (gpointer) do_nothing;
class->is_inhibited = (gpointer) do_nothing;
class->prefers_app_menu = (gpointer) return_false;
}
void
@ -153,6 +155,12 @@ gtk_application_impl_is_inhibited (GtkApplicationImpl *impl,
return GTK_APPLICATION_IMPL_GET_CLASS (impl)->is_inhibited (impl, flags);
}
gboolean
gtk_application_impl_prefers_app_menu (GtkApplicationImpl *impl)
{
return GTK_APPLICATION_IMPL_GET_CLASS (impl)->prefers_app_menu (impl);
}
GtkApplicationImpl *
gtk_application_impl_new (GtkApplication *application,
GdkDisplay *display)