label: Use gdk_window_new_input()

This commit is contained in:
Benjamin Otte 2016-10-17 20:21:55 +02:00
parent 6117f042a8
commit 360301a774

View File

@ -5356,8 +5356,6 @@ gtk_label_create_window (GtkLabel *label)
GtkLabelPrivate *priv = label->priv; GtkLabelPrivate *priv = label->priv;
GtkAllocation allocation; GtkAllocation allocation;
GtkWidget *widget; GtkWidget *widget;
GdkWindowAttr attributes;
gint attributes_mask;
g_assert (priv->select_info); g_assert (priv->select_info);
widget = GTK_WIDGET (label); widget = GTK_WIDGET (label);
@ -5368,23 +5366,14 @@ gtk_label_create_window (GtkLabel *label)
gtk_widget_get_allocation (widget, &allocation); gtk_widget_get_allocation (widget, &allocation);
attributes.x = allocation.x; priv->select_info->window = gdk_window_new_input (gtk_widget_get_window (widget),
attributes.y = allocation.y; gtk_widget_get_events (widget)
attributes.width = allocation.width; | GDK_BUTTON_PRESS_MASK
attributes.height = allocation.height; | GDK_BUTTON_RELEASE_MASK
attributes.window_type = GDK_WINDOW_CHILD; | GDK_LEAVE_NOTIFY_MASK
attributes.wclass = GDK_INPUT_ONLY; | GDK_BUTTON_MOTION_MASK
attributes.override_redirect = TRUE; | GDK_POINTER_MOTION_MASK,
attributes.event_mask = gtk_widget_get_events (widget) | &allocation);
GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
GDK_LEAVE_NOTIFY_MASK |
GDK_BUTTON_MOTION_MASK |
GDK_POINTER_MOTION_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_NOREDIR;
priv->select_info->window = gdk_window_new (gtk_widget_get_window (widget),
&attributes, attributes_mask);
if (gtk_widget_is_sensitive (widget) && priv->select_info->selectable) if (gtk_widget_is_sensitive (widget) && priv->select_info->selectable)
{ {