diff options
author | Benjamin Otte <otte@redhat.com> | 2016-11-03 21:29:07 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2016-11-03 21:29:07 +0100 |
commit | 6c6359df4f5559592342b866c59b2d628ee830f9 (patch) | |
tree | dc883cc3d73a362b7e033c56d542a18f5ec15482 /gtk/gtkmenubar.c | |
parent | d8d8059ee1c2c789374d075592c0e5f5b04f97a5 (diff) | |
download | gtk+-6c6359df4f5559592342b866c59b2d628ee830f9.tar.gz |
menubar: We don't need an input window
Input is handled by the menuitems completely.
Diffstat (limited to 'gtk/gtkmenubar.c')
-rw-r--r-- | gtk/gtkmenubar.c | 56 |
1 files changed, 3 insertions, 53 deletions
diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c index 76af5377b2..f8094ef365 100644 --- a/gtk/gtkmenubar.c +++ b/gtk/gtkmenubar.c @@ -72,7 +72,6 @@ struct _GtkMenuBarPrivate GtkPackDirection pack_direction; GtkPackDirection child_pack_direction; - GdkWindow *input_window; GtkCssGadget *gadget; }; @@ -97,8 +96,6 @@ static void gtk_menu_bar_size_allocate (GtkWidget *widget, GtkAllocation *allocation); static gint gtk_menu_bar_draw (GtkWidget *widget, cairo_t *cr); -static void gtk_menu_bar_realize (GtkWidget *widget); -static void gtk_menu_bar_unrealize (GtkWidget *widget); static void gtk_menu_bar_hierarchy_changed (GtkWidget *widget, GtkWidget *old_toplevel); static gint gtk_menu_bar_get_popup_delay (GtkMenuShell *menu_shell); @@ -147,11 +144,7 @@ gtk_menu_bar_class_init (GtkMenuBarClass *class) widget_class->measure = gtk_menu_bar_measure_; widget_class->size_allocate = gtk_menu_bar_size_allocate; - widget_class->size_allocate = gtk_menu_bar_size_allocate; - widget_class->size_allocate = gtk_menu_bar_size_allocate; widget_class->draw = gtk_menu_bar_draw; - widget_class->realize = gtk_menu_bar_realize; - widget_class->unrealize = gtk_menu_bar_unrealize; widget_class->hierarchy_changed = gtk_menu_bar_hierarchy_changed; menu_shell_class->submenu_placement = GTK_TOP_BOTTOM; @@ -325,42 +318,6 @@ gtk_menu_bar_get_property (GObject *object, } static void -gtk_menu_bar_realize (GtkWidget *widget) -{ - GtkMenuBar *menubar = GTK_MENU_BAR (widget); - GtkMenuBarPrivate *priv = menubar->priv; - GtkAllocation allocation; - - GTK_WIDGET_CLASS (gtk_menu_bar_parent_class)->realize (widget); - - gtk_widget_get_allocation (widget, &allocation); - - priv->input_window = gdk_window_new_input (gtk_widget_get_window (widget), - gtk_widget_get_events (widget) - | GDK_BUTTON_PRESS_MASK - | GDK_BUTTON_RELEASE_MASK - | GDK_POINTER_MOTION_MASK - | GDK_KEY_PRESS_MASK - | GDK_ENTER_NOTIFY_MASK - | GDK_LEAVE_NOTIFY_MASK, - &allocation); - gtk_widget_register_window (widget, priv->input_window); -} - -static void -gtk_menu_bar_unrealize (GtkWidget *widget) -{ - GtkMenuBar *menubar = GTK_MENU_BAR (widget); - GtkMenuBarPrivate *priv = menubar->priv; - - gtk_widget_unregister_window (widget, priv->input_window); - gdk_window_destroy (priv->input_window); - priv->input_window = NULL; - - GTK_WIDGET_CLASS (gtk_menu_bar_parent_class)->unrealize (widget); -} - -static void gtk_menu_bar_measure (GtkCssGadget *gadget, GtkOrientation orientation, int size, @@ -601,22 +558,15 @@ gtk_menu_bar_size_allocate (GtkWidget *widget, { GtkMenuBar *menu_bar = GTK_MENU_BAR (widget); GtkMenuBarPrivate *priv = menu_bar->priv; - GtkAllocation clip, content_allocation; + GtkAllocation clip; - gtk_widget_set_allocation (widget, allocation); + GTK_WIDGET_CLASS (gtk_menu_bar_parent_class)->size_allocate (widget, allocation); - if (gtk_widget_get_realized (widget)) - gdk_window_move_resize (priv->input_window, - allocation->x, allocation->y, - allocation->width, allocation->height); - content_allocation = *allocation; gtk_css_gadget_allocate (priv->gadget, - &content_allocation, + allocation, gtk_widget_get_allocated_baseline (widget), &clip); - clip.x += allocation->x; - clip.y += allocation->y; gtk_widget_set_clip (widget, &clip); } |