mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
gtk: Chain up in realize()
... instead of copy/paste from gtk_widget_real_realize.
This commit is contained in:
parent
b0a5e8764c
commit
32a5729d18
@ -776,17 +776,12 @@ gtk_button_realize (GtkWidget *widget)
|
||||
GtkButton *button = GTK_BUTTON (widget);
|
||||
GtkButtonPrivate *priv = button->priv;
|
||||
GtkAllocation allocation;
|
||||
GdkWindow *window;
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_button_parent_class)->realize (widget);
|
||||
|
||||
gtk_widget_get_allocation (widget, &allocation);
|
||||
|
||||
gtk_widget_set_realized (widget, TRUE);
|
||||
|
||||
window = gtk_widget_get_parent_window (widget);
|
||||
gtk_widget_set_window (widget, window);
|
||||
g_object_ref (window);
|
||||
|
||||
priv->event_window = gdk_window_new_input (window,
|
||||
priv->event_window = gdk_window_new_input (gtk_widget_get_window (widget),
|
||||
gtk_widget_get_events (widget)
|
||||
| GDK_BUTTON_PRESS_MASK
|
||||
| GDK_BUTTON_RELEASE_MASK
|
||||
|
@ -452,16 +452,10 @@ swatch_realize (GtkWidget *widget)
|
||||
{
|
||||
GtkColorSwatch *swatch = GTK_COLOR_SWATCH (widget);
|
||||
GtkAllocation allocation;
|
||||
GdkWindow *window;
|
||||
|
||||
gtk_widget_get_allocation (widget, &allocation);
|
||||
gtk_widget_set_realized (widget, TRUE);
|
||||
GTK_WIDGET_CLASS (gtk_color_swatch_parent_class)->realize (widget);
|
||||
|
||||
window = gtk_widget_get_parent_window (widget);
|
||||
gtk_widget_set_window (widget, window);
|
||||
g_object_ref (window);
|
||||
|
||||
swatch->priv->event_window = gdk_window_new_input (window,
|
||||
swatch->priv->event_window = gdk_window_new_input (gtk_widget_get_window (widget),
|
||||
gtk_widget_get_events (widget)
|
||||
| GDK_BUTTON_PRESS_MASK
|
||||
| GDK_BUTTON_RELEASE_MASK
|
||||
|
@ -534,17 +534,14 @@ gtk_expander_realize (GtkWidget *widget)
|
||||
{
|
||||
GtkAllocation allocation;
|
||||
GtkExpanderPrivate *priv;
|
||||
GdkWindow *window;
|
||||
|
||||
priv = GTK_EXPANDER (widget)->priv;
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_expander_parent_class)->realize (widget);
|
||||
|
||||
gtk_widget_get_allocation (widget, &allocation);
|
||||
|
||||
window = gtk_widget_get_parent_window (widget);
|
||||
gtk_widget_set_window (widget, window);
|
||||
g_object_ref (window);
|
||||
|
||||
priv->event_window = gdk_window_new_input (gtk_widget_get_parent_window (widget),
|
||||
priv->event_window = gdk_window_new_input (gtk_widget_get_window (widget),
|
||||
gtk_widget_get_events (widget)
|
||||
| GDK_BUTTON_PRESS_MASK
|
||||
| GDK_BUTTON_RELEASE_MASK
|
||||
@ -554,7 +551,6 @@ gtk_expander_realize (GtkWidget *widget)
|
||||
gtk_widget_register_window (widget, priv->event_window);
|
||||
|
||||
gtk_gesture_set_window (priv->multipress_gesture, priv->event_window);
|
||||
gtk_widget_set_realized (widget, TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1229,17 +1229,12 @@ gtk_menu_item_realize (GtkWidget *widget)
|
||||
GtkMenuItem *menu_item = GTK_MENU_ITEM (widget);
|
||||
GtkMenuItemPrivate *priv = menu_item->priv;
|
||||
GtkAllocation allocation;
|
||||
GdkWindow *window;
|
||||
|
||||
gtk_widget_set_realized (widget, TRUE);
|
||||
|
||||
window = gtk_widget_get_parent_window (widget);
|
||||
gtk_widget_set_window (widget, window);
|
||||
g_object_ref (window);
|
||||
GTK_WIDGET_CLASS (gtk_menu_item_parent_class)->realize (widget);
|
||||
|
||||
gtk_widget_get_allocation (widget, &allocation);
|
||||
|
||||
priv->event_window = gdk_window_new_input (gtk_widget_get_parent_window (widget),
|
||||
priv->event_window = gdk_window_new_input (gtk_widget_get_window (widget),
|
||||
gtk_widget_get_events (widget)
|
||||
| GDK_BUTTON_PRESS_MASK
|
||||
| GDK_BUTTON_RELEASE_MASK
|
||||
|
@ -1818,18 +1818,13 @@ gtk_notebook_realize (GtkWidget *widget)
|
||||
{
|
||||
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
|
||||
GtkNotebookPrivate *priv = notebook->priv;
|
||||
GdkWindow *window;
|
||||
GdkRectangle event_window_pos;
|
||||
|
||||
gtk_widget_set_realized (widget, TRUE);
|
||||
GTK_WIDGET_CLASS (gtk_notebook_parent_class)->realize (widget);
|
||||
|
||||
gtk_css_gadget_get_border_allocation (priv->header_gadget, &event_window_pos, NULL);
|
||||
|
||||
window = gtk_widget_get_parent_window (widget);
|
||||
gtk_widget_set_window (widget, window);
|
||||
g_object_ref (window);
|
||||
|
||||
priv->event_window = gdk_window_new_input (gtk_widget_get_parent_window (widget),
|
||||
priv->event_window = gdk_window_new_input (gtk_widget_get_window (widget),
|
||||
gtk_widget_get_events (widget)
|
||||
| GDK_BUTTON_PRESS_MASK
|
||||
| GDK_BUTTON_RELEASE_MASK
|
||||
|
@ -1566,15 +1566,10 @@ gtk_paned_realize (GtkWidget *widget)
|
||||
{
|
||||
GtkPaned *paned = GTK_PANED (widget);
|
||||
GtkPanedPrivate *priv = paned->priv;
|
||||
GdkWindow *window;
|
||||
|
||||
gtk_widget_set_realized (widget, TRUE);
|
||||
GTK_WIDGET_CLASS (gtk_paned_parent_class)->realize (widget);
|
||||
|
||||
window = gtk_widget_get_parent_window (widget);
|
||||
gtk_widget_set_window (widget, window);
|
||||
g_object_ref (window);
|
||||
|
||||
priv->handle = gdk_window_new_input (window,
|
||||
priv->handle = gdk_window_new_input (gtk_widget_get_window (widget),
|
||||
gtk_widget_get_events (widget)
|
||||
| GDK_BUTTON_PRESS_MASK
|
||||
| GDK_BUTTON_RELEASE_MASK
|
||||
|
@ -460,20 +460,14 @@ gtk_path_bar_unmap (GtkWidget *widget)
|
||||
static void
|
||||
gtk_path_bar_realize (GtkWidget *widget)
|
||||
{
|
||||
GtkPathBar *path_bar;
|
||||
GtkPathBar *path_bar = GTK_PATH_BAR (widget);
|
||||
GtkAllocation allocation;
|
||||
GdkWindow *window;
|
||||
|
||||
gtk_widget_set_realized (widget, TRUE);
|
||||
|
||||
path_bar = GTK_PATH_BAR (widget);
|
||||
window = gtk_widget_get_parent_window (widget);
|
||||
gtk_widget_set_window (widget, window);
|
||||
g_object_ref (window);
|
||||
GTK_WIDGET_CLASS (gtk_path_bar_parent_class)->realize (widget);
|
||||
|
||||
gtk_widget_get_allocation (widget, &allocation);
|
||||
|
||||
path_bar->priv->event_window = gdk_window_new_input (gtk_widget_get_parent_window (widget),
|
||||
path_bar->priv->event_window = gdk_window_new_input (gtk_widget_get_window (widget),
|
||||
gtk_widget_get_events (widget)
|
||||
| GDK_SCROLL_MASK,
|
||||
&allocation);
|
||||
|
@ -332,8 +332,7 @@ gtk_stack_realize (GtkWidget *widget)
|
||||
GList *l;
|
||||
gint event_mask;
|
||||
|
||||
gtk_widget_set_realized (widget, TRUE);
|
||||
gtk_widget_set_window (widget, g_object_ref (gtk_widget_get_parent_window (widget)));
|
||||
GTK_WIDGET_CLASS (gtk_stack_parent_class)->realize (widget);
|
||||
|
||||
gtk_css_gadget_get_content_allocation (priv->gadget, &allocation, NULL);
|
||||
|
||||
|
@ -773,17 +773,12 @@ gtk_toolbar_realize (GtkWidget *widget)
|
||||
GtkAllocation allocation;
|
||||
GtkToolbar *toolbar = GTK_TOOLBAR (widget);
|
||||
GtkToolbarPrivate *priv = toolbar->priv;
|
||||
GdkWindow *window;
|
||||
|
||||
gtk_widget_set_realized (widget, TRUE);
|
||||
GTK_WIDGET_CLASS (gtk_toolbar_parent_class)->realize (widget);
|
||||
|
||||
gtk_widget_get_allocation (widget, &allocation);
|
||||
|
||||
window = gtk_widget_get_parent_window (widget);
|
||||
gtk_widget_set_window (widget, window);
|
||||
g_object_ref (window);
|
||||
|
||||
priv->event_window = gdk_window_new_input (gtk_widget_get_parent_window (widget),
|
||||
priv->event_window = gdk_window_new_input (gtk_widget_get_window (widget),
|
||||
gtk_widget_get_events (widget)
|
||||
| GDK_BUTTON_PRESS_MASK
|
||||
| GDK_BUTTON_RELEASE_MASK
|
||||
|
@ -336,15 +336,9 @@ create_drag_window (GtkToolItem *toolitem)
|
||||
static void
|
||||
gtk_tool_item_realize (GtkWidget *widget)
|
||||
{
|
||||
GtkToolItem *toolitem;
|
||||
GdkWindow *window;
|
||||
GtkToolItem *toolitem = GTK_TOOL_ITEM (widget);
|
||||
|
||||
toolitem = GTK_TOOL_ITEM (widget);
|
||||
gtk_widget_set_realized (widget, TRUE);
|
||||
|
||||
window = gtk_widget_get_parent_window (widget);
|
||||
gtk_widget_set_window (widget, window);
|
||||
g_object_ref (window);
|
||||
GTK_WIDGET_CLASS (gtk_tool_item_parent_class)->realize (widget);
|
||||
|
||||
if (toolitem->priv->use_drag_window)
|
||||
create_drag_window(toolitem);
|
||||
|
Loading…
Reference in New Issue
Block a user