diff options
-rw-r--r-- | demos/gtk-demo/listview_ucd.c | 2 | ||||
-rw-r--r-- | gdk/gdkglcontext.c | 14 | ||||
-rw-r--r-- | gdk/wayland/gdksurface-wayland.c | 47 | ||||
-rw-r--r-- | gsk/resources/glsl/linear_gradient.glsl | 8 | ||||
-rw-r--r-- | gsk/resources/glsl/radial_gradient.glsl | 8 | ||||
-rw-r--r-- | gtk/gtkwindow.c | 17 |
6 files changed, 60 insertions, 36 deletions
diff --git a/demos/gtk-demo/listview_ucd.c b/demos/gtk-demo/listview_ucd.c index ecaa37d9ac..4331d646fb 100644 --- a/demos/gtk-demo/listview_ucd.c +++ b/demos/gtk-demo/listview_ucd.c @@ -2,6 +2,8 @@ * * This demo shows a multi-column representation of some parts * of the Unicode Character Database, or UCD. + * + * The dataset used here has 33 796 items. */ #include <gtk/gtk.h> diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c index 71a854816b..01c67688f2 100644 --- a/gdk/gdkglcontext.c +++ b/gdk/gdkglcontext.c @@ -864,7 +864,7 @@ gdk_gl_context_get_use_es (GdkGLContext *context) return priv->use_es > 0; } -#ifdef G_ENABLE_CONSISTENCY_CHECKS +#ifdef G_ENABLE_DEBUG static void gl_debug_message_callback (GLenum source, GLenum type, @@ -1008,8 +1008,11 @@ gdk_gl_context_check_extensions (GdkGLContext *context) priv->has_debug_output = epoxy_has_gl_extension ("GL_ARB_debug_output") || epoxy_has_gl_extension ("GL_KHR_debug"); -#ifdef G_ENABLE_CONSISTENCY_CHECKS - if (priv->has_debug_output) +#ifdef G_ENABLE_DEBUG + display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)); + gl_debug = GDK_DISPLAY_DEBUG_CHECK (display, GL_DEBUG); + + if (priv->has_debug_output && gl_debug) { gdk_gl_context_make_current (context); glEnable (GL_DEBUG_OUTPUT); @@ -1039,11 +1042,6 @@ gdk_gl_context_check_extensions (GdkGLContext *context) priv->is_legacy = TRUE; } -#ifdef G_ENABLE_DEBUG - display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)); - gl_debug = GDK_DISPLAY_DEBUG_CHECK (display, GL_DEBUG); -#endif - if (priv->has_khr_debug && gl_debug) { priv->use_khr_debug = TRUE; diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c index e05fdc4b63..72cbc8c2d7 100644 --- a/gdk/wayland/gdksurface-wayland.c +++ b/gdk/wayland/gdksurface-wayland.c @@ -333,7 +333,9 @@ _gdk_wayland_surface_save_size (GdkSurface *surface) { GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface); - if (surface->state & (GDK_TOPLEVEL_STATE_FULLSCREEN | GDK_TOPLEVEL_STATE_MAXIMIZED)) + if (surface->state & (GDK_TOPLEVEL_STATE_FULLSCREEN | + GDK_TOPLEVEL_STATE_MAXIMIZED | + GDK_TOPLEVEL_STATE_TILED)) return; impl->saved_width = surface->width - impl->margin_left - impl->margin_right; @@ -881,24 +883,6 @@ gdk_wayland_surface_finalize (GObject *object) G_OBJECT_CLASS (gdk_wayland_surface_parent_class)->finalize (object); } -static void -gdk_wayland_surface_resize (GdkSurface *surface, - int width, - int height, - int scale) -{ - GdkDisplay *display; - GdkEvent *event; - - event = gdk_configure_event_new (surface, width, height); - - gdk_wayland_surface_update_size (surface, width, height, scale); - _gdk_surface_update_size (surface); - - display = gdk_surface_get_display (surface); - _gdk_wayland_display_deliver_event (display, event); -} - static gboolean is_realized_shell_surface (GdkWaylandSurface *impl) { @@ -920,6 +904,26 @@ is_realized_popup (GdkWaylandSurface *impl) impl->display_server.zxdg_popup_v6); } +static void +gdk_wayland_surface_resize (GdkSurface *surface, + int width, + int height, + int scale) +{ + gdk_wayland_surface_update_size (surface, width, height, scale); + _gdk_surface_update_size (surface); + + if (is_realized_shell_surface (GDK_WAYLAND_SURFACE (surface))) + { + GdkDisplay *display; + GdkEvent *event; + + event = gdk_configure_event_new (surface, width, height); + display = gdk_surface_get_display (surface); + _gdk_wayland_display_deliver_event (display, event); + } +} + static void gdk_wayland_surface_show (GdkSurface *surface, gboolean already_mapped); static void gdk_wayland_surface_hide (GdkSurface *surface); @@ -1350,6 +1354,11 @@ gdk_wayland_surface_configure_toplevel (GdkSurface *surface) /* Save size for next time we get 0x0 */ _gdk_wayland_surface_save_size (surface); } + else + { + width += impl->margin_left + impl->margin_right; + height += impl->margin_top + impl->margin_bottom; + } gdk_wayland_surface_resize (surface, width, height, impl->scale); } diff --git a/gsk/resources/glsl/linear_gradient.glsl b/gsk/resources/glsl/linear_gradient.glsl index 180955ee75..588d9ec744 100644 --- a/gsk/resources/glsl/linear_gradient.glsl +++ b/gsk/resources/glsl/linear_gradient.glsl @@ -9,8 +9,8 @@ _OUT_ vec2 endPoint; _OUT_ float maxDist; _OUT_ vec2 gradient; _OUT_ float gradientLength; -_OUT_ vec4 color_stops[8]; -_OUT_ float color_offsets[8]; +_OUT_ vec4 color_stops[6]; +_OUT_ float color_offsets[6]; void main() { gl_Position = u_projection * u_modelview * vec4(aPosition, 0.0, 1.0); @@ -44,8 +44,8 @@ _IN_ vec2 endPoint; _IN_ float maxDist; _IN_ vec2 gradient; _IN_ float gradientLength; -_IN_ vec4 color_stops[8]; -_IN_ float color_offsets[8]; +_IN_ vec4 color_stops[6]; +_IN_ float color_offsets[6]; void main() { // Position relative to startPoint diff --git a/gsk/resources/glsl/radial_gradient.glsl b/gsk/resources/glsl/radial_gradient.glsl index 97ee2c31f5..178806f83c 100644 --- a/gsk/resources/glsl/radial_gradient.glsl +++ b/gsk/resources/glsl/radial_gradient.glsl @@ -7,8 +7,8 @@ uniform vec2 u_radius; uniform vec2 u_center; _OUT_ vec2 center; -_OUT_ vec4 color_stops[8]; -_OUT_ float color_offsets[8]; +_OUT_ vec4 color_stops[6]; +_OUT_ float color_offsets[6]; _OUT_ float start; _OUT_ float end; @@ -39,8 +39,8 @@ uniform vec2 u_radius; uniform float u_end; _IN_ vec2 center; -_IN_ vec4 color_stops[8]; -_IN_ float color_offsets[8]; +_IN_ vec4 color_stops[6]; +_IN_ float color_offsets[6]; _IN_ float start; _IN_ float end; diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 046079f56f..52e74e82be 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -4729,6 +4729,22 @@ surface_size_changed (GtkWidget *widget, check_scale_changed (GTK_WINDOW (widget)); + if (!(priv->state & (GDK_TOPLEVEL_STATE_FULLSCREEN | + GDK_TOPLEVEL_STATE_MAXIMIZED | + GDK_TOPLEVEL_STATE_TILED | + GDK_TOPLEVEL_STATE_TOP_TILED | + GDK_TOPLEVEL_STATE_RIGHT_TILED | + GDK_TOPLEVEL_STATE_BOTTOM_TILED | + GDK_TOPLEVEL_STATE_LEFT_TILED | + GDK_TOPLEVEL_STATE_MINIMIZED))) + { + GtkWindowGeometryInfo *info; + + info = gtk_window_get_geometry_info (GTK_WINDOW (widget), TRUE); + info->last.configure_request.width = width; + info->last.configure_request.height = height; + } + /* priv->configure_request_count incremented for each * configure request, and decremented to a min of 0 for * each configure notify. @@ -5487,7 +5503,6 @@ gtk_window_move_resize (GtkWindow *window) info->last.geometry = new_geometry; info->last.flags = new_flags; info->last.configure_request = new_request; - /* need to set PPosition so the WM will look at our position, * but we don't want to count PPosition coming and going as a hints * change for future iterations. So we saved info->last prior to |