Merge branch 'backports-for-4-2' into 'gtk-4-2'
Assorted bugfix backports See merge request GNOME/gtk!3687
This commit is contained in:
@@ -145,6 +145,7 @@ ensure_gl_view (GdkMacosGLContext *self)
|
||||
[nsview setPostsFrameChangedNotifications: YES];
|
||||
[nsview setNeedsDisplay:YES];
|
||||
[nswindow setContentView:nsview];
|
||||
[nswindow makeFirstResponder:nsview];
|
||||
[nsview release];
|
||||
|
||||
if (self->dummy_view != NULL)
|
||||
|
||||
@@ -444,9 +444,12 @@ gsk_ngl_command_queue_new (GdkGLContext *context,
|
||||
else
|
||||
self->uniforms = gsk_ngl_uniform_state_new ();
|
||||
|
||||
/* Determine max texture size immediately and restore context */
|
||||
/* Determine max texture size and other limitations immediately
|
||||
* and restore context
|
||||
*/
|
||||
gdk_gl_context_make_current (context);
|
||||
glGetIntegerv (GL_MAX_TEXTURE_SIZE, &self->max_texture_size);
|
||||
glGetIntegerv (GL_MAX_ELEMENTS_VERTICES, &self->max_elements_vertices);
|
||||
|
||||
return g_steal_pointer (&self);
|
||||
}
|
||||
@@ -617,6 +620,7 @@ gsk_ngl_command_queue_end_draw (GskNglCommandQueue *self)
|
||||
last_batch->any.viewport.height == batch->any.viewport.height &&
|
||||
last_batch->draw.framebuffer == batch->draw.framebuffer &&
|
||||
last_batch->draw.vbo_offset + last_batch->draw.vbo_count == batch->draw.vbo_offset &&
|
||||
last_batch->draw.vbo_count + batch->draw.vbo_count <= self->max_elements_vertices &&
|
||||
snapshots_equal (self, last_batch, batch))
|
||||
{
|
||||
last_batch->draw.vbo_count += batch->draw.vbo_count;
|
||||
|
||||
@@ -231,6 +231,12 @@ struct _GskNglCommandQueue
|
||||
*/
|
||||
int max_texture_size;
|
||||
|
||||
/* Discovered max element count. We must not create batches that contain
|
||||
* more vertices than this number.
|
||||
*/
|
||||
|
||||
int max_elements_vertices;
|
||||
|
||||
/* The index of the last batch in @batches, which may not be the element
|
||||
* at the end of the array, as batches can be reordered. This is used to
|
||||
* update the "next" index when adding a new batch.
|
||||
|
||||
@@ -3424,8 +3424,18 @@ gtk_cell_area_inner_cell_area (GtkCellArea *area,
|
||||
|
||||
*inner_area = *cell_area;
|
||||
|
||||
if (border.left + border.right > cell_area->width)
|
||||
{
|
||||
border.left = cell_area->width / 2;
|
||||
border.right = (cell_area->width + 1) / 2;
|
||||
}
|
||||
inner_area->x += border.left;
|
||||
inner_area->width -= border.left + border.right;
|
||||
if (border.top + border.bottom > cell_area->height)
|
||||
{
|
||||
border.top = cell_area->height / 2;
|
||||
border.bottom = (cell_area->height + 1) / 2;
|
||||
}
|
||||
inner_area->y += border.top;
|
||||
inner_area->height -= border.top + border.bottom;
|
||||
}
|
||||
|
||||
@@ -2970,8 +2970,18 @@ gtk_label_recalculate (GtkLabel *self)
|
||||
gtk_label_clear_layout (self);
|
||||
gtk_label_clear_select_info (self);
|
||||
|
||||
if (self->use_markup || self->use_underline)
|
||||
gtk_label_set_markup_internal (self, self->label, self->use_underline);
|
||||
if (self->use_markup)
|
||||
{
|
||||
gtk_label_set_markup_internal (self, self->label, self->use_underline);
|
||||
}
|
||||
else if (self->use_underline)
|
||||
{
|
||||
char *text;
|
||||
|
||||
text = g_markup_escape_text (self->label, -1);
|
||||
gtk_label_set_markup_internal (self, text, TRUE);
|
||||
g_free (text);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_clear_pointer (&self->markup_attrs, pango_attr_list_unref);
|
||||
|
||||
@@ -334,6 +334,7 @@ gtk_list_item_widget_click_gesture_pressed (GtkGestureClick *gesture,
|
||||
{
|
||||
if (n_press == 2 && !priv->single_click_activate)
|
||||
{
|
||||
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
|
||||
gtk_widget_activate_action (GTK_WIDGET (self),
|
||||
"list.activate-item",
|
||||
"u",
|
||||
@@ -356,14 +357,17 @@ gtk_list_item_widget_click_gesture_released (GtkGestureClick *gesture,
|
||||
{
|
||||
GtkListItemWidgetPrivate *priv = gtk_list_item_widget_get_instance_private (self);
|
||||
|
||||
if (priv->single_click_activate)
|
||||
if (!priv->list_item || priv->list_item->activatable)
|
||||
{
|
||||
gtk_widget_activate_action (GTK_WIDGET (self),
|
||||
"list.activate-item",
|
||||
"u",
|
||||
priv->position);
|
||||
|
||||
return;
|
||||
if (n_press == 1 && priv->single_click_activate)
|
||||
{
|
||||
gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_CLAIMED);
|
||||
gtk_widget_activate_action (GTK_WIDGET (self),
|
||||
"list.activate-item",
|
||||
"u",
|
||||
priv->position);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!priv->list_item || priv->list_item->selectable)
|
||||
|
||||
@@ -855,6 +855,7 @@ gtk_tree_view_column_create_button (GtkTreeViewColumn *tree_column)
|
||||
priv->button = gtk_button_new ();
|
||||
g_object_ref_sink (priv->button);
|
||||
gtk_widget_set_focus_on_click (priv->button, FALSE);
|
||||
gtk_widget_set_overflow (priv->button, GTK_OVERFLOW_HIDDEN);
|
||||
|
||||
g_signal_connect (priv->button, "clicked",
|
||||
G_CALLBACK (gtk_tree_view_column_button_clicked),
|
||||
|
||||
Reference in New Issue
Block a user