Commit 93efaa5e authored by Matthias Clasen's avatar Matthias Clasen

Fix GtkApplicationWindow menubar placement

Since the menubar is part of the content, we need to give
it the content_window as parent window, to make things
work again.
https://bugzilla.gnome.org/show_bug.cgi?id=696561
parent bdfd0d46
...@@ -258,6 +258,9 @@ gtk_application_window_update_menubar (GtkApplicationWindow *window) ...@@ -258,6 +258,9 @@ gtk_application_window_update_menubar (GtkApplicationWindow *window)
window->priv->menubar = gtk_menu_bar_new_from_model (G_MENU_MODEL (combined)); window->priv->menubar = gtk_menu_bar_new_from_model (G_MENU_MODEL (combined));
gtk_widget_set_parent (window->priv->menubar, GTK_WIDGET (window)); gtk_widget_set_parent (window->priv->menubar, GTK_WIDGET (window));
if (_gtk_window_get_content_window (GTK_WINDOW (window)) != NULL)
gtk_widget_set_parent_window (window->priv->menubar,
_gtk_window_get_content_window (GTK_WINDOW (window)));
gtk_widget_show_all (window->priv->menubar); gtk_widget_show_all (window->priv->menubar);
g_object_unref (combined); g_object_unref (combined);
...@@ -760,6 +763,10 @@ gtk_application_window_real_realize (GtkWidget *widget) ...@@ -760,6 +763,10 @@ gtk_application_window_real_realize (GtkWidget *widget)
GTK_WIDGET_CLASS (gtk_application_window_parent_class) GTK_WIDGET_CLASS (gtk_application_window_parent_class)
->realize (widget); ->realize (widget);
if (window->priv->menubar != NULL)
gtk_widget_set_parent_window (window->priv->menubar,
_gtk_window_get_content_window (GTK_WINDOW (window)));
#ifdef GDK_WINDOWING_X11 #ifdef GDK_WINDOWING_X11
{ {
GdkWindow *gdkwindow; GdkWindow *gdkwindow;
......
...@@ -11271,3 +11271,9 @@ ensure_state_flag_backdrop (GtkWidget *widget) ...@@ -11271,3 +11271,9 @@ ensure_state_flag_backdrop (GtkWidget *widget)
gtk_widget_queue_draw (widget); gtk_widget_queue_draw (widget);
} }
GdkWindow *
_gtk_window_get_content_window (GtkWindow *window)
{
return window->priv->content_window;
}
...@@ -69,6 +69,7 @@ void _gtk_window_get_wmclass (GtkWindow *window, ...@@ -69,6 +69,7 @@ void _gtk_window_get_wmclass (GtkWindow *window,
void _gtk_window_set_allocation (GtkWindow *window, void _gtk_window_set_allocation (GtkWindow *window,
const GtkAllocation *allocation, const GtkAllocation *allocation,
GtkAllocation *allocation_out); GtkAllocation *allocation_out);
GdkWindow * _gtk_window_get_content_window (GtkWindow *window);
typedef void (*GtkWindowKeysForeachFunc) (GtkWindow *window, typedef void (*GtkWindowKeysForeachFunc) (GtkWindow *window,
guint keyval, guint keyval,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment